3 play klondike and spider solitaire in your unicode terminal.
7 + TODO: duplicate card ♠A found in tableu
8 * TODO: sigcont handler!
9 * TODO: DATA STRUCTURES FOR UNDO
10 CURRENT DS FOR STACK/WASTE ("move over") IS INCOMPATIBLE WITH UNDO!!!!
11 keeping taken card slots empty allows them to be reinserted by undo()
12 * TODO: extreme overlapping: if we are printing a sequence or multiple face
13 down cards, only print `.overlap` lines of the ends, and `1` line for the
15 * TODO: cleanup: in `x2y()` functions there is a lot of replication and noise
16 when calculating legal moves, top cards, etc.
17 * TODO: keyboard alias: twice same key == waste/pile -> foundation
18 * TODO: hjkl keyboard mode
19 * TODO: mouse mode (mouse already enabled)
20 * TODO: highlight `from` pile, so users can see at what input stage they are
21 * TODO: spider keyboard: `<from><to>` stacks; 1-9,0=tableu, return=draw
22 * TODO: spider: easy/medium difficulty: only deal 1/2 suits instead of 4 -> deal()
23 * TODO: use `#ifdef`s to differentiate games (sol, spider, ed-sol, ed-spider)
24 * TODO: patience: allow taking from 0(foundation)
25 * TODO: s/KLONDIKE/PATIENCE/g
26 * TODO: scores (see !w), variants: draw 3, max. n overturns
29 * TODO: ed(1) mode (solEDaire): playable on a line printer; ascii/ibm only?
35 {stock}[waste] [4*foundation]
38 [] (tableu piles) {} {}
46 - enum for each card (e.g. `SPADES_ACE`, `HEARTS_10`)
47 - each pile is an array holding (13 open cards + up to 6 closed)
48 [0] is the "northmost"/bottom-most card; unoccupied are NULL/NO_CARD
49 - a single card is represented in the 'cards' enum; if it is closed, it is negated.
50 - the foundation are 4 arrays of size 13
51 - the stock pile is an array holding n cards and an index to the one to display
52 when removing, decrement stack size and move all cards above index 1 over
53 - previous states array: where to move which cards to get back to the state before
55 double-linked list (follow `.prev` to undo, `.next` to redo)
56 "N cards were moved from X to Y" (do Y->X to undo)
57 allows jumping forwards in time as well (by repeating X->Y)
58 warn: when appending state, must check if `.next` was non-NULL and free rest of chain if so.
59 - multiple card sizes: schemes.h will store cards like below. if we want to draw a card
60 that has one or more other cards below it, we only draw the first `.overlap` lines,
61 otherwise if it is the last one, we draw the whole one.
62 this will give a look like in `~/solitaire-tests`
64 .grid=7, //vertical alignment
81 "closed": face down card