Repository navigation
2089 0.1.0
The first release: 2048 in standard C89, with a freestanding core and a program that plays on any terminal, from a teletype to xterm-256color.
- Core (
2089.c,rng89.c): no C library, no static data, 16-bit-intsafe, EBCDIC-safe, external names unique in 6 characters. Deterministic: the same seed and moves give the same game everywhere. Games save to a short canonical string ([0-9a-z.], 25-46 characters for 4x4, usually 32-35). - Line mode (
frontend/text/2089): the C89 library only. One turn per line, arrow keys understood (ANSI, VT100 in either cursor key mode, VT52, 8-bit CSI/SS3), a compact display for slow lines and paper (-k), resume from a save string (-l). - Full screen (
frontend/curses/2089, built whenmakefinds a curses): X/Open curses through terminfo, with line mode as the fallback. Colour after the original game's palette in 256, 16 or 8 colours; mono; and plain, chosen by itself for terminals whose attributes take a screen cell (Wyse 50). Compact cells on slow lines, boards from 2x2 to 8x8, high scores in~/.2089. - Optional one-level undo (
-u), seeded games (-r), board size (-s).
Developed and tested on Linux (gcc, ncurses) and AIX 4.3.3 (XL C and gcc 2.95.3, AIX curses). Legacy terminals tested with Ericom PowerTerm 525 on Windows NT (VT52, VT220, VT420 and Wyse 50 emulations, and at 9600 baud on a serial console); colour tested in xterm-compatible terminals with 8, 16 and 256 colours.
Tests: 533,661 unit and property checks with golden hashes, and 1,000 random games replayed against an independent Python model of the rules.