The classic game, in Javascript