Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Random r = new Random();
- while (true) {
- for (col = 0; col < (gridSize); col++) {
- for (row = 0; row < (gridSize); row++) {
- grid.matchingNeighbors(row, col, alive){
- if( r.nextInt(100) > 49 ) {
- grid.setPos(row, col, alive);
- }
- else {
- grid.setPos(row, col, dead);
- }
- }
- }
- grid.update();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement