home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ISV Strong Games
/
ISV_STRONG_GAMES.iso
/
desktop
/
shogi
/
!Help
Wrap
Text File
|
1996-06-21
|
48KB
|
888 lines
Shogi
=====
Introduction
------------
This is the application !Shogi version 0.40. It may be used to control a game of
shogi (see the next section below if necessary) and act as an aid to problem
solving, including the computer finding checkmates. It does not include a
computer play option (nor is it ever likely to - unless someone else wishes to
collaborate with the author to use this application as the front end to such a
program, in which case contact him at the address given in the final section
below). It also includes the options to save and re-load positions and game
moves. A brief summary of the game shogi follows, but this is not intended to be
exhaustive and a suitable reference is provided. Some of the application's
facilities, in particular to show legal moves, are provided for beginning
players (which includes the author).
The Game Shogi
--------------
For a full description of the game and an introduction to its strategy and
tactics the application's author recommends the book "Shogi for Beginners" by
John Fairbairn (The Ishi Press, ISBN 4-87187-201-7). The notes here are
intended as a summary only.
Shogi is a Japanese game from the chess family, and of similar antiquity to the
modern Western game of chess. Some terminology from chess is used by Western
players of Shogi but may not have an identical meaning and must be used with
care; for example, a Shogi piece named similarly to a chess piece may not have
an identical move.
The two sides in a game of Shogi are conventionally named Black (who moves
first) and White. Unlike in chess the pieces are not so coloured; ownership of
a piece is indicated by which direction the piece (which is flat) is pointing.
In conventional diagrams, and this application, Black (who moves first, unlike
in chess but like in the Japanese game Go) is shown at the bottom of the board,
White at the top. The board is of size 9 spaces by 9 spaces (rather than 8 by 8
for a chess board). The spaces on a shogi board are not normally rectangular,
but not actually square; they may however be referred to as "squares{ but this
description and the application use "spaces". A shogi board is usually wooden,
with all spaces naturally coloured; i.e. the board is not chequered like a chess
board is, and spaces have no colour. When identifying spaces on the board the
files (running up and down the board) are numbered 1 to 9, the ranks (running
from side to side) are lettered a to i, in each case from White's lower left,
i.e. the top right of the board as displayed; Black's lower left space is 9i,
for example.
Shogi pieces are identified by the symbol on them. Japanese Shogi sets use
ideograms representing the name of the piece, and these are also used in the
West; however many Western sets use symbols representing the moves of the piece
instead. The latter type of set is simpler to use initially, but familiarity
with the Japanese symbols is preferable and hence these are used by this
application (either in the form used on pieces, or the simpler form used in
diagrams, see the section on sprites below). Interactive help (available using
the !Help application) and the legal move display function (both described
below) allow the pieces and their moves to be determined without reference to
the Japanese symbols, and hence this application may be used if unfamiliar with
the Japanese symbols and then to learn them (part of the original intention of
this application). If however you prefer alternative symbols see the section
below on alternative sprite sets to determine how to supply your own.
There are eight types of Shogi pieces: king, rook, bishop, gold (general),
silver (general), knight, lance and pawn. The initial arrangement of pieces may
be best seen by running the application; each player has nine pawns, on the
third rank; a king, in the middle of the back rank; two each of gold, silver,
knight and lance - symmetrically placed on the back rank in that order from the
king to the corner; and a single rook and a single bishop; both of which start
on the second rank, on the files one in from the board edge, with the rook on
its owner's right, the bishop on its owner's left.
Unlike in chess, where only the pawn may be promoted, all shogi pieces, other
than the king and gold, may be promoted. The silver, knight, lance and pawn are
promoted to gold; the rook and bishop are promoted to new pieces, known herein
as the promoted rook and promoted bishop (the names dragon and horse are
occasionally used, but not by this application). A piece may be promoted if it
is moved into, within or out of its owner's promotion zone, which is the
furthest three ranks of the board from him, also known as the opponent's camp.
(On an actual Shogi board this zone is marked by small dots on the board, these
are currently not shown by the application, however.) A pawn or lance must be
promoted if moved to the last rank, a knight must be promoted if moved to either
of the last two ranks (in each case because otherwise the piece would be unable
to move further). A piece is turned over when promoted, showing a new symbol.
Note that although, for example, a promoted pawn is equivalent to a gold, its
symbol is not identical (and, as will be described below, has a different result
when captured). There are thus ten types of piece movement:
King One space in any direction, including diagonally (i.e. like a
chess king).
Rook Any distance along its file or a rank, without jumping any
other piece (i.e. like a chess rook).
Promoted rook As rook, or one space in any diagonal direction (i.e. like
either a chess rook or a chess king).
Bishop Any distance along a diagonal, without jumping any other piece
(i.e. like a chess bishop).
Promoted bishop As bishop, or one space in any orthogonal direction (i.e. like
either a chess bishop or a chess king).
Gold One space in any direction, other than diagonally backwards
(6 possibilities, when not on the edge of the board).
Silver One space in any diagonal direction, or directly forwards
(5 possibilities, when not on the edge of the board).
Knight Two spaces forward and one left or right, possibly jumping
piece(s) of either colour (note that only 2 of the 8 permitted
moves of a chess knight are allowed).
Lance Any distance straight forward, without jumping any other piece
(i.e. like a chess rook, but moving forwards only).
Pawn One space directly forwards, including when capturing (there is
no initial double move as by a chess pawn, nor diagonal
capture).
There is no single move corresponding to the chess castling manoeuvre (though
elaborate sequences of moves to achieve a similar effect are standard shogi
opening practice), and there clearly is no equivalent of the chess "en passant"
capture. If a piece moves onto the space of a opposing piece it captures it; a
player may not capture one of his own pieces. Unlike in chess, where captured
pieces are removed from the game permanently, a captured Shogi piece is held
"in hand" by the capturing player. At any time instead of moving a piece on the
board a player may "drop" one of his pieces in hand, unpromoted, onto any vacant
space of the board, with three exceptions: a pawn may not be dropped onto any
file where there is already an unpromoted pawn of the same colour; a knight,
lance or pawn may not be dropped where it would have to be promoted to move; a
pawn may not be dropped to give checkmate. Pieces in hand are usually kept on a
player's right, hence White's pieces in hand would be to the left of the board
as shown; however for reasons of space this application displays all pieces to
the right of the board (Black's right, but White's left).
A game is won by capturing the opponent's king. Normally, as in chess, a game
is terminated when a player is in checkmate (unable to move his king, or any
piece, without the king being captured). Normally, as in chess, a player will
resign the game before this point. Unlike in chess leaving the king in check is
not illegal - but is immediately fatal if noticed, and would be done only by a
beginner. This application may be configured to behave like chess in this regard
if preferred (see below).
Draws in Shogi are rare and difficult to recognise; most cases are not
considered by this application. The only case which is partly included is that
of a draw by impasse. This can only occur when both kings are in their enemy's
camp and both players must have 24 or more points, where points are scored for
pieces owned both on the board and in hand; a rook or a bishop scores five
points and all other pieces, other than the king, are worth one point each. In
addition neither player must be able to be checkmated. This application may be
used to check the former criteria, but not the latter. For further details, see
"Shogi for Beginners". Two players may agree a draw between themselves at any
time, and a draw by repetition of position (four times, rather than the three in
chess) is also possible (but is not considered by this application at this
time).
Shogi is also often played as a handicap game. In this case a number of White's
pieces are removed and then White starts. There are a number of standard
handicaps, which are available using this application. Note that the options
provided here are not a simple list of grade differences. At a certain grade
difference alternate games may use different handicaps; in addition some of the
provided handicaps are unofficial and are rarely used. For fuller details see
"Shogi for Beginners".
Use of the Application
----------------------
For various reasons, especially (but not exclusively) the use of solid drags,
this application requires RISC OS 3.00 (or later). It has principally been
tested using RISC OS 3.10, although it includes RISC OS 3.50 (or later) specific
code to ensure that dithering is disabled when dragging piece sprites. It is
believed that it will still function under other versions of RISC OS, but please
contact the author in the case of a problem in this, or any other, case.
To open the application's main window click select on the icon bar icon which
appears after running the application (a promoted pawn, as for the application
icon). The application may be configured to open (the default) or not open this
window automatically when run (for details see options description in the icon
bar menu section below). The size of the window depends on the board size option
and the screen mode, for further details see below.
The application has two main menus, one produced by clicking the menu button on
the icon bar icon and one produced by clicking the menu button anywhere in the
main window. There is an alternative to the latter when attempting to find or
avoid a checkmate (see below). All functions of the application may be produced
from the two main menus and by dragging and double clicking on the pieces
displayed in the main window (with the exception of the information available
from the interactive help application !Help, see below).
The application may be multiply instantiated. Each running copy has its own
icon on the icon bar and operates entirely independently, except that they all
share the same options file and if this is changed by one copy the change is
reflected in other copies which are started afterwards, or which reload the
options file.
Sprite Sets and Main Window Size
--------------------------------
The size of the main window is determined from the sprite set used. Two options
are available: large and small. The application may be configured (as described
below) to use a fixed choice, or an automatic selection appropriate to the
wimp mode when the application is started; large if this window will fit on the
screen (at least in height) or small otherwise (the latter is used regardless
of whether it fits). It is possible to replace the sprite files (in directory
Sprites) but see comments below. The default sprite sets are not simply
rescaled versions of each other. The large set has the appearance of actual
shogi pieces, whereas the small set uses diagrammatic notation (as in "Shogi for
Beginners"). The application's author recommends the former, in a suitable 16
colour mode (e.g. mode 39).
Errors, Warnings and Messages
-----------------------------
All messages from the application use standard RISC OS error windows. This is
somewhat inelegant and may be changed in a future version of the application.
Three types of messages may be distinguished: errors (e.g. an illegal move),
warnings (e.g. check, if enabled) and messages (e.g. checkmate). This is shown
in the top line of the error window. Errors indicate that the user has made a
mistake, that the application's environment is unsuitable (such as too little
available memory) or that there is a program fault. Please report any problems
to the author (see the last section below) ideally including a position or game
file if the problem can be reproduced in this way.
Application Modes
-----------------
The application may be, at any given time, in one of two modes (not to be
confused with screen modes): game play mode (the default, as at start up -
including by running a file) and edit board mode. In the former mode games may
be played out and problems of the form "checkmate in n moves" for certain values
of n may be solved by the computer. In the latter mode positions, such as
problems, may be set up for use in the game play mode (which otherwise starts
from the start of the game or from a previously saved position or game). In
either mode certain defaults may be controlled from the icon bar menu and the
pieces valid move highlight function (see below) may be used.
Game Play Mode
--------------
In this mode pieces may be moved alternately by the players. To move a piece, of
either colour, drag it with select or adjust. In the latter case the piece is
promoted if possible, in the former case it is promoted if, and only if,
compulsory. Captured pieces are collected on the off board area to the right of
the board (note that the initial window extent does not reveal all of this
area). To drop pieces drag them on to the board (use either select or adjust).
Pieces, of either player, may be dragged around the off-board area as convenient
without counting as moves. In this mode checkmates are always reported; report
of checks is optional (see below). A finished game, by checkmate or capture of a
king may not be continued (unless rewound with the undo facility, as described
below).
Edit Game Mode
--------------
In this mode pieces may be moved and promoted regardless of legality, except
that the limit of one unpromoted pawn per colour per file is maintained, as is
the prohibition of unpromoted pawns or lances on their final rank or knights on
their final two ranks. This prevents the construction of most illegal positions.
Moves which would result in such positions are prevented by promoting the piece
(knight, lance or pawn). Pieces may be promoted (by dragging with adjust)
anywhere on the board. Dragging to or within the off board area with adjust
changes the colour of a piece rather than promoting it (it remains, or becomes,
unpromoted). Note that a piece may be "dragged" on the spot (a wimp drag must be
engaged) to promote it or change its colour (as appropriate). To adjust the
colour of a piece on the board drag it off the board (with adjust) and on again
(with adjust if it is to be promoted). It will often be convenient to use the
clear board feature (see the board window menu section below) to start all
pieces off the board.
Undo/Redo Moves
---------------
In either mode moves may be undone, or redone once undone. In the game play mode
adjustments of off board pieces are not retained as actual moves,and the
undo/redo move facility incorporates such adjustments so that one actual move is
undone; however off-board positions (which are not significant) may not be the
same as at this point previously. In the edit board mode all adjustments are
kept as moves to be undone/redone. Changing mode deletes the undo and redo move
lists. The undo/redo all facility performs the undo/redo move action as many
times as possible. Either all moves may be shown, at a moderate speed, or only
the combined effect of all moves (the default, see below). There are key
shortcuts for all four undo/redo move/all actions (for details see below).
Note that making any move (by the player or using the find/avoid checkmate
feature described below) discards the previous redo move list. An exception
occurs when a game is loaded or saved, where making a move overrides the stored
game moves after this point, but these may be recovered; for further details of
this case see below.
Goto Move
---------
This option, available also via a key shortcut (for details see below), may be
used, in game play mode, only to undo/redo to a given move number. The dialogue
box used contains icons to select whether a Black or White move and a writable
icon for move number (which may be incremented or decremented with up and down
icons). The maximum move number permitted is 999. The position is moved to
before the indicated move, or the beginning or the end of the game if the move
is before or after the game respectively. When this dialogue box is first opened
the indicated move is the current move.
Report Last Move
----------------
An option exists to report the last move made, if any, in the current position
(based on the undo move list, and not available when there is no move to undo).
This is available from the board window menu (see below) but is most
conveniently accessed using a key shortcut (see below). It is particularly
useful when playing through a game, e.g. from a book.
Report Impasse Status
---------------------
As described above, one condition for a draw by impasse is that each player have
24 points (rook or bishop being 5, all others except the king 1, points in hand
being included) and that both kings are in the enemy's camp. This option (also
see key shortcuts below) may be used to report each player's number of points,
and which kings are in the enemy's camp, at any time, regardless of whether the
other criterion for a draw by impasse (both kings are unable to be checkmated)
is satisfied. In a handicap game the handicap pieces removed from White are also
reported; these are sometimes considered as part of White's score, see "Shogi
for Beginners".
Legal Move Display
------------------
Double clicking on a piece shows where it may, or might, be moved to. This
may be used on any piece, on or off the board (use in the latter case shows
legal drops) including those of the non-moving side (the position is treated as
if the owner were to be moving next). Only one piece's moves are shown, any
click (select or adjust) in the main window cancels the display. Different
colours highlight the piece and where it may be moved to. The colours may be
changed as described below, hence are not fixed, but defaults are dark or light
green (the piece, according to whether in check or not before moving), yellow
(may move to this space, but cannot promote), orange (may move to this space,
promotion is optional) and red (may move to this space, and must promote). In
addition defended pieces are also highlighted, by default in dark blue (see the
options notes in the icon bar menu section below for treatment of a "defended"
king). If the option showing a move leaving a king in check is selected (as it
is by default) then otherwise legal moves are highlighted in three independently
specifiable colours according to promotion cases (by default these are all the
same shade of grey). Note that capturing a king whilst leaving a king in check
is always a legal move, and uses the first three colours. The only piece whose
moves may not be highlighted is an off-board king (see below for this case).
Finding and Avoiding Checkmates
-------------------------------
In game play mode the application may be used to find checkmates. Typically
problems will be entered in edit mode, but may be reached by play, or from a
loaded position or game. The number of moves to checkmate is counted in shogi
manner, counting both players' moves; a shogi checkmate in 3 is equivalent to a
chess checkmate in 2. (The term ply is used in chess for the shogi count.) In
many shogi problems all moves towards checkmate are checks; this application
provides for checkmate searching to be so limited by providing, for example,
find checkmate options in 3 moves and in 3 moves with checks. The application
also provides, through the options menu described below, the option for problems
to be rejected if the solution (first move) is not unique (among those moves
considered). A choice of identical pieces to drop is still regarded as unique
however. Many shogi problems assume that the non-moving king is suitably guarded
and cannot be checked to postpone a checkmate. This is most conveniently, and
rapidly, implemented by putting such a king off-board (this can be done in edit
game mode, see the following section for further comments).
The current checkmate search method is not very efficient, and longer checkmates
can be (very) time consuming. To minimise the time required assign irrelevant
pieces to the defender, preferably off board, and, especially, use the all
checks options if possible. Note that the former of these is standard shogi
problem format. If the search is too slow then it may be aborted, without
quitting the application or changing the position, by clicking the menu button
within the main window. The single item on the menu produced allows the search
to be cancelled. Note that searching continues if the main window is closed (it
may be re-opened at any time) and the application continues to multi-task
(although it may slow some other applications - or they may slow it). Whilst
searching the Set options and Use options items on the icon bar menu are not
available (nor is the main window menu, except as noted above, or any key
shortcuts).
Using all these techniques checkmates in 3 moves, or 5 moves with checks, take
a few seconds and checkmates in 5 moves (and probably those in 7 moves with
checks but this has not been verified) take minutes. Checkmates in 7 moves, the
longest option available, may take hours, or even days. These longer options
have been included only because such time may be available, the application may
be used on a faster machine (now or in the future) and in order to provide the
interface for any future speeding up of the current method.
During checkmate finding the moves tested may be shown on the screen, if the
appropriate option is selected (see below). The moves are shown at high speed,
but even so this significantly slows down the checkmate finding. Moves shown
include not only checkmate or potential checkmate moves (including illegal pawn
drops giving checkmate) but also the following move by the player to be
checkmated, whether successful in avoiding checkmate or not. Moves which capture
a king are not shown however. The purpose of this option is principally as a
debugging aid, but has been retained as of interest.
As well as the find checkmate option an avoid checkmate option is provided. This
may be used to find how a possible problem is incorrect. To find, for example,
how to avoid a checkmate in 3 allows for a move before a search for a checkmate
in 3 moves (i.e. a search of depth 4 moves to checkmate). A search with checks
limits the checkmate finding moves to checks only. This option is a spin-off
from the checkmate search function, and uses the same options.
Off Board Kings
---------------
Since leaving a king in check is legal it may be captured. A king may also be
dragged off the board in the edit game mode. A side without a king on the board
may not be moved in the game play mode, but may attempt to find checkmate. The
other side (assuming it has a king on the board) may move as normal. This
permits problems to be set up with an irrelevant king off board and worked as
usual (including trying alternative defences in multiple move checkmates - note
that only the first move is made by the computer and the remainder of the
analysis is discarded).
Saving and Loading Positions and Games
--------------------------------------
The application may be used to save either the current position, or the game
record from the beginning of the game to the current position (ignoring any
moves available to redo). In the latter case the application must have been in
game play mode from the start of the game, without interruption (but permits use
of the application's Undo/Redo/Goto features). An already saved game may be
re-loaded, continued or otherwise modified, and re-saved; a loaded position may
not be used to start a game to be saved however. The position or game is saved
from one of two standard save dialogue boxes on the board window menu (or by key
shortcut, see below). Two of the icon bar menu options provide for the saving of
these two types of files as text, otherwise they may be saved as a file of type
Shogi (for either type of file, they may be distinguished by their contents, the
first line is adequate).
Since no filetype Shogi has been, or is likely to be, allocated a filetype from
the range available to users (000 to 0ff) may been used. Since any such
selection may clash with others a given user may use, the filetype selection has
been made automatically variable. The filetype used for Shogi files is
determined by the presence of a sprite file_xxx for some filetype xxx in the
application's !Sprites file. Renaming this sprite (and re-booting or re-running
the application) is sufficient; there is no need to edit any other file. For a
filetype in the user range the filetype should be of the form 0xx. It is also
sensible to rename the sprite of the form small_xxx also. By default this
application is supplied with sprites file_0ff and small_0ff. The appropriate
sprite (text or Shogi) is used in the save dialogue boxes. Note that whilst a
!Sprites22 file may be added it is only the !Sprites file which is used to
determine the filetype. This means that different users may use differently
numbered filetypes for Shogi files, but this is only relevant if transferring
files, and requires only that the recipient resets the types of received files
to the recipient's type Shogi.
[The author would like to suggest that this approach is a sensible one to the
limited availability of filetypes for small applications. The implementation is
straightforward, contact the author, at the address given in the final section
below, with any comments.]
Saved positions and games may be run by dragging them to the icon bar icon or
the main window or, if of type Shogi, by double clicking on them. Note that in
the latter case a new instantiation of the application is invoked, in the former
two cases the current position is overwritten if the file is valid (if it is not
then the position is preserved). The main window is opened whenever a file is
loaded. The type of file is determined from its contents.
Files can be constructed using an editor, but must match the format produced by
the application, and this may be difficult and is not recommended. (A perfect
match is not essential in practice, but only a perfect match is guaranteed to
be usable with the current version and any future versions of the application.)
To enter a game (e.g. one from a book, such as "Shogi for Beginners") it is
suggested that the application be used to play through the game and then store
the game score, possibly as text. Note that the game score is intended to be
well-formatted and readable by a player whilst the position is intended to be
readable, but not formatted for presentation. In the position file, except when
listing handicap pieces, Black pieces are shown in upper case, White in lower
case. (There is no suggestion intended that this is standard shogi practice, it
is taken, for convenience, from a common chess practice.) The game scores follow
the conventions in "Shogi for Beginners". Note that a knight is denoted 'N',
a king 'K'.
Loaded Games
------------
A loaded game may be played through using the undo/redo move features. Note that
a game may be loaded at its start or finish, according to the options selected;
the moves of the game being stored in the redo/undo move list (respectively).
As usual if a move is made the game moves in the redo list are no longer
available using the undo/redo move features. However in this case an option is
provided to restore the position to the point where the player diverted from
the game, the return to game feature (also with key shortcut, see below). This
works even if the game has been undone or redone, even before the point of
branching from the game. This option may be used to permit analysis of
alternative lines of play from the actual game before returning to the main
line. It is only available if a game has been loaded from a file, or if one is
saved to a file (in which case moves available to redo are, as noted above, not
stored in the file, but count as having branched off it).
Menus
-----
As noted above there are two principal menus available in the application.
They may be invoked by clicking the menu button either anywhere in the main
board window, or on the icon bar icon. The contents of these two menus are
described in the following two sections. Certain items on the board window menu
(only) are available using key shortcuts. These are described in the section
following the two menu sections.
Board Window Menu
-----------------
Except when attempting to find, or avoid, a checkmate (see below) this is a
hierarchical menu which controls the mode (game play or edit game) and other
aspects of the position and game. Various options will be greyed out at
different times (comments below, such as "only at the start of a game",
indicate when they are not greyed out). Considering the options in turn
(indenting sub-menu entries):
Misc
Info Leads to a display of the usual application
information window, also available by clicking
select on this item (or from the icon bar menu).
New game Start a new game in game play mode, either with no
handicap or the same handicap as the previous
game. This item itself is equivalent to the first
item on its sub-menu (no handicap).
Give handicap (Only at the start of a game.) May set a standard
handicap, removing white pieces and changing move
to white. Removed pieces can only be returned to
the game by using the new game option (or loading
a position or game file).
Report last move Report last move as a message.
Report impasse status Report number of points (king 0 points, rook and
bishop 5 points each, other pieces 1 point each)
owned by each player, including in hand (and with
handicap pieces, if any, reported separately). In
addition which kings are in the enemy's camp is
also reported. This report may be used in
assessing a draw by impasse.
Save
Save position Leads to a standard save dialogue box using which
the current position may be saved.
Save game (Only if game available from start.) Leads to a
standard save dialogue box using which the current
game may be saved (up to the current position,
ignoring any moves which may be possibly redone).
Edit
Tidy off board Tidies the off-board pieces, either all or of one
colour only. This item itself is equivalent to the
first item on its sub-menu (all pieces).
Edit board Switches between edit board mode (ticked) and game
play mode (unticked). Note that this is also
altered by selecting a new game (including by
loading a position or game file).
Clear board (Only in edit board mode.) Moves all pieces
(except kings) from the board to the off-board
area, preserving colour or making them all black
or all white. This item itself is equivalent to
the first item on its sub-menu (same colour).
Edit whose move (Only in edit board mode.) Changes whose move it
is (opposite, or to black or to white). This item
itself is equivalent to the first item on its
sub-menu (change colour).
Undo/redo
Undo move (Only if not at start of game.) Undo last move.
Redo move (Only if not at end of game.) Redo last undone
move, or loaded game move.
Undo all (Only if not at start of game.) Undo all moves,
using selected display option (see below).
Redo all (Only if not at end of game.) Redo all moves,
using selected display option (see below).
Goto move (Only if game available from start.) Leads to
dialogue box initially showing current move and
which may be used to undo/redo moves to selected
move (or beginning/end of game if would be
before game or after game).
Return to game (Only if game previously loaded or saved and then
branched off, but still available.) Return
position, and undo/redo move lists, to position in
game from which play has branched.
Checkmates
Find checkmate (Only in game play mode.) Let the computer find a
checkmate in the indicated number of moves,
possibly all checks (according to selected
sub-menu option) as described above.
Avoid checkmate (Only in game play mode.) Let the computer find a
move to avoid a checkmate in the indicated number
of moves after this one, possibly considering
check-only lines of play, as described above.
When attempting to find or avoid a checkmate the board window menu is replaced
by a single entry menu (menu title Find checkmate or Avoid checkmate as
appropriate, entry Cancel search) which if selected causes the search to be
cancelled.
Icon Bar Menu
-------------
As well as the usual RISC OS features (Info, Quit) this menu structure allows
options, including the legal move display highlight colours, to be set, saved
and reused. The Set options and Use options entries on the icon bar window are
hierarchical. The Set options menu structure, with sub-menu entries indented,
is given by the following. Except as noted an option may be on (ticked) or off;
where there are more than two options these are selected from a sub-menu (the
selected option is ticked).
Display options
Sprite size Determines the sprite, hence board, size option;
this may be large or small or an automatic
selection from the two according to the screen
mode on startup (the default). For further details
see above. Note that only the saved version of
this option has any effect, changing it during a
run is only relevant if saved, and only for
subsequent runs.
Open window at start If on then the application's main window is
opened when the application is run (other than by
running a position or game file, which always
opens the main window). The default is off. Note
that only the saved version of this option has any
effect, changing it during a run is only relevant
if saved, and only for subsequent runs.
Label board Controls the display of the board labels 1 to 9
and a to i; note that these are in the standard
shogi orientation and that when describing a
space the file number precedes the rank letter,
e.g. 1a. The default is on.
Show directions Controls the display of the direction indication
small black and white sprites, which may be both
on, both off or may show whose move it is (the
default).
Show king in check If on (the default) then when showing legal moves
(see above) show moves which leave the
corresponding king in check in three independently
specifiable colours (for the may not/may/must
promote cases) from the standard colours.
Show defended king Controls whether a king may be regarded as
"defended". Which option to use depends on how
the "defending" highlight is to be regarded:
either as highlighting pieces which are actually
defended, which excludes the king, or as
highlighting where a piece might move to if the
space were not occupied by a piece of the same
colour, including the king. The default is on
(the latter case).
Show all undo moves If on then when undoing all moves all are shown
(at a moderate speed) otherwise (the default)
only the position after undoing all moves is
shown.
Show all redo moves If on then when redoing all moves all are shown
(at a moderate speed) otherwise (the default)
only the position after redoing all moves is
shown.
Colour options The colours used to highlight legal moves (see
above) may be selected from the nine sub-menus
below this option. Note that option "None" in
each case means that the no apparent highlighting
is performed in the appropriate case.
Check options
Report checks Controls whether checks are reported by warning
messages. The default is on.
Make leave check If on makes leaving a king in check illegal, as
in chess. (Note that in shogi this is actually
legal, but immediately fatal if noticed by your
opponent as noted above.) The default is off.
Find checkmate options
Find unique checkmates If on then the find checkmates function
determines whether any checkmate found is unique
(i.e. the first move required is unique) and
rejects the problem, with a message indicating
this, if it is not. Note that uniqueness does
permit a choice of identical pieces in hand to
drop. The default is off.
Report found checkmate Determines the form of report when checkmate
found, either none, beep only or report of move
(modified by check message, if reported, or
checkmate message if appropriate). Default is
beep only.
Show search moves If on then moves tested whilst searching for
checkmate are shown on the screen. For further
details see above. The default is off.
Load and save options
Save position as text If on then positions are saved as text files,
otherwise they are given type as determined from
the application's !Sprites file, as described
above. The default is off.
Save game as text If on then positions are saved as text files,
otherwise they are given type as determined from
the application's !Sprites file, as described
above. The default is off.
Load game option Controls how a loaded game treated; it may be
loaded at its start, with any handicap already
removed (the default), played through to its
finish at a moderate speed, or loaded directly
at its finish. The game moves are available to
redo or undo as appropriate.
The Use options menu contains the following actions, which are performed if
selected.
Save Save the current options selection in a file
Options in the application, where it is found on
start up and used to set the initial option
settings (overriding the defaults indicated
above).
Reset to saved Reset the current option settings to those in the
Options file in the application (for this
instantiation of the application, if more than
one is running, only).
Reset to default Reset the current option settings to the default
settings indicated above (for this instantiation
of the application, if more than one is running,
only).
Delete saved Delete the Options file in the application. This
does not affect the current settings (for any
instantiation of the application, if more than one
is running).
Delete and reset Delete the Options file in the application and
reset the current option settings to the default
settings indicated above (for this instantiation
of the application, if more than one is running,
only).
Key Shortcuts
-------------
The following keys may be used as short cuts to items on the board window menu.
They are also noted on the appropriate menus.
F1 Report last move
⇧F1 Report impasse status
F3 Save position
⇧F3 Save game
F5 Goto move
⇧F5 Return to game
F8 Undo move
⇧F8 Redo move
^F8 Undo all
^⇧F8 Redo all
These keys are available whenever no other window has the input focus and the
mouse points to an icon of the application (in the board window or on the icon
bar). The board window itself is unable to gain the input focus. Short cuts are
not available when the appropriate menu item is greyed out, but the key press
is still intercepted in this case.
!Help
-----
The application responds to the interactive help application !Help. Pieces and
board spaces are identified. If the game has been played from the start (or
loaded from a file) and edit mode has not been used then the current player and
move number are also given. This may be useful when playing through a game
(from a file, or a book) although see also the report last move option described
above.
Alternative Sprites
-------------------
The sprites used in the application's main window are defined in the files in
directory Sprites in the application. These files may be replaced (but see
the copyright note below). This may be to replace the Japanese characters by
Western ones (but this is to be deprecated, this application provides a good
tutorial in the use of Japanese characters), to improve the sprites or to
provide different pixel size ratio sprites. Those supplied are suitable for
typical desktop modes (e.g. mode 39 for the larger size).
The form of the sprites may be seen by examination of the two files. All (except
the direction icons black and white) must be the same size and must all (except
the direction icons and sprite off_piece) have the same size borders (4 OS units
in each direction), either in black (suggested, although any colour will work)
for the backgrounds, or transparent, for the pieces. The sprite off_default
should be completely transparent. The sprites off_not and off_check must have a
mask, even though it is not used (each must use as much memory as off_default).
The sprites black and white should be of the same height, but be half the width
of the other sprites. The colours of the (by default white) background
rectangular sprites are irrelevant (they are overwritten according to the
application colour selections).
Note that the application does not check that these rules are followed, but if
they are not the appearance will be unsatisfactory and the application (which
uses sprites for position finding) may not function properly (or at all).
Alternative sprite sets must have the same names; if using the automatic
selection option then the file Large will be used before Small (there is no
check that the sprites are larger however).
Copyright
---------
This application is copyright 1994-1996 C.M. Dearlove, all rights reserved. It
may not be copied, distributed, modified etc. without his express permission.
In particular note that if supplying alternative sprites then these must be
provided outside the application, which must retain the original sprite files.
No modified options file should be included in the application. This application
was written in C using the author's own wimp library SWIlib, version 0.60, to
which the same conditions apply (if included). To contact the author use the
address:
Christopher M. Dearlove,
31 Courtlands,
Patching Hall Lane,
Chelmsford,
Essex,
CM1 4DD,
England.