Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. Random r = new Random();
  2. while (true) {
  3. for (col = 0; col < (gridSize); col++) {
  4. for (row = 0; row < (gridSize); row++) {
  5. grid.matchingNeighbors(row, col, alive){
  6.  
  7. if( r.nextInt(100) > 49 ) {
  8. grid.setPos(row, col, alive);
  9. }
  10. else {
  11. grid.setPos(row, col, dead);
  12. }
  13. }
  14. }
  15.  
  16. grid.update();
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement