Example #1
0
def showgood2():
    """Sets the board to keep moving through generations of life.
        Allows for pausing with "p", resuming with "Enter"/"Return",
        and automatically pauses the game if the board stops changing
        or becomes blank."""
    global board
    global running
    screen.onkey(gamepause, "p")
    screen.onkey(gameresume, "Return")
    screen.listen()
    if running:
        if board == next_life_generation(board) == \
           next_life_generation(next_life_generation(board)) or allZeroes(board):
            running = False
        else:
            showgood()
            screen.ontimer(showgood2, t=0)
Example #2
0
def showgood():
    """Makes the next life generation appear"""
    global board
    board = next_life_generation(board)
    show(board)