Nasty, nasty code. But it sort of works.
Basic game play.