JavaScript implementation of the classic game.