Skip to content

Instantly share code, notes, and snippets.

@robinovitch61
robinovitch61 / game_of_life.py
Created September 25, 2019 18:49
First pair programming at RC - Game of Life
import numpy as np
from scipy.ndimage import convolve
import matplotlib.pyplot as plt
import matplotlib
import copy
# Setup
BOARD_WIDTH = 10
BOARD_HEIGHT = 10
BOARD = np.zeros((BOARD_HEIGHT, BOARD_WIDTH))
# IDEAS FOR COMPUTERIZED OPPONENT:
# [] Add prompt for 1 Player or 2 Player at start of game
# [] Based on number of players, override player selection with random computer selection
# [] Once random selection is working, add more intelligent computer selection (some ideas):
# * If computer could win game, it should win game
# * If computer can put board in state where next move it could win game, it should do that move
# * If computer can put board in state where next move it could win game REGARDLESS of human selection, do that move
# * Apply deep learning on millions of games of tic tac toe to become the ultimate RecurseTacToe algorithm (just kidding :D)