Вы находитесь на странице: 1из 12

3

MAH JONGG
Release 3.2, October 10, 1989
0 0

Nels Anderson
92 Bishop Drive
Framingham, MA 01701

0 0 8
0 0

0 0

MAH JONGG is an ancient Chinese game whose origins are supposed


to date back some 3000 years. This version has similarities to
solitaire played with cards and also with dominoes since it is
played with tiles. When I first discovered the game my initial
impression was that the game would quickly become dull but having
played it for a while and having given it to friends we've all
found that it is quite addictive despite its apparent simplicity.
This program is designed for a PCompatible that can run in EGA
graphics mode. If you're still running an older video card I'm
afraid the game won't work. (Apparently many people do not
understand the differences between EGA, CGA, VGA, MDA, etc.;
basically, if you get a screen full of letters blinking on and
off when you try to run MAH JONGG you don't have EGA and the
game will not work on your system.) When I originally wrote
MAH JONGG I had never seen a game that used the full EGA
capabilities (640x350, 16 colors) and I thought it would be nice
if there was one.
This version also supports Hercules graphics mode. Since it's
monochrome it's not nearly as pretty as EGA but the resolution is
similar so it's not bad. The type of video you have is now
automatically detected, so you should not have to do anything to
get the right mode.
If your system won't automatically select the right video mode
for some reason, you can force a specific mode using command line
parameters as follows:
mahjongg -h
mahjongg -e
mahjongg -l

(forces Hercules graphics mode)


(forces full color EGA graphics mode)
(forces monochrome EGA graphics mode)

I hadn't planned on doing any versions other than EGA, but


Hercules turned out to be so easy I figured, why not? Recently,
several people suggested adding a monochrome EGA mode for laptop
systems that have an EGA compatible LCD or similar display.
Since I'd already done all the work of making monochrome look
right for the Hercules version, this was easy to add too. I
don't have versions for other video adapters and I don't have any
plans for them since I don't consider any of the lower resolutions
adequate.
Since I do not program games for a living but still put quite a
bit of effort into MAH JONGG I am releasing the program as
Shareware. If you enjoy the game, as I think you will, a $10
donation to reward my efforts would be appreciated. Please let
me know what version you have and I'd also be interested in
knowing where you got it from. Make sure you put your name and
address on your letter. Or, use the instant registration form in

the file "orderfrm.txt". Just copy the file to your printer. If


you don't understand the term "Shareware" please read the file
"sharewre.txt". In return for your registration you'll receive
the latest version of the game plus a setup utility that is made
available only to registered users.
If you have any suggestions or discover any problems with the
program you can reach me via the )(evious BBS (PCBoard) system
(300/1200/2400/9600-HST, 8N1) at 508-875-3618 or 617-449-7322.
Leave a C)omment to the sysop to reach me. )(evious is the
official support BBS for all my software and the latest versions
are always available for downloading there. There is also a
support conference for people to exchange game tips or ask
questions. J)oin conference #31 and check out the latest tips.
You can also reach )(evious through RelayNet. If there's a
RelayNet board in your area send a routed message to me at node
XEVIOUS. The Shareware conference would be the best choice,
but if that's not available try TPascal, Games or even Common.
If you're connected to one of the minicomputer nets (InterNet,
uucp...) you can try reaching me at one of these addresses:
ima!primerd!en-m32.prime.com!nja
uunet!en-m32.prime.com!nja
csnet-relay!en-m32.prime.com!nja
nja%en-m32.prime.com@relay.cs.net
nja@en-m32.prime.com
Of course you can also write me at the address at the beginning
of this file. If you're not a registered user don't expect an
answer unless you include a self-addressed, stamped envelope.
Most of the instructions you'll need for playing the game are
built into it; just type H when prompted at the title screen.
you can read the instructions below. There is quite a bit of
strategy involved if you are to do well but I'll leave the
strategies up to you to discover. Besides, I'm no expert in
playing the game either.

Or

*****************************************************************************
*
PLAYING THE GAME
*
*****************************************************************************
OBJECT:
The object of the game is to remove as many of the tiles from
the playing board as possible within the rules of the game.
Tiles are always removed in pairs and can only be removed from
the left or the right edges. Any tile that is not on a left or
right edge is considered blocked and cannot be removed. Note
though that the tiles are arranged in 5 levels and each level
has a left and right edge so there are many more unblocked
tiles than it would first appear. Note that the tile on the
top of the pile blocks all four tiles below it, and tiles on
row 5 block both rows 4 and 6.
SUITS OF TILES:

There are many different suits of tiles and the suit of a tile
determines the rule used for matching tiles that can be removed
together.
MATCHING RULES:
Most of the tile suits require an exact match. This means that
you must match a tile to another that is exactly the same. For
example a Bamboo 1 matches another Bamboo 1 but does not match
a Bamboo 3 or a Dot 1. The other matching rule allows any tile
in the same suit to match any other tile in that suit. Thus,
any of the four seasons (SUM, AUT, WIN, SPR) match each other
and any of the four flowers (MUM, PLUM, BAM, ORC) match each
other.
NUMBER OF TILES:
There is only one each of SUM, AUT, WIN, SPR, MUM, PLUM, BAM,
and ORC. There are four of each of the other tiles for a
total of 144 tiles on the board. A counter keeps track of how
many tiles are left in play. If you want to see what tiles
you have removed so far, hit F2 (though some might consider
this cheating!).
BOARD LAYOUT:
If you're using a mouse to play you don't need to worry about
the board coordinates; you just point and click. Many game
commands are also there as "keys" that can be clicked on. If
you don't have a mouse, read on...
The game board is a grid marked by letters and numbers. You
select tiles by entering a letter for the column and a number
for the row. Order doesn't matter, enteri.g A5 is the same as
5A. The single tile on the topmost level is H5.
The numbering of the rows is a bit confusing. Row 5 only
exists at the very top level and at the extreme left and right
edges. Rows 4 and 6 are actually adjacent to each other.
SENT

0.0

RETURN
END
C--------------------------------------------------------------------C
SUBROUTINE BMARCH
C--------------------------------------------------------------------C
INCLUDE 'COMMON.FOR'
C....................................................................C
C
C
C
Provides time dependent driving parameters
C
C
C
C
FRS
= net solar absorbed in the point
C
C
SABVEG = vegetation absorbed
C
C
SOLIS = shortwave solar incident
C
C................................................................... C

C
C
C

Number of days you need for integration


NDAYS = 2
Hour when you start
HOUR = 18.
Number of steps
IMAX = NINT(24*NDAYS*C(6)/C(4))

C--------------------------------------------------------------------C
C
Interpolation
C--------------------------------------------------------------------C
C

Number of measured values


NMV = 49
DO 44 L=1,NMV
HOURS0 (L) = HOURS (L)
TEMP0 (L) = TEMP (L)
HUMID0 (L) = HUMID (L)
RAIN0 (L) = RAIN (L)
WIND0 (L) = WIND (L)
CLOUD0 (L) = CLOUD (L)
SHORTW0(L) = SHORTW(L)
This is the reverse
of the undo function. You can undo and restore as many
moves as you want. (F6 does the same thing).
F1 will display a summary of commands and other information.
F2 will show the tiles you've removed so far.
F3 goes to the set up screen.
F4 will undo your last move.
F5 shows you your playing statistics.
F6 will undo your last undo (e.g., it will remove the tiles
again).
F7 goes to the tournament set up screen.
F10 shells to DOS. Type 'EXIT' to return to the game.
If you are using a mouse, many of these commands are available
as pushbuttons along the left side of the screen. Just slide
the cursor over the command you want and click. Hitting the
right mouse button is a short-cut way of asking for help. See
the section on using the mouse below.
In summary, the commands are:
Q:
H:
S:
F1:
F3:
F5:
F10:

Quit
Help
Save
Commands
Set up
Stats
DOS shell

N:
A:
R:
F2:
F4:
F6:
F7:

New game (next board)


Again (replay same board)
Restore
Tiles played so far
Undo last move (U also works)
Undo last undo (Z also works)
Tournament set up

COMMAND LINE OPTIONS:


There are several options you can give when starting the game.
You can skip the title screen by using -n (No title). You can
play a specific board by entering -bx where x is any number
between 0 and 65535. For example, you can replay the previous
game by noting the board number in the lower left hand corner
before quitting and using that. Or you can play against
another person by both choosing the same board number and

seeing who can remove the most tiles. You can play timed games
by entering -tx where x is the number of minutes you want the
game to be. This is primarily for competitive games. You can
still continue to play the game after the time runs out. The
amount of time left to play is shown in the upper right corner
of the screen just above the number of tiles left. Using -cx
allows you to set the background color and -dx the mouse
cursor color, where x is a number between 0 and 15. Using -m
selects mouse control instead of keyboard. Using -fn selects a
file named n as the file in which your statistics will be kept
instead of the default file "\mahstats"; n can be complete
with disk and path names. Using -f with no file name disables
keeping of statistics.
The command line options are done in a standard way but if
you're not familiar with this sort of thing they may be
somewhat confusing so here are some examples.
Command line option examples:
If you want to play a game that will be timed for 10 minutes,
the command line would be:
MAHJONGG -T10
Notice there is no space between the -T and the number of
minutes (10). The other commands work the same way. To play
board number 12345 the command line would be:
MAHJONGG -B12345
You can combine commands too, so to play board 12345 as a 10
minute timed game the command line would be:
MAHJONGG -T10 -B12345
There is also a setup screen that allows you to select any of
the options that are available on the command line. Just hit
S from the title screen to go to setup. You can also access
setup at any time during a game by hitting the F3 key.
If you forget the command line options, just start up the game
with an invalid option and it will give you the proper usage
(i.e., try using "mahjongg -?" which since it is not a valid
option with give the valid option list).
In summary, the command line options are:
-n
-m
-bx
-tx
-cx
-dx
-fn
-h
-e
-l
-li

No title page
use Mouse
play Board x (0 <= x <= 65535)
Timed game (x=length in minutes)
background Color x (0 <= x <= 15)
mouse cursor color x (0 <= x <= 15)
File n is the statistics file
run in Hercules graphics mode
run in full color EGA graphics mode
run in Laptop (monochrome EGA) mode
run in Laptop mode with inverse video

STATISTICS:
It seems that a lot of players are interested in game
statistics, so the game now keeps track of some statistics for
you automatically. A file is made that keeps track of all the
board numbers you've played, which ones you've won, your best
and worst scores, etc.
You can view some of your stats from within the game by hitting
the F5 key. The separate utility program, "statgen" can be run
on your stats file to give a more complete report. Just type
"statgen" to run it, give it the path and name of your stats
file when requested, and a complete report will be shown on
your screen. For more details, see the section on statgen later
in these docs.
If you have several people playing on the same PC they can each
have their own statistics by using the select statistics file
command line option, -fn where n is the name of the file. For
example, if Fred and Dick both use the same PC, Fred might start
the game as:
MAHJONGG -FFRED.STT
and Dick might start the game as:
MAHJONGG -F\DICKSDIR\DICK.STT
To disable keeping of statistics, use -f with no file name on
your command line.
TOURNAMENTS:
You can play Mah Jongg as a tournament against other players.
In a tournament each person plays a single board under the
exact same conditions (same board number and same time limit,
if any), allowing their results to be compared and a winner to
be determined.
You enter the tournament set up screen either by using the T
option from the title screen or by hitting F7 at any time
during a game. The first player sets up the tournament by
selecting the board number (or by just leaving the one that
was randomly chosen) and whether or not the game will be
timed. After the selections are made the first player enters
his name and plays the game. A record is kept of his results
and the results of each additional person who plays the
tournament.
If you go to the tournament screen by accident or just to see
the current standings, you can leave the screen without
entering the tournament by entering Q.
If there is already a tournament started but you want to start
a new one, enter 'N'. This will let you set up a new
tournament as was described above. Tournament records are
kept in a file called "mah.trn" so you can also start a new
tournament by deleting this file.

USING A MOUSE:
If you have a mouse driver installed on your computer it will
automatically be detected when the game starts and mouse play
will be selected. If for some reason your mouse is not being
automatically detected you can still select it from the setup
screen or by using the -m option on the command line. You can
also use the setup screen to turn off the mouse if you wish.
The game was tested using a Mouse Systems PC Mouse but any
Microsoft-compatible mouse will probably work. When using a
mouse most commands can be issued using the mouse. You must
have your mouse driver installed as a device in your config.sys
file for Mah Jongg to be able to use the mouse.
The mouse interface is a bit different from what you're
probably used to but it seems to be easy enough to use. Tiles
are selected by moving a colored outline over them and then
clicking once. To de-select the first tile, just click on it
a second time. After selecting both tiles a line with the
options "Y/N" (yes/no) comes up. If you just click without
moving the mouse you'll select yes and the tiles will be
removed. Slide the mouse left and right to change your
selection.
Many commands available during the game (help, new, undo, file,
setup, quit) are available as "keys" along the left side of
the screen. Move the outline over the command you want and
click once.
"Help" and "Quit" require a yes or no confirmation so you
won't do them by accident. Slide the mouse left and right to
select yes or no and then click. The help command first asks
if you want to see matching tiles (if there are no more
matches it will tell you that instead) and then prompts for a
yes or no to see each additional matching pair of tiles. If
you ask for help after you've already selected the first tile
a search for matching free tiles takes place. If a match is
found, it is highlighted and all you need to do is confirm to
remove the pair of tiles. If no match is found it puts you
back to select the first tile again. There is a short-cut for
mouse users to invoke help. Just hit the right mouse button
to get help in selecting either tile. Normally it doesn't
matter which mouse button you use.
"New" lets you end the current game and either replay the same
board or go on to the next board. You will be prompted to
select either "next" or "again" to either go on to the next
consecutive board or to play the same board again.
"Undo" replaces the last two tiles you removed. You can undo
as many times as you want until all 144 tiles are back on the
board. Undo does not ask for any confirmation. Undo actually
allows you to replay your entire game both forward and
backward. Clicking the left mouse button restores tiles that
were removed and clicking the right mouse button takes the
tiles back off again.
"File" lets you either save the game at its current point or
load a previously saved game. You are prompted to choose

between "load" and "save" and finally to confirm that you


really want to do it.
"Setup" brings you to the set up screen, the same as hitting
"S" from the title screen. You can then change colors, set
timed games, disable the mouse, select a specific board, etc.
Changing colors or enabling the mouse will not effect the game
in progress; when you exit set up you will be back at the same
point in the game that you were at when you entered set up.
Any error messages that appear during the game (i.e. "Invalid
Selection") normally stay visible for a few seconds before
allowing play to continue. To immediately remove a message
and resume play just click the mouse or hit a key.
USING STATGEN:
New to v3.2 of Mah Jongg is a utility called statgen.exe.
This program allows you to analyze and modify the statistics
file that is kept each time you play the game.
To run the statistics generator, just type "statgen" on a
line by itself. You'll be prompted for the filename of your
statistics file and you'll be asked if you want to edit
(enter a letter E) or just display (enter a D) your current
statistics.
If you select display, you'll be shown your total games
played, average score, number won and worst score. Then a
list of all board numbers won and another list of additional
boards played will be shown.
If you select edit you can change the list of boards played
and won to include boards you played before v3.2. Just
select edit and you'll first be prompted for the boards
you've won. Enter one board number per line and finally
enter a -1 when you're done. Then you'll enter the list of
additional boards played but not won in the same way. Again
you enter a -1 when done. After you're done editing statgen
will show you your current stats so you can confirm that
you've entered everything correctly.
You can also enter statgen's parameters from the command
line. The first parameter is the statistics file name and
the second is either -e (to edit) or -d (to display). If
you only enter one parameter display is assumed. For
example, to edit the statistics file "stats.me" the command
line would be
statgen stats.me -e
There is also a "batch mode" available for those of you who
have kept your records in a database. You'll need to transfer
your games played and games won list into a straight ASCII text
file with one board number per line and a -1 after the end of
the won board list and another -1 at the end of the file. For
example, if you've played boards 100, 101 and 102 and played
and won boards 200 and 201 your file would look like this:
200
201

-1
100
101
102
-1
Save this file under whatever name you choose. For this example
we'll say it was saved with the filename "temp". Then, to read
these board numbers into your statistics, run statgen as follows:
statgen mahstats -b < temp
This assumes that statgen is in your current directory, your
stats file is called mahstats and it also is in the current
directory and your list of boards is in the file temp. After
temp has been read in, your new stats will be displayed to
verify that everything worked. Suggestion: before running in
batch mode, make a backup copy of your stats file in case
something goes wrong.
NEW FEATURES:
Many new features have been added since the original release
of the game. These include:
NEW IN 3.2:
"Boss Mode" has been replaced by a true shell to DOS
Records kept of boards played and won:
If the current board has been played before, an asterisk
will appear next to the board number; if the board has
been won, the word "WON" will appear next to the board
number
Separate statistics generator program displays your stats
plus list of boards played and won
Improved accuracy of average score statistic
Automatically enables mouse play if mouse driver detected
Exit screen written directly to memory instead of using ANSI
NEW IN 3.1:
Stats no longer overflow
Stats now correctly update when you win a game
Tournament set up screen now available during game
Automatically detects EGA and Hercules cards
Monochrome EGA selectable for LCD laptop computers
Command line parameters can be made permanent using
setup program (available to registered users only)

NEW IN 3.0:
Runs in Hercules graphics mode
Game statistics kept for current game and for all games
played
Undo command (both forward and backward)
Set up screen available during game
Tile corners now display properly
NEW SINCE 2.6:
Fixed bug in tournament mode (stats weren't being saved)
A list of all pairs of tiles played so far is available by
hitting the F2 key
NEW SINCE 2.5:
Mouse cursor color is now selectable from command line or
setup screen
When playing a tournament game your score was not always
saved if you completed the board; this is now fixed
NEW SINCE 2.3:
Help screen -- hit F1 to get a list of commands, options,
and some basic playing tips
"Boss Mode" -- hit F10 to hide the game and display a
harmless looking disk directory
New tournaments can be started from within the tournament
setup screen
After winning a game, answering "Y" to play again gives
you a different board instead of the same one over again
Requesting to quit when selecting the second tile now asks
for a confirmation
NEW SINCE 2.2:
Columns entered as letters instead of numbers; rows and
columns can be entered in any order as a result
Several tiles redrawn
NEW SINCE 2.1:
ATI EGAWonder card problem workaround added
Mouse cursor display sped up (possible fix to NEC EGA

card problem of not showing mouse cursor)


NEW SINCE 2.0:
Help on 2nd tile selection (find match to 1st tile if any)
Help available with right mouse button as a short-cut
Error messages can be cancelled by clicking the mouse
Confirmation required for mouse action "keys" to prevent
accidents
NEW SINCE 1.0:
Mouse support
Setup screen, allows access to all game options more easily
than through command line options
Tournament play
Selectable background color
New commands during play
A (play same board Again)
N (play New board)
More command line options
-cx (background Color)
-r (Restart saved game)
-m (use Mouse)
More authentic tile appearance
Faster tile displaying
WINNING
Not all boards are win-able but during testing a number of
boards that are beatable were found. In addition, many people
who have written to register their copy of Mah Jongg have
included lists of boards they have completed. If you want to
play a board that definitely can be won, try one of the
following:
55598, 49070, 64856, 15784, 29514, 54176, 40060, 8, 44213, 21,
43, 148, 290, 302, 329, 364, 370, 386, 410, 421, 459, 560,
627, 634, 656, 695, 735, 743, 795, 819, 827, 839, 858, 876,
888, 890, 905, 936, 952, 985, 1034, 1037, 1066, 1101, 1104,
1138, 1145, 1149, 1154, 1207, 1241, 1244, 1296, 1313, 1346,
1365, 1390, 1392, 1428, 1430, 1490, 1543, 55309, 43924, 47924,
38313, 23986, 45355, 55082, 6843, 52079, 50333, 24654, 64557,
14, 54438, 2, 52916, 32141, 62500, 50408, 5119, 8694, 12224,
27869, 47615, 49522, 56447, 4113, 6108, 36785, 38382, 54586,
36607, 63202, 4540, 21015, 1132, 37696, 20009, 19619, 42246,
56809, 5336, 61319, 15037, 33357, 52158, 63866, 41619, 48165,

13692,
15318,
16496,
54491,
20926,
53751,

17604,
59498,
16213,
43421,
1, 23,
58094.

40284, 47779, 57572, 13932, 4236, 4243, 24942,


50542, 41121, 4344, 38110, 26208, 307, 32812,
47788, 65123, 36792, 16965, 3989, 63331, 40111,
10796, 56185, 40640, 433, 9619, 8922, 800,
56, 7971, 21399, 32381, 33212, 36836, 48094,

Enjoy!
INCOMPATIBILITIES:
Early versions of MAHJONGG had problems running on an ATI EGA
Wonder card. The problem is with the BIOS ROM on the card,
not with the game. ATI should by now have an upgrade ROM
available to fix their bug so you may want to contact them
about it. MAHJONGG Release 2.1.1 and later should work
properly on the ATI card even without the BIOS upgrade.
I've also heard that an NEC built EGA card (not sure of model)
does not display the mouse cursor. I think I've done
something in Rev. 2.1.1 that will prevent the problem but I
don't have the proper system to test it on.

Вам также может понравиться