[racket] ANN: 2048 game - Racket edition

From: Daniel Prager (daniel.a.prager at gmail.com)
Date: Sun Apr 20 19:38:37 EDT 2014

I've re-implemented the simple, popular, addictive (be warned!), open
source puzzle game 2048 in a single file of Racket:

https://github.com/danprager/racket-2048

It's a clean-room, functional implementation, with I hope reasonable
comments. The commented code is just over 500 lines, plus tests.

One of the nice things about the original 2048 is how many creative
variations have been devised: 3D and 4D, hexagonal grid, AI, Tetris
version, image-based versions, parodies (including numberwang ;-). There
are even sites where you can config your own version. My 8 year-old
daughter did a version based on "there was an old lady who swallowed a fly".

Code review and suggestions appreciated, or just fork and hack away.

Ideas for improving the existing code:
* In-game instructions
* Suggestions on using parameters instead of global *constants*
* Sprites instead of first-principles animation
* Better factoring out of the model and views of the board
* Caching
* Types

But I suspect the real fun is in making game variants.

Notes:
* For less time playing the game try a grid *side* of 3.
* Hold down the space bar (which just rotates the board) for an animated
effect.
* If you find the game too hard, try watching the AI version for some sense
of strategy.

Let me know what you think!

Dan

-- 
*Daniel Prager*
Agile/Lean Coaching, Software Development and Leadership
Startup: www.youpatch.com
Twitter: @agilejitsu <https://twitter.com/agilejitsu>
Blog: agile-jitsu.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140421/2ad248c9/attachment.html>

Posted on the users mailing list.