Skip to content
Snippets Groups Projects
Select Git revision
  • b3b75a8a3e25879de2a5e368583fc286b6e6531a
  • main default protected
  • correction_video
  • going_further
  • ImprovedMouseInteraction
  • final2023
  • template
  • ModifGUI
8 results

Matrix.java

Blame
  • Forked from NAVES Guyslain / Game of life Template
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Main.java 566 B
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    
    public class Main{
        public static void main(String args[]) throws IOException {
    	int NUMBER_OF_ROWS = 64;
    	int NUMBER_OF_COLUMNS = 64;
    	
    	GameOfLife gameOfLife = new GameOfLife(new Grid(NUMBER_OF_ROWS, NUMBER_OF_COLUMNS));
    	
    	GameOfLifeGUI gui = new GameOfLifeGUI(gameOfLife.getGrid());
    
    	for(int generation =0; generation < 1000; generation++){
    	    try {
    		Thread.sleep(100);
    	    } catch (InterruptedException ie) {
    
    	    }
    	    gameOfLife.next();
    	    gui.update(gameOfLife.getGrid());
    	}
    	
        }
    }