soliyawn - entry for 2002 Minigame Compo

Public domain by Russell Marks (rus@svgalib.org)

for 16K/48K/128K Spectrum


(NB: It won't work if a Microdrive or any other additional hardware
 which effectively moves PROG is being used. So don't do that.)


soliyawn is a version of the Solitaire (or Klondike) single-player
card game. It uses the (easier) 1-card draw variant.

After writing ztrack 1k I thought it might be nice to try something a
little more sedate - so I decided to try writing Solitaire after
looking at the 2001 entries, where (apparently) no-one entered any
card games. But a card game was bound to look incredibly boring up
against all the other entries, hence the name. :-)

The aim of the game is to get all the cards in each suit onto the
matching ace pile, in ascending order (with aces low) from ace to
king. To help you do this, you can move cards onto/between the seven
main runs of cards which are dealt when you start. Any face-up cards
on those must be in descending order (K, Q, J, 10, ... 2), and have
alternating red/black suit. When moving cards between the main
`piles', you can only move entire runs (every face-up card on the
`pile'). When moving to a main `pile' which has no cards at all, you
can only move a king there (or the top card of the run you're moving
must be a king).

The display is laid out in the following way:


   main card piles


  deck          aces


Initially you can't see the ace piles, as you have to move an ace to
them before there'll be anything there. :-)

The controls are:

Enter
    turn over a card from the top of the deck (if the deck is empty,
    it flips the turned-over cards back onto the deck first).

1..7 or D
    pick a card (or run) to move from the numbered pile or the deck
    (actually the topmost turned-over card). Once you've pressed this
    key, you then choose where to move it, with 1..7 and A meaning
    either the numbered pile, or the relevant ace pile. If you attempt
    a move which isn't allowed, you'll get beeped at.

Caps-shift+R
    restart - abandon the current game, and reshuffle/deal from
    scratch. (In most emulators Caps-shift will be on the main shift
    key(s).)


There's one known bug - the game lets you move aces onto 2s on the
main piles. This is harmless, but strictly speaking I don't think the
rules allow you to move aces between the main runs. Though I could be
wrong. :-)

-Rus.

PS. The source, suitable for assembly under Unix/Linux using zmac, is
here in src.tar.gz.
