DOG WATCH

Dog Watch: cribbage and patience in the terminal, aboard a ghost boat. The smoking lamp is lit. Peg out by eight bells.

The smoking lamp is lit. Peg out by eight bells.

16:00 aboard. The first dog watch has the deck.

Game 0f66-ac1b-95c5-9332, from a 64-bit seed drawn from /dev/urandom, caught at a random place in the play: hand 6, you 51, Solaine 61, and your eight would pair her eight for 2.
Klondike, deal 1cec-f10e-fcc4-ee6f: a 64-bit seed from the computer's own random source. Type deal 1cec-f10e-fcc4-ee6f at the table and you have this deal too.

Out of uniform

Dog Watch is a card game for your terminal: cribbage against a computer player, and sixteen games of patience, the British word for solitaire. It runs on Linux, macOS and Windows, in any terminal of 80 columns by 24 rows or more, over SSH too. The keyboard does everything; the mouse is optional. Every deal has a number you can share and play again, and every game's odds come with their source.

It is the companion to Ghost Boat, our submarine game set in space. These are the card games the boat's crew play in the dog watches, the two short evening watches of a long, quiet patrol. The rest of this page is the mess deck's notice board.

Mess deck notice 1

POSTED BY THE CHIEF OF THE BOAT FOR ALL HANDS OFF WATCH

Hands wanted for cribbage in the dog watches. The chief of the boat deals. She plays to 121, she counts out loud, and she does not forgive a skunk.

Hands who have never pegged a crib are taught. See the chief.

Patience at the end of the table for anyone who would rather not talk. Take a deal and keep its number.

The cat is the official kibitzer. Do not feed the kibitzer.

Pegs back in the board by eight bells.

Solaine, COB

Cribbage with the chief

Cribbage is the Navy's game and the one the dog watch is for, so it heads the menu. You play against Solaine, the chief of the boat, to 121. She thinks a moment before each card, and any key hurries her.

  • Six cards each, two to the crib. Then the cut, the play to 31, and the show, every hand counted with the cut card. A jack turned up is two for the dealer, his heels.
  • The count, as players say it. At the show each hand's total stands at the end of its row, and where the screen has room the count is written under the cards: fifteen 2, fifteen 4, a pair 6, his nobs 7.
  • Point guides for new hands. In the play, what each card would score if you laid it now. At the discard, what the four you keep would score, for every two you could throw. They are facts, never advice, and Options turns them off.
  • A real board. On a large enough screen, four streets of thirty holes, the skunk line marked, and two pegs each that leapfrog as the log tells each score.
The discard. The point guides give what each keep scores. They state facts and never say which two to throw.
The play, with the point guides beside your hand: run of 3 for 3, or 31 and pair for 4.
The show: every count in players' words, and Luna's opinion, which nobody asked for.

Solaine teaches

Solaine is the official trainer. She teaches the mess table and cribbage in six short lessons, one idea each, as she teaches a new captain's first lessons in Ghost Boat: the table's keys, a hand she plays both sides of while you watch, the crib, the play, the show, and a whole game to 121. When she plays, she shows each move before she makes it and waits for your a. Finish them all and she signs you off for the mess table.

The keys you learn here are Ghost Boat's keys: the log on l, help on ?, every action on M, orders after :, the themes on T and pause on Space. Nothing at a card table is urgent, so it is a gentle way in.

Solaine counts the show aloud, a score at a time, and waits for your a.

The official kibitzer

A kibitzer watches a card game and offers opinions nobody asked for. Dog Watch has Luna, the boat's cat, CDO (Cat Duty Officer), deadpan and never impressed. She has views on the deal, your moves and the name of the watch:

  • CDO LUNADog watch. Two hours, every evening, and not one dog has ever turned up for it. I've checked.
  • CDO LUNABold move, putting it there. Bold. Wrong, but bold.
  • CDO LUNANineteen. The hand that scores nothing, named for the one score no hand can make. I've always liked that.

Type fetch the dog and Luna the Kelpie comes up to the table instead. She is eager and notices everything, and she tells you all of it:

  • DOG LUNACaptain! New deal! I've counted them: all fifty-two, present and correct!
  • DOG LUNAEvery card home, Captain! You won! I'm noting that you won. You won!

Kibitzing is all she does. Luna never tells you a hidden card or the best move, her lines never change the game, and m hushes her. Her lines are a plain data file, so you can rewrite them or put them in another language.

fetch the dog, and Luna the Kelpie takes the cat's place at the table.

Patience, by the families

Sixteen games of patience, grouped as David Parlett groups them in The Penguin Book of Patience, with a good example or two of each family:

  • Simple packers: Klondike, drawing one or three, and Forty Thieves for two decks.
  • Reserved packers: Canfield, turned three at a time or one.
  • Half-open packers: Yukon. Open packers: FreeCell.
  • Spiders: Spider in four suits, two, or one.
  • Simple builders: Amazons, twenty-eight cards in a corner of the screen, and its harder way with two passes.
  • Reserved builders: Golf, Pyramid and TriPeaks. Planners: Calculation.

Every game's help gives its rules, its family and its odds. Where a solver has published the share of deals that can be won with every card known, the game shows it as Solvable, with its source: Klondike 90.5% (81.9% drawing three), FreeCell 99.9988%, Spider in four suits 99.9886%, Canfield 67.6%, Golf 26.1% and Pyramid 8.3%. For the other games it shows a floor from its own automatic player, or its own survey, and says which. Your own record stands beside the odds.

The CARDS window beside the table says what you can know without peeking: cards home, face down and unseen, the plays open, and how many unseen cards would play if they turned up now.

Pyramid, deal f80b-6120-c73d-094e. Pairs that add to 13 leave the table: here the eight and five of spades, or the two of hearts with either jack, and the king goes alone. Solvable 8.3%.
Spider, four suits, deal 9be0-d9cc-1928-eb43. Three builds in suit to open with: the jack of hearts on the queen, the four on the five, the two of spades on the three. Solvable 99.9886%, with every card known.

Every deal by the numbers

The crew shuffle with a cipher. Dog Watch deals every card with ChaCha20, the stream cipher of RFC 8439, at its full twenty rounds, and draws each card's place exactly, so the shuffle favours no order of the deck. A fresh deal's seed comes from your computer's own random source, never the clock.

  • A deal has a number. The header shows it. Tell a shipmate "Klondike, deal 1cec-f10e-fcc4-ee6f", they type deal 1cec-f10e-fcc4-ee6f, and they get the same cards. The order seed says where a deal came from and how to play it again.
  • Plenty of deals. A seed is 64 bits: enough for a deal a minute for some 35 trillion years.
  • Microsoft's FreeCell deals, for fun. deals microsoft plays the 32,000 classic deals by Microsoft's own old generator, deal 11982 included, the one nobody wins. The paper on the deals shows why that generator is a weak one.
  • Honest about it. A deal you can replay from its number is not a secret, and 64 bits of seed reach 264 of the deck's 52! orders, not all of them. The cipher is there so the deals behave like a fair deck.

How the deals are made, with the arithmetic.

FreeCell, deal 605a-8ce5-e819-d0a6, shuffled by ChaCha20, in Via Lactea, one of the light themes.

A game is a file

Every patience is one data file. To make a variant, copy the file of a game like it, change a few fields and drop it in your games folder. No compiling. It joins the menu under its family, and the game reads it the next time it starts. A file that will not load is named in the log with the reason. Each shipped file says in its comments which fields make it differ from Klondike.

Your own games is the guide, family by family.

Any terminal

The cards are drawn in text: box drawing, the suits' own glyphs and their pips in braille. For a terminal or font without those, a serial line or an old console, --ascii draws everything in printable ASCII, the suits as letters, black in capitals and red in small letters: QS, 7h. --mono uses no colour at all, only bold, dim, reverse video and underline, and the game honours NO_COLOR. Either works alone or with the other.

The same title in the ASCII card style, --ascii: printable ASCII and nothing else.
--ascii --mono at 80 by 24: no colour, and every meaning still in the letters.

Or go the other way. T opens 38 colour themes, the same ones all our games share: Luna, Dog Watch's own deep purple, Ghost Boat's fleet colours, light themes for a bright room, and the terminals and home computers you grew up on.

Canfield, deal a401-5d16-6f95-fa4d, in Breadbin, for the C64 crowd, at 80 by 24: the whole game still fits.

By ear

dogwatch --screen-reader plays in plain lines of text under a prompt, cards in words, for a screen reader. Every order works as on the screen, and look reads the whole table. A session at Klondike, deal 1cec-f10e-fcc4-ee6f, as the game says it:

Order: look
Klondike, deal 1cec-f10e-fcc4-ee6f, 0 moves.
Stock: 24 cards; the waste is empty.
Home: nothing yet.
Column 1: the nine of spades.
Column 2: one face down, then the seven of spades.
Column 3: two face down, then the ten of clubs.
Column 4: three face down, then the ace of hearts.
Column 5: four face down, then the two of spades.
Column 6: five face down, then the ace of spades.
Column 7: six face down, then the six of diamonds.
0 cards home, 21 face down, 45 unseen; 4 plays open.
Order: 6 up
ace of spades home from column 6.
Luna: Up. I'd clap, but I'd have to care.
Order: 5 up
two of spades home from column 5.
Order: 1 to 5
nine of spades from column 1 to column 5.
Order: 7 to 3
A column builds down in alternate colours.
Luna: That card wanted nothing to do with it. I know the feeling.
Order: time
The boat's clock reads 16:00. This game has run 0 minutes and 0 seconds.

In the full screen, turn on Speech in Options or start with --speak, and the computer's own voice says the game's news and the card under the cursor. F2 or Ctrl-R says the last thing again. It speaks through spd-say on Linux and say on a Mac. Windows has no voice yet. Accessibility says what works today and what does not.

Kept in the open

Your records are yours, in formats that outlive the game. Each time the game is kept it writes your record at every game as records.csv for a spreadsheet, records.html to print, and records.gmi for a Gemini capsule. log and your own words go into the log as the captain's line, and into logbook.md, plain Markdown that only grows: :log Solaine owes me a grog.

A game in progress is kept as its seed and your moves, so you can leave at any time and carry on later. The header keeps the boat's clock, which starts at 16:00, and your own time beside it. The bell strikes on the half hour, as aboard.

Report to the mess

Dog Watch is in play-testing. Builds are issued for Linux, macOS and Windows: write to command@ghost-boat.net and say which you play on. The roadmap shows what the game does now and what comes next.

The kitty

In plain words: Dog Watch will be sold for a small price. Buy it once and every update after is free. No DRM, no accounts, and nothing collected: the game never goes online, and your saves stay on your own machine. Every release will come with its source, the engine's included, so you can build it yourself. The kitty opens when the play-testing is done.

Papers on the board

The manual
every key, order and table, and every game with its rules and odds
How the deals are made
the cipher, the seed, Microsoft's old generator, and what a seed can and cannot promise
Your own games
how a patience is written as a file, and how to make a variant of your own
The roadmap
what is in the game now, what play-testers have, and what comes next
Accessibility
what works today for players who listen rather than look, and what does not
Terms of issue
what you may do with the game, its source and its files: share mods, credit the author

Ghost Boat

If you like our games, check out Ghost Boat!