Java – Game of Life

This post was written by Brandon on December 12, 2008
Posted Under: Java

Although its called a "Game of Life" it is not actually a game. It basically shows cell growth and death. Through this Java example you can see the use of 2D arrays and accessing specific points with them. Nested for loops must be used to search and print these arrays. This is a console Java application, but can be remade in GUI as the basic functions are there. View a online demo(not the same as the attached project) and the way it works here: http://www.bitstorm.org/gameoflife/

Download .Class and .Java file: [download#9#size]

Reader Comments

jave games are so cool eventhough they do not have fancy graphics.’`-

#1 
Written By Melanie Long on June 30th, 2010 @ 5:06 am

java games are cool because they need very little resources and the graphics are good too.’~”

#2 
Written By Tristan Coleman on July 24th, 2010 @ 1:14 am

playing Java games has been my past time these days.**

#3 
Written By Jacob Johnson on September 9th, 2010 @ 8:32 pm

jave games are very convenient to use coz they have very small file sizes“,

#4 
Written By Dumbbell Set Weights  on October 12th, 2010 @ 11:21 am

sometimes i play so much java games that i loss track of time `:;

#5 
Written By Rust Paint on December 16th, 2010 @ 3:20 am

I will be really fascinated along with your writing skills as well as with the format on your blog post. Is it a paid out design or did you customize it yourself? No matter what continue the excellent top quality writing, that it is uncommon to see an excellent blog like this one nowadays..

#6 
Written By Cary on September 10th, 2011 @ 1:51 pm

to lvs:我在win下也用的yourfreedom,但是ubuntu下起不来,faq说要用闭源的sun java,我看源里的就是的阿下面是我java -jar的结果:Exception in thread “AWT-EventQueue-0 java.lang.NullPointerExceptionat com.sun.java.swing.plaf.gtk.GTKLookAndFeel.initSystemColorDefaults(GTKLookAndFeel.java:1258)at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.loadStyles(GTKLookAndFeel.java:1500)at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.access$000(GTKLookAndFeel.java:37)at com.sun.java.swing.plaf.gtk.GTKLookAndFeel$WeakPCL$1.run(GTKLookAndFeel.java:1440)at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)java.lang.NullPointerExceptionat javax.swing.plaf.synth.SynthLookAndFeel$AATextListener.propertyChange(SynthLookAndFeel.java:789)at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:347)at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)at java.awt.Toolkit.setDesktopProperty(Toolkit.java:1784)at sun.awt.SunToolkit.fireDesktopFontPropertyChanges(SunToolkit.java:1698)at sun.awt.SunToolkit.setAAFontSettingsCondition(SunToolkit.java:1743)at sun.swing.SwingUtilities2$AATextInfo.getAATextInfo(SwingUtilities2.java:119)at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.initComponentDefaults(GTKLookAndFeel.java:1249)at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.getDefaults(GTKLookAndFeel.java:289)at javax.swing.UIManager.setLookAndFeel(UIManager.java:537)at javax.swing.UIManager.setLookAndFeel(UIManager.java:581)at emgsui.setLAF(emgsui.java:87)at emgsui.main(emgsui.java:16)Exception in thread “AWT-EventQueue-0 java.lang.NullPointerExceptionat com.sun.java.swing.plaf.gtk.GTKLookAndFeel.initSystemColorDefaults(GTKLookAndFeel.java:1258)at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.loadStyles(GTKLookAndFeel.java:1500)at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.access$000(GTKLookAndFeel.java:37)at com.sun.java.swing.plaf.gtk.GTKLookAndFeel$WeakPCL$1.run(GTKLookAndFeel.java:1440)at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)Exception in thread “main” java.lang.NullPointerExceptionat javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:117)at javax.swing.UIDefaults.getUI(UIDefaults.java:736)at javax.swing.UIManager.getUI(UIManager.java:1012)at javax.swing.JPopupMenu.updateUI(JPopupMenu.java:207)at javax.swing.JPopupMenu.(JPopupMenu.java:172)at javax.swing.JPopupMenu.(JPopupMenu.java:157)at de.resolution.emgsui.EMSGUI.systray(EMSGUI.java:90)at de.resolution.emgsui.EMSGUI.(EMSGUI.java:71)at emgsui.main(emgsui.java:41)

#7 
Written By Daniela on December 30th, 2012 @ 9:44 pm

It’s really very difficult in this active life to listen news on TV, thus I only use world wide web for that reason, and get the most recent information.

#8 
Written By best fashion blogs 2010 on May 19th, 2013 @ 11:23 am

Add a Comment

required, use real name
required, will not be published
optional, your blog address