ZenScript main repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GridTest.zs 537B

123456789101112131415161718192021222324252627
  1. import example.gui.UpdatableGrid;
  2. import example.threading.ZCThread;
  3. var height = 25;
  4. var width = 25;
  5. var grid = new UpdatableGrid(height, width);
  6. var conwayGrid = new ConwayGrid(height, width);
  7. conwayGrid[4,5] = true;
  8. conwayGrid[5,4] = true;
  9. conwayGrid[5,5] = true;
  10. conwayGrid[5,6] = true;
  11. conwayGrid.updateDisplay(grid);
  12. grid.show("Hello World");
  13. var i = 0;
  14. while(true) {
  15. println("Generation " + i);
  16. conwayGrid.updateDisplay(grid);
  17. grid.update();
  18. ZCThread.sleep((1).seconds());
  19. conwayGrid.update();
  20. i++;
  21. }