Make some generic code using first class functions.
Add main loop for playing game.