The following code is the base boilerplate needed to get a simulation running. This code can be found in the file "hello_ca.py":
import pygame from models.ca_models import Grid, Capture, Control SCREEN_SIZE = [800, 450] CELL_SIZE = 10 FRAMERATE = 14 def main_loop(): pygame.init() clock = pygame.time.Clock() main_window = pygame.display.set_mode(SCREEN_SIZE) grid = Grid(CELL_SIZE, 'conway') control = Control(grid) grid.random_seed() while control.running: clock.tick(FRAMERATE) grid.update() pygame.display.set_caption(f'{grid.rule_set.name} step {grid.rule_set.run_ticks}') pygame.display.flip() pygame.quit() if __name__ == '__main__': main_loop()
There was an error while loading. Please reload this page.