| ParlorNet Turn-based game server for any computer, old or new | |
| Clients | Protocols | Browsers | Telnet programs | Docs | Source |
Rummy Tile Classic: tile rummy for 2-4 players (NEW rummytile standard players=3; two without it). Flags: staged, nomoves, drop. Rulesets: standard. Options: none.
106 tiles: the numbers 1-13 in four colours, two of each, and two jokers. A tile is written as its colour letter and number, or J for a joker:
| Letter | Colour |
|---|---|
| R | red |
| B | blue |
| K | black |
| Y | yellow |
| J | joker |
R7, B12, K1, Y13, J. The two copies of a tile are interchangeable, and so are the two jokers. A frontend shows the letter as well as the colour, so colour is never the only difference.
TIL RBKY 13 2 2: the colour letters, the highest number, the copies of each tile, the jokers.
| Line | Meaning |
|---|---|
| P n | Tiles left in the pool. |
| C n0 n1 [n2 n3] | Tiles on each seat's rack; the number of fields is the number of seats. |
| I f0 f1 [f2 f3] | 1 when that seat has made its first meld, else 0. |
| G g0 g1 [g2 g3] | 1 for a seat that has left the game (see Leaving), else 0. |
| W seat | Whose turn it is (W - once the game is over). |
| ST k kind tiles... | Set k of the table (numbered from 1, in table order), its tiles in their fixed order. kind: r a valid run, g a valid group, x not a valid set; followed by * when the set is not one that lay on the table when the turn began (made or changed this turn). One line per set. |
| H tiles... | Your rack, sorted by colour (R, B, K, Y) then number, jokers last; up to 16 tiles a line, as many lines as needed. Only in your own view: other players and watchers never see a rack. |
| TP n points code | While the game runs: the tiles the player on turn has played from the rack so far, the points of the sets made this turn (- once that player has made the first meld), and what END would do now: ok (the turn counts), none (nothing played: draw), sets (a set is not valid), meld (first meld under 30), joker (the joker rule fails); for every code but ok, END undoes the turn and draws. |
| T seat points | After the game: each seat's score (the common line). |
The order of the tiles in a set is fixed by the server, so a position means the same to every client: a run is in number order with each joker in the place it fills, spare jokers at the top end (at the bottom once the top reaches 13); a group, or a set that is not valid, is in colour order (R, B, K, Y) by number, jokers last. Every change to a set puts it back in that order. Sets keep their numbers while a turn is staged, except that an emptied set is removed (the later ones move up) and a new set is added at the end.
M is never sent (flag nomoves): there are too many possible steps. Each MOV is one step; several tokens on one MOV are applied in order as a single step (all or nothing; UND takes them back together). Tokens are case-insensitive. k and d are set numbers, p a position in a set (1 = first tile), n a new set (added at the end), r the rack.
| Token | Meaning |
|---|---|
| R7-3 | Put rack tile R7 into set 3. |
| R7B7K7-n | Put rack tiles R7, B7 and K7 into a new set (up to 13 tiles in one token). |
| 3.2-5 | Move tile 2 of set 3 to set 5. 3.2-n: to a new set. |
| 3.R7-5 | The same, naming the tile (the first R7 in set 3); 3.J-n moves a joker. |
| 3.2-r | Take tile 2 of set 3 back to the rack: only a tile played from the rack this turn. |
| 3-5 | Join set 3 onto set 5 (set 3 goes away). |
| 3/4 | Split set 3 before its tile 4: tiles 4 onwards become a new set at the end. |
| reset | Start the turn over: the table and the rack as they were when the turn began. UND takes the reset back. |
MOV answers OK done when END would count the turn now, OK more otherwise. UND takes back the last step. END ends the turn as described above (it never fails while it is your turn: an unready turn is undone and you draw). CHK table !end asks what END would do without doing it: OK ok 3 tiles (with meld 32 before the first meld) or ERR ILLEGAL and the reason (set 4 is not valid, the first meld is 24 points; 30 needed, ...). CHK table token... checks a step without playing it.
All events are seen by every player and watcher, so none of them names a tile from a rack that has not been played: a drawn tile is never named.
A typical step is a step event and one or two SET/DEL lines, 40-120 bytes; ending a turn is 20-40 bytes.
The state is built so that one seat can leave a game of three or four and the others play on. The plugin has an op for it (flag drop), {"op":"drop","state","seat","why":"resign"|"timeout"}, answering like apply (state, events, end). A staged turn of the leaving seat is undone (UNDONE seat none), then GONE seat why; if it was that seat's turn, TURN passes to the next seat still playing. From then on the turn skips the seat, the pool-out end needs only the seats still playing to pass, and the seat's rack stays out of play: at the end it scores minus its whole rack and cannot win. When only one seat is left, the game ends and that seat wins.
The core calls drop for RES and for a turn timeout while more than two seats are still playing, and keeps the table running. With two seats left, RES and a timeout end the whole table as in every game (END resign seat, END timeout seat).
A full view is P, C, I, W, TP (about 50 bytes), one ST line per set (12-60 bytes; at most about 35 valid sets, since all 106 tiles make at most that many) and the rack (H, about 3.5 bytes a tile). An opening view is about 120 bytes; a crowded late table about 1000; the worst case (every tile on the table, a long rack while a turn is staged) stays under 2000. Every line is under 80 bytes: a set has at most 13 tiles and an H line at most 16.
| These pages cover every ParlorNet server. | Source code | ParlorNet is free software. |