Guest User

Untitled

a guest
Jan 16th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.94 KB | None | 0 0
  1.  
  2. /////////////////////////////////////////////////////////////////////
  3. ///
  4. /// Contents:  Game of Life
  5. /// Author:   Chris Boehm
  6. /// Date:     October 2012
  7. ///
  8. //////////////////////////////////////////////////////////////////////
  9. package Life;
  10.  
  11. import java.awt.* ;
  12. import javax.swing.* ;
  13. import java.util.Random ;
  14. import java.util.Date ;
  15.  
  16.  
  17. public class GameofLife
  18. {
  19.  
  20.   public static int width = 200, height = 200, pause = 1000 ;
  21.  
  22.   static int[][] lifeMatrix;
  23.  
  24.   public static void main(String[] args)
  25.   {
  26.     lifeMatrix = new int[width][height];
  27.    
  28.     Random Randomizer = new Random() ;
  29.     JFrame frame = new JFrame("Game of Life") ;
  30.     PaintPanel p = new PaintPanel(width,height) ;
  31.     frame.getContentPane().add(p) ;
  32.     frame.pack() ;
  33.     frame.setVisible(true) ;
  34.    
  35.     for(int i = 0; i<10; i++)
  36.     {
  37.         for (int j = 0; j<10; i++)
  38.         {
  39.             lifeMatrix[i][j] = Randomizer.nextInt(2);
  40.            
  41.         }
  42.     }
Add Comment
Please, Sign In to add comment