This is a miniature version of the classic Frogger arcade game. It is written in the smallest amount of JavaScript that I could squeeze it. The core logic of the game is a single function that fits in less than 140 characters.
#OO##OO##OO# O Lilly pad
~~==~~~~==~~ ~ Water
~~~~====~~~~ = Log
:::::::::::: : Grass
............ . Road
..##...##... # Truck
.....@...... @ Frog You
:::::::::::: : Sidewalk
Left Arrow = Move left
Right Arrow = Move right
Up Arrow = Move up
Down Arrow = Move down
The update function is the core logic of the game. It processes all game data for the next display frame. This is the function that I am trying to minimize. I realize it's cheating a bit to ignore the size of the outer script, but it's the benchmark I have chosen since the display mechanism is arbitrary and less important, for my purposes.
The update function can be stripped of white-space and formatted to in less than 140 characters of text which is small enough for tweeting etc.
See my other games:
I had to adopt some alternate rules to make an "interactive" script that doesn't spend 30% of the budget on passing constants & state in/out of the function. The rules also don't allow my onkeydown() and draw() functions to exist... so I'm just trying to make some compromises that don't increase the overall size of the script, just to reduce the size of a single function.