diff --git a/__init__.py b/__init__.py deleted file mode 100644 index 79356a6..0000000 --- a/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .cellular_automaton import * \ No newline at end of file diff --git a/cellular_automaton/display.py b/cellular_automaton/display.py index 11e683e..b8f5013 100644 --- a/cellular_automaton/display.py +++ b/cellular_automaton/display.py @@ -86,7 +86,6 @@ class CAWindow: running = True while running: - pygame.event.get() time_ca_start = time.time() self._ca.evolve_x_times(evolution_steps_per_draw) time_ca_end = time.time() @@ -94,6 +93,10 @@ class CAWindow: time_ds_end = time.time() self.__print_process_duration(time_ca_end, time_ca_start, time_ds_end) + for event in pygame.event.get(): + if event.type == pygame.QUIT: + running = False + def __print_process_duration(self, time_ca_end, time_ca_start, time_ds_end): self._screen.fill([0, 0, 0], ((0, 0), (self.__window_size[0], 30))) self.__write_text((10, 5), "CA: " + "{0:.4f}".format(time_ca_end - time_ca_start) + "s")