A functional way of implementing a Tic Tac Toe in Python