                    *****************************
                    *                           *
                    *       S h a n g h a      *
                    *                           *
                    *****************************
                     (version 0.44/August 1999)
                     Original version by Julian Jiggins
                     Hacked version by Jrme Mathevet/Speedster Harry
 
 This is a classic asian tile game (Is it chinese or japanese?). The aim is
to pair off tiles with same drawings on it, or that are part of the special
tile-families (any flower may be associated with any flower, any season with
any season). The game ends when you're stuck (no association is possible) or
when you managed to wipe the board, which leads to victory... If all the
explanations remain unclear, try the game, or read the in-game info window.
Also, try the interactive help, it might be helpful.

Right below is what the original author wrote in the program (which still
holds now). Most of it is technical.


1) Original explanation file
----------------------------

 Started on 10th November 1989.
 Written By Julian Jiggins.
 I want this to run under RiscOs so I am using the shell of my eyes program
to start with.
 The name Shanghai will have to be changed as this is a trademark of
Electronic Arts. However the game is traditional so there are no problems
there.
 
 The game uses 144 tiles.

 The tiles are:
    1-9 of characters  (x4)
    1-9 of bamboo      (x4)
    1-9 of Dots        (x4)
    The Red, White and Green Dragon. (x4)
    The North, East, South and West Winds. (x4)
    Winter, Summer, Spring and Autumn Seasons.
    Orchid, Plum, Bamboo and Chrysanthemum Flowers.

  That is 42 unique sprites.

  The board arrangement is

   111111111111
     12222221           The numbers represent the height of the stacks
    1123333211
  ,111234432111,,       with another stuck on top of the middle
  '111234432111''       of the stack of four.
    1123333211
     12222221
   111111111111
   
 Most of the pieces are on a fixed grid so their positions can be stored in a
matrix, however the other 4 pieces are all off centre. So my way of storing
the position of the pieces internally will be to have an array 12x8 plus an
array[4] to contain the coords and info of the remaining pieces.
 The design:
  This really is a game that requires a full window in which to  play however
we want a resizeable window simply so that it will  run under riscos nicely.
We will have an icon in the icon bar containing the options menus. When the
program first runs it will open a full size window. The shell program should
start of just drawing a board with some rectangles that we want to be able to
redraw.
 
 2) About the new version
 ------------------------
 
  When I first saw how the program was built, I thought I could add the undos
quite easily. I wanted to push on a stack every information about the tiles
but the program was way too messy. Many procedures (if not all) have effect
outside, ie they modify variables in the main program, and I couldn't manage
to reuse the original procedures. Furthermore, I couldn't fully understand
the way he remembered the board position. So, I had the idea to make the
tiles invisible (iconflags: bit 23) instead of deleting them. Et Voila ...

Here's what happened since version 0.40:

 Main features:
 --------------
 - Added an unlimited buffer (600 bytes long) for old moves.

 - Now, the 'anymore ?' option gives you how many combinations (combos) you
have left.

 - The interactive help part has been improved, the name of the tiles being
written too. Not much help during game, but it adds a 'chinese flavour' to
the game.

 - Three tile-sets are provided. To swap between them, double-click on
 !Changeset within the !Shanghai application and rerun the game. You could
 add more sprite sets by tweaking the !Boot and !Run files (but work out how
 yourself !).
 
 - Scores (Best Times) are saved to disk along with the names of the
   hiscorers. If you want to reset them, just delete the file called
   'ShanScr' in the app directory.
 
 - Time is constantly updated under the iconbar icon, to keep up the pressure
   ;-)

 - New on 7/08/99:
  * A new default (and gorgeous) tile-set coming from KDE.
  * A more user-friendly behaviour (no more insults !)

 Minor features:
 ---------------

 - Icons are now 'deleted' with bit 23 set (iconflags).

 - adjust-click now leaves menu open.

 - Prettified the code. Sort of. The main issue is range of variables. Many
variables are left global although they should be local. This is a very old
program, anyway ! I've also done some simple speed-ups (for instance, when
the program searches for possible moves).

 - Discarded every call to Module 'Unlucky', and prevented it from loading.
