That's actually a really fun game! Just played the online version
via the link ;).

I am not quite sure what you are trying to do with the code - are you
trying to re-write the game in Java or...