1
0
mirror of https://github.com/PDP-10/its.git synced 2026-01-26 04:02:06 +00:00

MacHack VI with 340 display.

Type "FANCY<TAB>2<Return>" to get the 340 display chess board.
This commit is contained in:
Lars Brinkhoff
2018-08-10 19:59:23 +02:00
parent 92aafbb040
commit 0fecf17f15
9 changed files with 31440 additions and 3 deletions

1
doc/chess/-read-.-this- Normal file
View File

@@ -0,0 +1 @@
MacHack VI needs this directory to work.

View File

@@ -29,6 +29,11 @@ a five-letter word. To play this, type `:jotto`.
This is Richard Greenblatt's chess program. Type `:games;ocm` to play.
For instructions, see CHPROG; OCM ORDER.
There is also an older version `:games:c` which can draw the chess
board on a Type 340 display. Type
<code>FANCY<kbd>TAB</kbd>2<kbd>Enter</kbd></code> to get the fanc
chess board.
### Maze War
First multi-user first person shooter. Type `:games;maze` to play.

266
doc/ms/cheg.desc Normal file
View File

@@ -0,0 +1,266 @@
.pgn
.quote \
.nj
.ss
.psize 1000
.paperw 100
.pl 1000
.l 100
.fi
. CHEG is the CHess EndGame interpreter. The endgame program to
be interpreted is read in by the RENDG (Read ENDGame) command, which
may appear in a file to be RS'ed. The program is used only if EGSW
is positive. The format for an endgame program is as follows:
.sp 1
ENTRY a&b,c&d,e where a and c are each one of the following:
. K,N,B,R,2N,BN,2B,B2N,2BN,BR,RN,RB,2R,R2N,RBN,R2B,Q,QN,QB;
. b and d are each of the form "kP", where k is between 0 and 9; and
. e is of one of the forms "=m", "<m", ">m" where m is between -9 and 9.
. If k is 1 it may be omitted, and if b or d is 0P,
it and the preceding "&" may be omitted.
In addition, ",e" may be omitted.
.nf
tag: inst arg1,arg2,arg3
tag: inst arg1,arg2,arg3
.
.
.
ENTRY a&b,c&d,e
tag: inst arg1,arg2,arg3
.
.
.
END
.fi
.sp 1
The ENTRY pseudoinstruction says "start here if specified entry condition
is satisfied" where the entry condition specifies the types and numbers
of pieces and pawns on the board. The pieces, and the number of pawns if
specified, must match exactly with the condition of the board. The pieces
and pawns specified first are those of the side to move (hereafter called
"white"). e, if it is included, is a condition on the difference between
the number of white pawns and the number of black pawns. If more than one
ENTRY is satisfied, the first is used. If no entry condition is satisfied,
the endgame program is not used.
.break
Tags on instructions are optional, and are followed by : and the instruction
being tagged.
Instructions may take a variety of argument types. These are
.nf
1 read-only variable
2 written variable
3 variable used for both reading and writing within the same instruction
4 tag
5 condition
6 ordering operation
.fi
Variable values may be of one of the following types:
.nf
0 undefined
1 logical
2 integer
3 set (actually a vector) of variable values
4 piece
5 square
6 move
.fi
A literal of type 1, 2, or 3 may be specified by preceding the
desired value by ", e.g. "5, "(), "(1,2,(3)).
.break
A piece may be specified by a piece-valued variable, a square-valued
variable (specifying the piece on that square), or a
move-valued variable (specifying the piece being moved).
A square may be specified by a square-valued variable, a piece-valued
variable (specifying the location of that piece), or a
move-valued variable (specifying the square to which the
piece being moved is moved).
.sp 1
The following read-only variables are initially defined:
. X undefined except inside a subroutine where it is the
subroutine's argument, or during a plan where it is
the plan variable
. DEPTH current depth (in plies) of search
. LM set of legal moves
. PG set of pawn groups (a pawn group is a set of pawns separated from
all other pawns by files with no pawns on them)
. WK this and the 31 following are the pieces
on the board and are undefined otherwise
. WQ
. WR
. WR2
. WB
. WB2
. WN
. WN2
. WP
. WP2
. WP3
. .
. .
. .
. WP8
. BK
. .
. .
. .
. BP8
.sp 1
The following conditions are defined (negation of a condition is accomplished
by preceding its name by #):
. always true
. DEFD if defined
. =0 if integer = 0
. <0 if integer < 0
. >0 if integer > 0
. ODD if integer odd
. T if logical variable = T
. EMPTY if set variable = ()
. FAR if specified square is on opposite side of board from SIDE
. RF if specified square is on rook file
. NF if specified square is on knight file
. NNF if specified square is on knight file and on same side of board as SIDE
. SAFE if WP can be reached by WK before BK (simpleminded: doesn't check
if king moves are legal)
. KING if specified piece is king
. PAWN if specified piece is pawn
. QUEEN if specified piece is queen
. ROOK if specified piece is rook
. NIGHT if specified piece is knight
. BISH if specified piece is bishop
. PASSD if specified pawn is passed
. PDP if specified pawn is defended by a pawn
. WSQ if specified square is white
. WPC if specified piece is white
. CAPT if move is a capture
. OPP if move leaves WK at distant opposition to BK
. RWK= if move keeps WK on the same rank
.sp 1
The following order operations are defined (preceded by # for reverse ordering):
. no ordering specified
. DEEP move a > move b iff rank(move a) > rank(move b)
.sp 1
The following instructions are defined:
. BREAK constant,var1,var2 Print out the PC, the instruction
and the specified variables; then .VALUE. Program can
be resumed by $P.
. RETURN var Subroutine return of var.
. COND condition,tag1,tag2 If variable returned by subroutine
call to tag1 satisfies condition, go to tag2. Otherwise
continue with next instruction in sequence.
. CONDV condition,var,tag If var satisfies condition, go to tag.
Otherwise continue with next instruction in sequence.
. CONDT tag1,var,tag2 If subroutine call to tag1 with X
set to var returns T, go to tag2; if it returns F, continue
with next instruction in sequence.
. CONDF tag1,var,tag2 If subroutine call to tag1 with X
set to var returns F, go to tag1; if it returns T, continue
with next instruction in sequence.
. JUMP< var1,var2,tag If var1 < var2 go to tag. Otherwise
continue with next instruction in sequence.
. JUMP= similarly
. JUMP> similarly
. JUMP#< similarly (# means not)
. JUMP#= similarly
. JUMP#> similarly
. SET var1,tag,var2 Subroutine call to tag with var2 as argument X;
set var1 to value returned.
. SETV var1,var2 Set var1 to value of var2.
. SETSQ var1,var2,var3 Set var1 to square with rank var2 and file var3.
. SETMOV var1,var2,var3 Set var1 to move with piece specified by var2
and square specified by var3.
. EXCH var1,var2 Exchange the values of var1 and var2.
. ORDER var1,var2,order Exchange the values of var1 and var2 iff var1 > var2
according to order.
. PLAY var,cond,order Play the first move (according to order) in the
set given by var satisfying the condition cond. If there are no
such moves, continue to the next instruction.
A VALRUT or VALON should have been executed before
this instruction, and the last value thus given is
returned to the main Chess program.
. PLAYB var,cond,order Try all moves given by set var satisfying condition
cond. Moves are tried in order specified. The best move found is
played, and its value returned to the main program.
If there are no moves to try, continue to the next
instruction.
. TRY var,cond,order Try all moves given by set var satisfying condition
cond. Moves are tried in order specified. The best move found is
remembered along with its value.
. PLAN tag,var1,var2 Set plan to tag. This means that at
deeper levels of recursion with the same side to move,
the endgame program will be started at the tag instead
of using the ENTRY's to find the starting place. The
plan variable is set to the value of var2. Using the
specified plan, try all moves in the set var1.
. UNPLAN Don't use plan any more, and undefine the plan variable.
. DONE Return to main program with best move found by
TRYs and PLANs together with its value.
. RETBET var1,var2,var3 Return to main program with best move found by
TRYs and PLANs together with its value, if this value is better
for white than the value specified by var1,var2,var3.
. VALRET var1,var2,var3 Return to the main chess program the value
var1 winning chances, var2 losing chances, with certainty var3.
. VALRUT var1,var2,var3 Same as VALRET, but don't return if at top level.
. VALON var1 var2,var3 Same as VALRET, but don't ever return to chess program.
. LEAVE Return to main program for its evalulation and/or move.
. SELECT var1,tag,var2 Set var1 to the subset of var2 whose elements
give T when subroutine given by tag is called.
. SELECC var1,cond,var2 Set var1 to subset of var2 whose elements satisfy cond.
. PAIR var1,var2,var3 Set var1 to the set consisting of var2 followed by var3.
. MAP var1,tag,var2 Set var1 to the set obtained by substituting for
each element of var2 the value returned by the subroutine specified
by tag when given element as arg.
. MEMBER var1,var2,var3 Set var1 to T or F depending on whether or not var2
is an element of var3.
. MEMNUM var1,var2,var3 Set var1 to the least integer n such that var2 is the nth element of
var3, or 0 if var2 is not an element of var3.
. INTERS var1,var2,var3 Set var1 to the intersection of sets var2 and var3
where the elements are in the same order as those of var2.
. UNION var1,var2,var3 Set var1 to the union of sets var2 and var3
where the elements of var2 come first (and without reordering)
followed by the elements of var3-var2 in the order of var3.
. DIFFER var1,var2,var3 Set var1 to var2-var3 with the order
. of var2.
. APPEND var1,var2,var3 Set var1 to the set gotten by appending var3 to var2.
. PIECE var1,var2 Set var1 to piece specified by var2.
. SQUARE var1,var2 Set var1 to square specified by var2.
. SIDE var1,var2 Set var1 to side of board given by square specified by var2.
0 is kingside, 1 is queenside.
. RANK var1,var2 Set var1 to rank (with respect to white)
of square specified by var2.
. FILE var1,var2 Set var1 to file of square specified by var2.
. SCOLOR var1,var2 Set var1 to color of square specified by var2;
0 for white, 1 for black.
. PCOLOR var1,var2 Set var1 to color of piece specified by var2.
. MVDIST var1,var2,var3 Set var1 to king-move distance between squares specified
by var2 and var3.
. INSQ var1,var2,var3 Set var1 to T or F depending on whether or not
king specified by var2 is in square of pawn specified
by var3 (depends on side to move in usual way).
. OPP var1,var2 var3 Set var1 to T or F depending on whether or not
squares specified by var2 and var3 are in distant opposition.
. SQ>RNK var1,var2,const Set var1 to the square with same file as square specified
by var2, but with rank greater by const.
. CARD var1,var2 Set var1 to number of elements in var2.
. GETEL var1,var2,var3 Set var1 to the var3th element of var2. (Negative
var3 counts from right end of set.)
. SETEL var1,var2,var3 Set the var3th element of var2 to var1.
. INSERT var1,var2,var3 Insert var1 before the var3th element of var2.
. UNSERT var1,var2,var3 Remove and set var1 to the var3th element of var2.
. EXCHWE var1,var2,var3 Exchange var1 and the var3th element of var2.
. EXCHEL var1,var2,var3 Exchange the var2th and var3th elements of var1.
. NOR var1,var2,var3 Set var1 to logical nor of var2 and var3.
. OR var1,var2,var3 Set var1 to logical or of var2 and var3.
. AND var1,var2,var3 Set var1 to logical and of var2 and var3.
. ADD var1,var2,var3 Set var1 to sum of var2 and var3.
. SUB var1,var2,var3 Set var1 to difference of var2 and var3.
. MUL var1,var2,var3 Set var1 to product of var2 and var3.
. DIV var1,var2,var3 Set var1 to the quotient when var2 divided by var3.
. MOD var1,var2,var3 Set var1 to the remainder when var2 divided by var3.
. DIF var1,var2,var3 Set var1 to absolute value of difference of var2 and var3.
. MIN var1,var2,var3 Set var1 to minimum of var2 and var3.
. MAX var1,var2,var3 Set var1 to maximum of var2 and var3.
. ABS var1,var2 Set var1 to absolute value of var2.
.end


336
doc/ms/chess.memo Normal file
View File

@@ -0,0 +1,336 @@
ALG=0 INPUT
ALLT DEBUG
AWKS=-1 TOURN
BCS=1 PARAM
BD OUTPUT
BOOK=1 PARAM
CASSW=0 PARAM
CBOOK INPUT
CLEAR INPUT
CLKKLU=-1 TIME
CSQSW=1 ?
DBDIS=1 DISPLAY
DFDSW=0 PARAM
DRAW MOVE
EGSW=1 PARAM
FANCY=-2 DISPLAY
FASTER PARAM
FCSW=1 PARAM
FILE OUTPUT
HASH=1 PARAM
HBPT DEBUG
HOPEN DEBUG
HPV OUTPUT
HRCSW=1 INTERN
HREAD DEBUG
HSSW=1 DEBUG
ICLOCK=0 TIME
ICSW=-2 DEBUG
KINGSA=1 PARAM
LIST OUTPUT
M MOVE
MVAN=1 ?
MVNSW=1 ?
PARCSW=1 ?
PARSW=0 TOURN
PB CONTROL
PCGSW=2 PARAM
PG OUTPUT
PMGDB=0 DEBUG
PMSASW=1 PARAM
PN CONTROL
PNT=0 OUTPUT
PS CONTROL
PSVD=0 DISPLAY
PUT INPUT
PW CONTROL
RBOOK INPUT
RBOOKB INPUT
RENDG INPUT
REPLAY DEBUG
RESET INPUT
RHDSK DEBUG
RPOS INPUT
RS INPUT
SASW=0 PARAM
SAVE OUTPUT
SDS=0 DEBUG
SE=1 TOURN
SETC=2 PARAM
SETCL TIME
SETD=4 PARAM
SETEST DEBUG
SETF=2 PARAM
SETFD=2 PARAM
SETP=6 6 3 3 2 PARAM
SETPVD=6 PARAM
SETSD=2 PARAM
SETSSD=0 PARAM
SETW=6 PARAM
SFS=1 PARAM
SIDE INPUT
SKIP INPUT
SLASW=0 PARAM
SLOWER PARAM
SLS=0 DEBUG
SMSS=1 PARAM
SMVD=0 DEBUG
SPARM TOURN-PARAM
SPOT INPUT
SPVS=0 DEBUG
SQCTSW PARAM
SSSW=1 PARAM
STOP TIME
STOPIN ?
SVHDSK DEBUG
T DEBUG
TP DEBUG
TPC DEBUG
TPDV DEBUG
TRACE DEBUG
TSW=1 OUTPUT
TTIME TIME
TWOGTS=0 TOURN-CONTROL
U MOVE
UREAD INPUT
UWRITE OUTPUT
WALLP=-1 OUTPUT
WBOOKB OUTPUT
WHDSK DEBUG
WPOS OUTPUT
?
CSQSW=1
MVAN=1
MVNSW=1
PARCSW=1
STOPIN
CONTROL
 Quit. Returns control to the top level and does a PN.
 Same as M, but needs no delimiter.
 Same as U, but needs no delimiter.
M This instruction tells the program to make a move.
U This instruction takes back the last move. It includes a
PN (play neither) to prevent the program from trying to make a move
it just took back. Therefore, after using this instruction it is
necessary to feed in another PW or PB if you wish the program to continue playing.
PW Play white. The program makes moves for white, awaits input when black is to move.
PB Play black. The program makes moves for black, awaits input when white is to move.
PS Play self. The program moves for both sides.
PN Play neither. The program awaits input.
TWOGTS=0 If 1, think while other guy thinks.
While in this mode, commands must be preceded by a colon.
Before a move has been typed in,
a rubout will cause all buffered commands to be aborted so that
a move can immediately be typed in. If the move is terminated by
"DRAW?" instead of a carriage return, the program will eventually
type its move followed by "ACCEPT" or "DECLINE". If the move
is terminated by ":", the program will eventually wait for a command
before continuing to TWOGT.
After a move is typed in (the input format for normal moves is
piece/square-square or piece/square*piece/square,
but anything redundant may be omitted), the move will be typed
back in full format followed by a question mark. If it is correct,
type a period to have it inputted. Any other character will cause
the program to request a move again. Illegal moves will be so
commented. Ambiguous moves will cause the program
to make its best guess of what you meant, and will type
this move in full format together
with the warning "AMBIGUOUS". Special moves:
O-O or O O for king-side castling;
O-O-O or O O O for queen-side castling;
PxP EP or PxG etc. for en passant capture;
P-K8=Q etc. for promotion.
DEBUG
ALLT Trace all plausible moves.
HBPT Hash BreakPoinT. Set a breakpoint which breaks
if current position is reached in search.
HOPEN Takes file specification as argument. Opens file for
HREAD Searches forward in HOPEN'ed file for hash table
relevant to current position and reads it in.
HSSW=1 Hash Save SWitch.
-1 Open file CHASHT > for writing and save hash table in it after each move
0 Don't save hash table
1 Save hash table in core after each move
ICSW=-2 Incremental Cat (calculate attack) SWitch.
-2 Spot check
-1 Always check
0 Don't use IC
1 Use IC
PMGDB=0 When positive, displays pins, threats and constraints
after move typed in.
REPLAY Takes file specification as argument. Types "PLAY WHITE?" Answer
"Y" or "N". Then asks "PLAY BLACK?" Again answer
"Y" or "N". If not playing side to move, program reads a move
from the file. If playing side to move, program makes a move to
compare with move from file, but uses move from file. Normally
this feature is used with WALLP=-1.
RHDSK Takes file specification as argument. Read hash table from
specified file, saving it in core.
SDS=0 Set Display Switch.
SLS=0 Set look switch.
0,0 Normal mode of operation
1,0 Gives PMG display for current position when given a
make move command (no move is made)
1,1 Does a normal search but makes display and pauses at each node.
Type a space to continue to the next node
or type an integer to continue to the next node at that ply
2,0 Does a normal search and displays feedover conditions.
Type a space to continue
SETEST Takes numeric argument. Set estimate of value of position.
SMVD=0 When positive, gives analysis of principal variations
stemming from each playsible move.
SPVS=0 When positive, prints static evaluator and development values
after move typed in.
SVHDSK Takes file specification as argument. Save hash table
as the specified file.
T Trace. With no argument, traces static board evaluator
evaluation of current position. With a move for argument,
traces PMG evaluation of that move.
TP Trace Positional.
TPC Types plausible captures and their values.
TPDV Types development values.
TRACE Same as "T".
WHDSK Takes file specification as argument. Write hash table
which is stored in core as the specified file.
DISPLAY
DBDIS=1
FANCY=-2 -2 No display
-1 Whose move
0 Board position in characters
1 Board
2 Board with game so far
 Does FANCY -2, but at interrupt level.
 Turns off display until input is requested by program.
(Done at interrupt level.)
PSVD=0 When positive, displays principal variation and its value after
program makes a move.
INPUT
ALG=0 1 Set preferred input to algebraic notation. Output is also algebraic.
-1 Output is in both notations.
CBOOK Continue reading book after an error in an RBOOK.
CLEAR Removes all pieces from board.
PUT piece square Puts specified piece
(same format as is outputted by BD) on specified square
(same format as is outputted in a move by the
program, but always with respect to white).
RBOOK Read book of openings. (See description of book format.)
RBOOKB Takes file specification as argument. Reads a file
outputted by the WBOOKB command.
RENDG Read endgame program. (See CHEG description.)
RESET Restore initial position. Does a PN. RESET n restores to move n,
e.g. RESET 5 backs up the game to the point at which
white is about to make his 6th move.
RPOS Takes next eight lines
to be a board as outputted by the BD command, and sets up the
specified position.
RS Takes file specification as argument. Reads in commands from file.
(Note that moves are commands,
so this command can be used to restore SAVE'd games.)
SIDE=W Side to move.
SKIP Takes numeric argument. Skips to the next occurrence of "["
followed by its argument in the file being read.
SPOT Give handicap, e.g. SPOT QVBR removes white's
queen and black's queen bishop and queen
rook, also moving black's queen rook pawn to R3. In
general, "P", "N", "B", "R", and "Q" removes the KBP, the QN, the QB, the QR, and
the Q respectively for the appropiate side (the side is initially white,
and is switched by "V"); in addition, removal of the QR moves
the QRP to R3.
UREAD Takes file specification as argument. Select auxiliary device input.
 Initiates readin from auxiliary device.
INTERN
HRCSW=1
OUTPUT
 Turns on teletype output. (Done at interrupt level.)
 Turns off teletype output. (Done at interrupt level.)
ALG=0 See under input.
DRAW Asks if machine wants a draw.
BD Prints out the board.
PG Prints out the game.
FILE Closes output file.
HPV Prints out principal variation from current position
as gotten from hash table.
LIST List program commands and parameters with their current values.
PNT=0 1 Output to printer
0 Output to TTY
-1 Output to secondary output device
SAVE Takes file specification as argument. Writes file
consisting of the moves made, similar to the output of a PG command.
TSW=1 Type lines after typing out move.
UWRITE Takes file specification as argument. Opens auxiliary
output file.
WALLP=-1 1 Send debugging information (wallpaper) to printer
0 Don't output wallpaper
-1 Send wallpaper to file WALLP >
WBOOKB Takes file specification as argument. Writes binary
file specifying the book of openings. This file can be read in by
the RBOOKB command.
WPOS Takes file specification as argument. Writes file consisting of
"RPOS", followed by output of BD, followed by "SIDE W"
or "SIDE B" depending on whether white or black is to move.
PARAM
BCS=1 If positive, use board control option in static evaluator.
BOOK=1 If positive, use opening book.
CASSW=0
DFDSW=0 Delayed FeeDover SWitch.
EGSW=1 End Game SWitch. If positive, use endgame program.
FASTER Go to next lower (faster) parameter set.
FCSW=1 Forward Cutoff SWitch. If positive, use forward cutoff heurisitic.
HASH=1 -1 Don't use hash feature
0 Use hash for draw detection only
1 Use hash for detecting duplication of search. Obtain
value from table instead of continuing search.
KINGSA=1 KING SAfety. If positive, use king safety term in static board evaluator.
PCGSW=2 Additional depth (after SETD) for PMG in PCG mode.
PMSASW=1 Poor Man's Surprise Analysis SWitch. (# of ply)
SASW=0 Surpurise Analysis SWitch.
SETC=2 Set plies to look at all captures.
SETD=2 Basic search depth for PMG.
SETF=2 Maximum number of ply to look for feedovers.
SETFD=2 Maximum number of extra ply for feedovers
(only those due to possibility of value being worse for
side to move are allowed).
SETP=6 6 3 3 2 Maximum number of positional (only) moves to look at
at each ply. [See SETW.] [Not implemented.]
SETPVD=6 Using new PCG, sets depth to look at good moves.
SETSD=2 Set Secondary Search Depth.
SETSSD=0 Set Secondary Search Starting Depth.
SETW=6 Basic search width. Takes a list of numbers separated by spaces,
applying to plies 1,2,3,...; the last number applies to all higher plies.
SFS=1 Set Feedover Stop. If positive,
stop feedover in case a feedover is obviously not called for (i.e.
in resulting position one side has lost a piece and is not
threatening anything of equal value).
SLASW=0 Set Line Analysis SWitch.
SLOWER Go to next higher (slower) parameter set.
SMSS=1 Set Multiple Search Switch.
SQCTSW
SSSW=1 Search Strategy SWitch.
TIME
CLKKLU=-1 -1 Run time according to side to move
0 Don't run time.
1 Run time according to clock kludge
ICLOCK=0 1 inverts sense of clock kludge.
SETCL "B" or "W" followed by time to set clock.
STOP Stop clock.
TTIME Type out times used by white and black.
TOURN
AWKS=-1 When non-negative, send all TTY output to T!AWKS (e.g. T27 if AWKS=23)
as well as to TTY.
PARSW=0 When positive, machine sets parameters.
SPARM Takes numeric argument between 0 and 6.
Stores current parameters as specified parameter set
SE=1 Sets an echo to cut off local people
if tournament console being used.


View File

@@ -162,7 +162,7 @@
- NUDIR, create user directory.
- NWATCH, small watch display.
- OBS, observe system activities.
- OCM, Richard Greenblatt's Mac Hack VI chess program.
- OCM/C, Richard Greenblatt's Mac Hack VI chess program.
- OCTPUS, print character representations.
- OS, realtime TTY spy.
- OTHELLO, the original Othello game -- simpler than Go.