intermediate code to play game