Пример #1
0
    def test_ressurrect_3(self):
        state = from_string(2, 3, ".*.*.*")
        next_state = next_generation(state)

        self.assertTrue(next_state.is_alive(1, 1))
Пример #2
0
    def test_dying_alone(self):
        state = from_string(1, 3, ".*.")
        next_state = next_generation(state)

        self.assertFalse(next_state.is_alive(0, 1))
Пример #3
0
    def test_not_ressurrect_2(self):
        state = from_string(2, 3, "...*.*")
        next_state = next_generation(state)

        self.assertFalse(next_state.is_alive(1, 1))
Пример #4
0
    def test_dying_5(self):
        state = from_string(2, 3, "******")
        next_state = next_generation(state)

        self.assertFalse(next_state.is_alive(1, 1))
Пример #5
0
    def test_not_dying_3_variation(self):
        state = from_string(2, 3, ".*.***")
        next_state = next_generation(state)

        self.assertTrue(next_state.is_alive(1, 1))
Пример #6
0
    def test_not_dying_3(self):
        state = from_string(2, 3, "***.*.")
        next_state = next_generation(state)

        self.assertTrue(next_state.is_alive(0, 1))
Пример #7
0
 def next_step(self):
     if not self.pause:
         self.state = next_generation(self.state)
         self.draw_state()
     self.frame.after(self.DELAY, self.next_step)