home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Game Killer
/
Game_Killer.bin
/
210.MJSOLVER.DOC
< prev
next >
Wrap
Text File
|
1990-08-21
|
14KB
|
278 lines
MJSOLVER v1.1
Copyright (C) 1990 by Ken McDonald
--------------------- What Is MJSOLVER? ----------------------
MJSolver is designed for use with Mah Jongg 3.3 (C) by Nels
Anderson. It's major function is to rapidly test any of the
65536 Mah Jongg boards for the best possible score.
MJSOLV11 is hereby released as shareware. If you enjoy this
product and decide to keep using it, please send the suggested
registration price of $5.00 (in U.S. funds, please) to me at
the address found at the end of this document.
You may freely distribute MJSOLV11 (and are even encouraged
to do so!) as long as the following files are included intact
and in unedited form within the archived package:
MJSOLVER.EXE - the main MJSolver program
AUTOSOLV.EXE - calls Mah Jongg for auto-play
MJSOLVER.DOC - this document
The archiving method may be changed as necessary, however
no other alterations, additions or deletions are authorized.
While MJSOLV11 is meant to be used with Mah Jongg 3.3 (and is
quite dependent upon it), it may not be bundled with this, or
any other software package, without the express permission of
the authors.
This software is released in as is condition. Although it
has been tested on several different hardware configurations,
there is simply no way to guarantee it's performance or com-
patibility on every possible setup. The author will therefore
accept no responsibility nor liability for any damage arising
from it's use or distribution and does hereby disclaim any
warranties, either implied or expressed.
----------------------- What It Does: ------------------------
How many times have you started a Mah Jongg game which has
ended after removing only 20 or 30 tiles? How about all those
games that have ended with only 2 (or 4, or 16) tiles remain-
ing? Does the "Additional Boards Played:" section of your
statistics file far outweigh the "List of Boards Won:"? Well,
now MJSolver can help you win some of these boards that you
might otherwise have given up on!
MJSolver will run as many as 65535 simulated plays on any
board input from the user, while presenting a running tally of
it's progress. After running the simulations, you will have
the option of playing the board yourself or, if you'd rather,
let MJSolver show you the best solution that it came up with.
----------------------- Using MJSOLVER -----------------------
MJSolver may be run from the DOS prompt or via a batch file
(more on the .BAT method later) on either a floppy- or hard-
drive based system. In either case, there should be disk space
available for MJSolver to save a file which contains the moves
resulting in the best score achieved during the simulations,
as well as it's own statistics file. See the "defaults" infor-
mation below, and the ---Menu Options--- section for details.
MJSolver uses information entered at the command line when
it is first run. To see the parameters it uses, from the DOS
prompt type:
MJSOLVER ? <CR> (There must be 1 or more spaces
between "MJSOLVER" and "?")
Note: The symbol "<CR>" is used in this document to signify a
carriage return.
You will then see an example of the syntax as well as a
brief reminder of the type of information MJSolver expects for
each parameter. No particular order is necessary when entering
these parameters, nor are they all needed for MJSolver to run.
If you leave out any parameters or enter any information that
MJSolver doesn't understand, certain defaults will be used as
explained below.
-bx Passes the board number to MJsolver. Legal
values for "x" are any number between 0 and
65535. Default = random number.
-sx The number of simulations you wish to run.
Enter any value from 1 to 65535 for "x". De-
fault = 1000.
-pax Tells MJSolver where Mah Jongg is located.
This might be needed if the Mah Jongg files
are in a different drive and/or directory
than where MJSolver was run from. (MJSolver
automatically searchs the current directory,
all directories found in your PATH, and then
the directory that MJSolver itself resides
in for MAHJONGG.EXE)
-px This is used to slow down the (A)uto play of
the board tested. Values for "x" may be any
number between 0 and 5000. Default = 10 ms.
(Example: "-p2000" = 2 second delay.)
-q While running the simulations, MJSolver will
beep to indicate that it has found a winning
sequence of moves. Using the "-q" parameter
will suppress this beep, telling MJSolver to
run in "quiet" mode. Default = beep is "ON".
<mjs> Any parameters you wish to pass to Mah Jongg
should also be included, if the board is to
be played following the simulations. In gen-
eral, any options you would normally use to
run Mah Jongg should also be entered here.
(Example: "-e -uwb" uses EGA color graphics
and selects the Warner Bros. tile set.) The
normal defaults for Mah Jongg will be used
if nothing is otherwise specified.
As mentioned earlier, MJSolver saves game-play statistics
to a seperate file, called "AUTOSTAT" by default. The purpose
here is to keep from "padding" your own statistics file with
those generated during testing and any subsequent play. If you
wish, you may override this by specifying the filename of your
existing statistics file. (e.g. "-f\mahstats")
Valid command lines used to start MJSolver could then range
from the simple: "MJSOLVER <CR>" to the extreme: "MJSOLVER -b9
-s2000 -paC:\GAMES\MAHJONGG -q -fC:\GAMES\MAHJONGG\MAHSTATS
-p5 -t20 -e -uwb <CR>"! The first example instructs MJSolver
to run 1000 simulations on a randomly selected board, beep
upon each win, save statistics to AUTOSTATS, use a 10ms delay
for auto-play, and use all default Mah Jongg options. The
second will run 2000 simulations on board number 9, change to
C:\GAMES\MAHJONGG (if the board will be later played), silence
the beeps, save statistics to C:\GAMES\MAHJONGG\MAHSTATS, use
a 5ms (auto-play) delay, time (manual) play to 20 minutes, and
run in EGA color graphics mode with the Warner Bros. tile set!
--------------------- Running From a .BAT --------------------
As you can see from the preceding example, the command line
could get somewhat long and complex. A better method may be to
make a batch file similiar to the following MJS.BAT:
@echo off (remove "@" if using DOS 3.2 or earlier)
cd \games\mjsolver (assumes MJSOLV11 files are here....)
mjsolver -b%1 -s2000 -pac:\games\mahjongg -q │PUT ALL THIS│
-fc:\games\mahjongg\mahstats -p5 -t20 -e -u%2 │ON ONE LINE!│
Running MJS.BAT by typing "MJS 9 WB <CR>" will then cause
MJSolver to use the same setup as in the 2nd example from the
previous section!
-------------------- The MJSolver Display --------------------
Using whichever method you prefer, once MJSolver is running
you will be presented with a "working" screen indicating the
board number currently being tested, the number of games com-
pleted, the current test score, the average score, the "best
case" and "worst case" results, and the number of wins found
so far for this board. On the message bar at the bottom of the
screen you'll see "Analyzing xxxx Simulations", indicating how
many times MJSolver will test the selected board, and "Press
"Q" to Quit". If a solution has been found, or if you just de-
cide not to let MJSolver finish the set number of simulations,
you may halt the program at any time by pressing this key. The
process may then be resumed by striking <CR>.
It should probably be pointed out here that the method used
during testing is based on random selection of tile pairs with
equal weight given to all legal moves. Because of this random
nature, a winning combination of moves may not be found during
the first set of simulations run. As with all such random pro-
cesses, the results will be more statistically correct for a
large number of tests and may not reflect the results you will
achieve using your own methods. Don't be too surprised if you
beat a "hard" board on your first attempt, or if an "easy" one
seems impossible! This is the reason for AUTOSOLV: to let you
watch the board being played using the sequence of moves found
by MJSolver. This also leads into the next section....
------------------------ Menu Options ------------------------
Once finished with the simulations, the message bar will be
replaced offering the options listed below. Entering the high-
lighted letter selects that option.
Next - Allows you to run simulations again. Hitting
"N" displays the next board number. You may
then hit <CR> to select this board or <ESC>
to clear the number. Hit <ESC> once more to
cancel this option or type in the number of
your own choice followed by <CR> to run.
Play - This is the manual play option. Mah Jongg is
then loaded and run using the play options
specified on the MJSolver command line.
Auto - Selecting this option will cause MJSolver to
save the best-case moves to disk (using the
default filename of MAHMOVES.DAT). AUTOSOLV
then calls Mah Jongg, and the board is play-
ed using MAHMOVES.DAT as input. If the board
was found to be winnable, the last two tiles
will not be removed by AUTOSOLV. This allows
you to replace tiles and manually play from
any point you may choose. Note: MAHMOVES.DAT
will be overwritten as new data is saved.
Save - Allows you to save the moves information to
disk under a unique filename. The default is
in the form "bd_xxxxx.dat" where xxxxx is a
five digit representation of the board num-
ber. Hit <ESC> to clear the default filename
and then type in your own. Hitting <CR> uses
the name supplied, while a second <ESC> can-
cels the option.
Exit - Quits MJSolver and exits to DOS. (All other
selections will return you to the "options"
screen upon completion.)
----------------------- Using AUTOSOLV -----------------------
Although AUTOSOLV is primarily designed to be run from the
options menu of MJSolver, it may also be run from the command
line providing a way to later use any saved data files. The
syntax is the same as for MJSolver and uses the same "-pax",
"-px" and "<mjs>" parameters. Enter the name of any stored
moves file using "-nf" where "f" represents the filename. You
must provide a filename for AUTOSOLV although it will default
to MAHMOVES.DAT if the specified file cannot be found.
------------------- Registering MJSolver ---------------------
I certainly hope that you will enjoy using these programs &
that they prove to be interesting and helpful utilities! If so
the $5.00 requested registration fee would be much appreciated
and would provide encouragement to further refine and improve
this product. Please include any comments and/or suggestions
and mail to:
Ken McDonald
PO Box 654
Walled Lake, MI 48390-0654