gnushogi-1.5pre/0000755000175000017500000000000012364540720010715 500000000000000gnushogi-1.5pre/INSTALL0000644000175000017500000003661012363550544011700 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command `./configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. gnushogi-1.5pre/README0000644000175000017500000000270012364540470011516 00000000000000GNU Shogi, release 1.5pre ------------------------- This is an unreleased pre-1.5 snapshot of GNU shogi, a program which plays shogi (Japanese chess), as well as xshogi, the graphical interface to GNU shogi. GNU shogi and xshogi were originally written by Matthias Mutz , have been maintained by Mike Vanier in the 1.3.x era, by Luis Felipe Strano Moraes until 1.4.0, and are now maintained by Yann Dirson . GNU shogi was in turn based on GNU Chess 4.0, i.e. the first version of GNU Shogi was obtained by "simply" modifying the chess-specific parts of GNU Chess 4.0. We would like to thank the authors of GNU Chess 4.0 for making the sources of that program available. See the file NEWS for the new features of this release. For the installation procedure read the file "INSTALL". For more information on shogi please look at the files in the doc directory or read the info file. The project is maintained at https://savannah.gnu.org/projects/gnushogi/ where you will find pointers to the bug tracker, mailing lists, git repository for the source code, etc. The prefered way to contribute patches is through "git send-email" to the gnushogi-devel mailing-list. You may also wish to publish them in a public repository; the repo.or.cz Free-Software-based platform allows you to do that easily, as a fork of http://repo.or.cz/w/gnushogi.git. Yann Dirson gnushogi-1.5pre/CONTRIB0000644000175000017500000000016712364540030011656 00000000000000Contributions from users ------------------------ Sep 12, 1994 Hiroshi Tsuda: some openings added to gnushogi.tbk gnushogi-1.5pre/misc/0000755000175000017500000000000012364540720011650 500000000000000gnushogi-1.5pre/misc/gnuminishogi.pat0000644000175000017500000000033612363540324014777 00000000000000# This is a dummy file for lack of documentation. The single entry is # just here to keep the code happy, it is even not guaranted to be # smart,or even to be in a section with the right name. ATTACK_U_U [0] b1d gnushogi-1.5pre/misc/gnushogi.pat0000644000175000017500000001323412363540324014123 00000000000000CASTLE_S_S # Fortress [0] 5 p7f p8g b8h s6h g6i | P8d P3c [1] 6 p8g p7f s8h b7g | P8e P3d [2] 8 p8g p7f s7g p6g p5g g7h k6h g5h [3] 5 b8h p8g p7f s7g g7h k6i [4] 5 k5i g6i g6g s7h b8h p8g p7f p6f [5] 8 k6i b7i g7h s7g p8g p7f [6] 7 k6i s8h g7h g5h p8g b7g p7f p6f p5f [7] 8 k6i g7h b6h g5h p8g s7g p7f p6f p5f [8] 9 10 k7i g7h p8g p7f s7g p6f p5f g6g [9] 11 k8h g7h p9f p8g p7f p6f s7g g6g | P9d [10] k7i g8h p9g p8g s7g g6g p7f p6f | P9e [11] l9i n8i k8h g7h s7g p8g p9f p7f [12] 13 b7g | S7b [13] 6 b7g s8h g7h | S8d # without pawns [14] 2 s7g g7h k6h g5h [15] 8 k7i g7h g6g [16] 7 k6i g7h b6h g5h s7g [17] 11 l9i n8i k8h g7h s7g [18] 6 k6i s8h g7h g5h p8g b7g ATTACK_S_S [0] 1 2 p5g p4g p3g p2f p1g r2h s3i [1] 3 p5g p4g p3g p2f s4h r2h n2i [2] 4 s3h p4g p3g p2f r2h [3] 5 6 7 s4h p4g p3f p2f p1g r2h n2i [4] 12 14 15 17 p3f p2e s2f p1f r2h n2i l1i [5] 12 n2i r2h s3g p3f p2e p1e | P1d [6] 9 11 l1i r2h s4g n3g p4f p3f p2f p1e | P1c [7] 8 s4h p5f p4g n3g p3f p2f r2h l1g [8] s4h p5f p4g n3g p3f p2f r1h l1g [9] 10 s4g p4f n3g n3f r2h l1g p1e [10] s4g p4f n3g n3f r1h l1g p1e [11] s5f p5g p4f p3f n3g r2h p2e p1f l1i [12] 13 n2i s3g p3f p2e l1g r2h [13] n2i s3g p3f p2e l1g r1h [14] 16 n2i l1i r2h p2e p3f s3e [15] 16 n2i l1i r2h p2e p3e s2f [16] s3e p2d r2h [17] s1e p2d r2h CASTLE_S_R [0] 1 2 g6i g5h k5i b8h p7f s7i n8i l9i [1] 3 p9f l9i n8i b8h k7h g6i g5h p8g p7f p6g p5f [2] 4 l9i n8i s7i g6i g5h k6h b8h p8g p6g p7f [3] 7 8 l9i n8i g6i b8h k7h s6h g5h p9f p8g p7f p6g p5f [4] 5 l9i n8i s7i g6i g5h k7h b8h p8g p6g p7f p5g [5] 6 l9h k8h n8i s7i g6i b7g p9g p8g p7f [6] k9i l9h s8h g7h g7i p8g b7g p7f p6g [7] l9i n8i k8h g7h p9f p8g b7g g6g p7f p6f [8] 9 l9i n8i b8h k7h g6i g5h s7g p7e p6g s5g p5f | P7c [9] l9i n8i k8h g7h b7g g6g s5g s7f p6f p5f p8e p7e # without pawns [10] 1 l9i n8i b8h k7h g6i g5h [11] 3 l9i n8i g6i b8h k7h s6h g5h [12] 2 l9i n8i s7i g6i g5h k6h b8h ATTACK_S_R [0] 1 2 6 r2h p2e [1] 2 3 5 6 13 s4h r2h n2i l1i p5f p3f [2] 13 l1i s4h r2h n3g p4f p3f # Center-file Vanguard Pawn [3] 4 l1i n2i r2h s6h p3g p4g s5g p5e | P5c P4d [4] l1i n2i r2h s6h p3g p4g s5f p5e | P5c # King's Head Vanguard Pawn [5] l1i b8h s7g s5g p7e | P7c # rushing silver [6] 7 p2e p1f r2h s3h [2] 8 10 p2e p3f p1f s2f r2h [8] 9 p3e p2e p1f s2f r2h [9] s3e p2e p1f r2h [10] p2e s1e p1f r2h # edge attack [11] 12 l1g r2h [12] l1g r1h p1d # slow [13] 11 s4g n3g r2h l1i p4f p3f CASTLE_R_S # going into Mino or Bear-in-the-Hole [0] 1 g6i g4i s3i n2i l1i k4h p4g p3g p2g p1g [1] 2 4 g6i g4i s3i n2i l1i k2h p4g p3g p2g p1g # Bear-in-the-Hole [2] 3 g4i s3i n2i k1i g5h l1h p4g p3g p2g p1g [3] 12 g3i n2i k1i g3h s2h l1h p4g p3g p2g p1g # Incomplete Mino [4] 5 8 g4i n2i l1i s3h k2h p3g p2g p1f # Complete Mino [5] 6 9 g4i n2i l1i g5h s3h k2h p4g p3g p2g p1f # High Mino [6] 7 10 g4i n2i l1i s3h k2h g4g p2g p4f p3f p1f # Silver Crown [7] 11 n2i l1i g3h k2h g4g s2g p4f p3f p2f p1f # Incomplete Mino without pawns [8] 5 g4i n2i l1i s3h k2h p3g p2g p1f # Complete Mino without pawns [9] 6 g4i n2i l1i g5h s3h k2h p4g p3g p2g p1f # High Mino without pawns [10] 7 g4i n2i l1i s3h k2h g4g # Silver Crown without pawns [11] n2i l1i g3h k2h g4g s2g # Bear-in-the-Hole without pawns [12] g3i n2i k1i g3h s2h l1h CASTLE_R_R [0] 1 l1i s3i g4i g6i k3h p2g p3g p4g [1] 2 l1i g4i s2h k3h g5h p2g p3g p4g [2] s2h k3h g4h g5h p2g p3g p4g # without pawns [3] 0 l1i s3i g4i g6i k3h [4] 1 l1i g4i s2h k3h g5h [5] 2 s2h k3h g4h g5h CASTLE_S_U [0] p1g p2e p3g p4g p5g p6g p7f p8g p9g n8i s7i g6i k5i g4i s3i n2i [1] p8g p7f p6g g6i g5h p5f ATTACK_S_U [0] 1 2 p2f r2h [1] 3 p2f s4h [2] 6 p2f s3h [3] 4 5 p2f s4h p3f [4] p2f p4f p3f s4g n3g [5] p2e p3f s3g p1e [6] 7 p2e s2g p3g [7] p2e s2f p1f p3f CASTLE_R_U [0] 4 r5h k5i g4i s3i [1] 4 r6h k5i g4i s3i [2] 4 r7h k5i g4i s3i [3] 4 r8h k5i g4i s3i [4] k3h g4i s3i ATTACK_R_U [0] 1 2 3 4 p7f p6f b7g [1] r8h p7f p6f b7g s6g [2] r7h p7f p6f b7g [3] r6h p7f p6f b7g s6g [4] r5h p7f p6f b7g s6g CASTLE_U_U [0] 1 p3g p4g p6g p7f n8i s7i g6i k5i g4i s3i n2i [1] 2 3 p3g p4g p6f p7f b8h s7i g6i k5i g4i s3i [2] 4 p6f p7f s7h b8h [3] 4 p6f p7f s6h b8h [4] p6f p7f s6h b8h p1e ATTACK_U_U [0] p7f ATTACK_R_* # going into Ranging Rook [0] 1 5 8 10 b7g p7f p6f k5i g4i s3i p2g # 2nd file Ranging Rook [1] 2 r8h b7g p7f p6f k5i g4i s3i [2] 3 4 r8h n8i g6i b7g s6g p7f p6f [3] r8h n8i g7h b7g s6g p7f p6f [4] r8h n8i g5h b7g s6g p7f p6f # 3rd file Ranging Rook [5] 6 7 r7h b7g p7f p6f k5i g4i s3i [6] r7h s6g g5h p8g b7g p7f p6f [7] r7h s6g p8g b7g p7f p6f p5f # 4th file Ranging Rook [8] 9 r6h b7g s6g p7f p6f k5i g4i s3i [9] r6h n8i g6i p8g b7g s6g p7f p6f # 5th file Ranging Rook [10] 11 13 r5h p8g b7g s6g k5i g4i s3i [11] 12 r5h n8i g7h p8g b7g s6g p7f p6f [12] r5i n8i p8g b7g s6g s4g p7f p6f [13] r5h n8i p8g b7g s6g g4g p7f p6f CASTLE_U_* [0] 1 p3g p4g p6g p7f n8i s7i g6i k5i g4i s3i n2i [1] 2 3 p3g p4g p6f p7f b8h s7i g6i k5i g4i s3i [2] 4 p6f p7f s7h b8h [3] 4 p6f p7f s6h b8h [4] p6f p7f s6h b8h p1e gnushogi-1.5pre/misc/gnushogi.tbk0000644000175000017500000050254312363540324014125 00000000000000# BASIC LINES # # --------------------------- # Static Rook vs. Static Rook # --------------------------- # P7f P8d S6h P3d S7g S6b P2f S4b S4h G3b G7h P5d P5f K4a K6i G5b G5h S3c P3f P4d B7i B3a P6f P7d # P7f P8d P2f P8e B7g P3d S8h G3b G7h S4b B2b+ G2b S7g S7b S3h S8c P2e S3c P3f S8d S3g S9e B*5f B*7b # P7f P8d S6h P3d S7g S6b P2f S4b S4h G3b G7h P5d P5f K4a K6i G5b G5h S3c B7i B3a P6f P4d P1f P1d # P7f P3d P2f G3b P2e B8h+ S8h S2b S7g K4b S4h S3c G7h S6b K6h P9d P9f P6d P4f S6c S4g S5d S5f K3a # P7f P8d P2f P8e P2e G3b B7g P3d S8h B7g+ S7g S2b S3h S6b G7h S3c S2g P7d S2f S7c S1e B*5d G5h S6d # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P1d P1f P3d R3f G3c K4h P6d B9g S6c P7f K4a # P7f P8d S7h P8e S7g P3d P2f S4b P2e S3c G7h G3b K6i S6b G5h K4a P5f P5d B7i G5b S3h P4d S2g 5b4c # P7f P8d S7h P8e S7g P3d P2f S4b P2e S3c G7h G3b K6i S6b G5h K4a P5f P5d B7i G5b S3h P4d S2g 5b4c # P7f P8d P5f P8e B7g P5d R5h S6b S6h P3d K4h K4b K3h K3b P1f P1d K2h 6a5b S3h P9d P9f 2b7g+ S7g S4b # P7f P8d S6h P3d P6f S6b S6g P5d P9f 6a5b R5h K4b K4h K3b K3h P1d P1f P9d K2h S4b S3h P8e B7g S3c # P7f P3d P2f P4d P2e B3c S4h S3b P5f P5d 4i5h 6a5b S7h G4c B7i K4b P2d P2d B2d B2d R2d P*2c R2h K3a # P7f P3d P2f P5d P5f S6b S4h P8d P2e G3b G7h P8e P2d P2d R2d P*2c R2h P8f P8f R8f P*8g R8b K6i K4a # P7f P8d S6h P3d S7g S6b P2f S4b S4h G3b G7h P5d P5f K4a K6i G5b P3f P7d G5h S3c B7i B3a P6f P4d # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2h P8f P8f R8f P*8g R8d S3h S6b S2g P3d S3f B3c P7f S2b # P2f P8d P2e P8e G7h G3b S4h S6b P2d P2d R2d P*2c R2f P3d P7f P8f P8f R8f P*8g R8d P4f P6d S4g S6c # P7f P3d P2f P8d P2e P8e G7h G3b P2d P2d R2d P8f P8f R8f R3d B8h+ S8h P*2h S2h B*4e R2d P*2c B*7g R8h+ # P7f P8d S7h P3d S7g S6b S4h S4b P2f S3c G7h G3b G5h G5b P5f P5d P3f P7d B7i B3a K6i K4a P6f P4d # P7f P8d S7h P3d S7g S6b S4h S4b P2f S3c G7h G3b G5h G5b P5f P5d P3f P7d B7i B3a K6i K4a P6f P4d # # ---------------------------- # Static Rook vs. Ranging Rook # ---------------------------- # # Static vs. 2nd-file # P7f P3d P2f P4d P2e B3c S4h S3b P5f P5d 4i5h S4c K6h R2b K7h K6b P3f K7b P9f P9d S6h K8b P4f S7b # P2f P3d P7f P4d P2e B3c S4h R2b K6h S4b K7h K6b 4i5h K7b P5f K8b P3f S7b S6h S4c 6h5g G3b P4f P2d # # Static vs. 3rd-file # P7f P3d P2f P4d S4h R3b P2e B3c K6h S4b K7h K6b 4i5h K7b P5f 4a5b P3f K8b P9f P9d P1f P1d P4f S7b # P7f P3d P2f P4d S4h R3b K6h P3e K7h K6b P4f 4a5b P2e R3d S4g K7b S6h K8b P9f S7b G3h P1d G2g S4b # P7f P3d P9f P4d P2f R3b P2e B3c S4h S4b K6h K6b K7h K7b P5f K8b P3f P5d 4i5h 4a5b P1f P1d S6h S4c # # Static vs. 4th-file # P7f P3d S4h P4d P4f S4b S4g S4c P3f R4b R4h B3c P1f P1d P2f K6b K6h K7b K7h S6b 4i5h P5d P5f S5c # P7f P3d S4h P4d P4f S4b S4g S4c P3f R4b R4h B3c P1f P1d P2f K6b K6h K7b K7h S6b 4i5h P5d P5f S5c # P7f P3d P2f P4d P5f S3b S4h R4b K6h K6b 4i5h K7b K7h K8b S6h S7b P9f P9d 4h5g S4c P7e 4a5b S7g P5d # P7f P3d P2f P4d P5f S3b S4h R4b K6h K6b 4i5h K7b K7h K8b S6h S7b P9f P9d P3f 4a5b 6h5g S4c P2e B3c # P7f P3d P2f P4d P5f S3b S4h R4b K6h K6b 4i5h K7b K7h K8b S6h S7b P9f P9d P3f 4a5b 6h5g S4c P2e B3c # # Static vs. 5th-file # P7f P8d S6h P3d P6f S6b S6g P5d P9f 6a5b R5h K4b K4h K3b K3h P1d P1f P9d K2h S4b S3h P8e B7g S3c # P7f P8d P5f P5d S6h P3d P6f S6b R5h K4b K4h K3b K3h 6a5b S6g P1d P1f S4b K2h P7d B7g P8e G7h 4b5c # # ---------------------------- # Ranging Rook vs. Static Rook # ---------------------------- # # 3rd-file vs. Static # P7f P3d P6f P8d R7h P8e B7g S6b S6h P5d K4h K4b K3h K3b K2h P1d P1f P9d P9f 6a5b S3h P7d 6i5h S4b # # 5th-file vs. Static # P7f P8d P5f P8e B7g P5d S6h P3d P6f S6b R5h K4b K4h K3b K3h 6a5b K2h P1d P1f S5c S3h B3c P4f P4d # P7f P3d P2f P4d S4h S4b P5f R5b K6h K6b K7h K7b 4i5h K8b P9f P9d P6f S4c G6g S5d S5g S7b B7g P6d # # ----------------------------- # Ranging Rook vs. Ranging Rook # ----------------------------- # P7f P3d P6f P3e S7h R3b S6g K6b B7g K7b R8h P1d P1f 4a5b P8f P2d P8e R3d S2h P2e K4h S4b 6i5h S8b # # ADDITIONAL LINES # # Source: SHOGI May 1984 Issue No. 49 # # p.2 1.P-7f P-3d 2.P-6f P-8d 3.S-7h S-6b 4.P-5f P-5d 5.P-2f S-4b 6.S-4h G-3b 7.S-7g K-4a 8.G-7h G-5b 9.K-6i S-3c 10.G-5h P-7d 11.P-3f B-3a 12.B-7i P-4d 13.P-2e G5b-4c 14.B-4f B-6d 15.S-3g K-3a 16.K-7i K-2b 17.B-5g P-8e 18.K-8h P-9d 19.G5h-6g S-7c 20.P-1f S-8d # p.4 Double Fortress 1.P-7f P-3d 2.P-6f S-6b 3.S-7h P-6d 4.P-2f S-3b 5.P-2e S-3c 6.S-6g S-6c 7.S-4h P-8d 8.P-5f P-8e 9.B-7g B-3a 10.G-7h P-5d 11.S-5g G-3b 12.K-6i K-4a 13.G-5h G-5b 14.K-7i P-4d 15.P-3f B-4b 16.B-5i P-7d 17.K-8h N-7c 18.P-1f P-1d 19.P-9f P-9d 20.R-3h G5b-4c # p.13 Game 1 1.P-7f P-8d 2.S-6h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.G-7h P-5d 6.P-5f G6a-5b 7.K-6i P-4d 8.G-5h G-4c 9.P-3f S-3c 10.B-7i B-3a 11.P-6f K-4b 12.P-3e Px3e 13.Bx3e P-4e 14.S-3g S-4d 15.B-6h K-3b 16.P-2f B-6d 17.R-3h N-3c 18.P-6e B-5c 19.P-1f G4a-4b 20.P-1e P*3e # p.13 Game 2 1.P-7f P-8d 2.S-6h P-3d 3.S-7g S-6b 4.P-2f S-4b 5.S-4h G-3b 6.G-7h K-4a 7.P-5f P-5d 8.K-6i G-5b 9.P-3f P-7d 10.G-5h S-3c 11.B-7i B-3a 12.P-6f P-4d 13.P-1f G5b-4c 14.P-1e B-6d 15.N-3g K-3a 16.B-4f S-7c 17.K-7i P-8e 18.K-8h K-2b 19.S-5g Bx4f 20.Px4f S-6d # p.13 Game 3 1.P-7f P-8d 2.S-6h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.G-7h G-3b 6.K-6i P-5d 7.P-5f K-4a 8.G-5h G-5b 9.P-6f S6b-5c 10.P-2f P-5e 11.Px5e Bx5e 12.P-2e S-5d 13.P-2d Px2d 14.Rx2d P*2c 15.R-2h P-6d 16.S-5g B-2b 17.G5h-6g S-5c 18.S-4f S-4d 19.P-7e G-6c 20.S-7f P-8e # p.13 Game 4 1.P-7f P-8d 2.S-6h P-3d 3.S-7g S-6b 4.P-2f S-4b 5.S-4h G-3b 6.G-7h K-4a 7.P-5f P-5d 8.K-6i G-5b 9.P-3f P-7d 10.G-5h S-3c 11.B-7i B-3a 12.P-6f P-4d 13.P-1f G5b-4c 14.P-1e P-9d 15.G5h-6g P-9e 16.B-6h S-7c 17.K-7i S-6d 18.P-2e N-7c 19.P-4f R-7b 20.S-8f N-8e # p.13 Game 5 1.P-7f P-8d 2.S-6h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.G-7h G-3b 6.K-6i P-5d 7.P-5f K-4a 8.G-5h G-5b 9.P-3f S-3c 10.P-6f B-3a 11.B-7i P-4d 12.P-1f P-7d 13.P-1e B-6d 14.S-3g P-8e 15.G5h-6g B-7c 16.L-1g S-5c 17.R-1h G-2b 18.B-6h R-6b 19.K-7i P-6d 20.K-8h B-8d # p.13 Game 6 1.P-7f P-8d 2.S-6h P-3d 3.S-7g S-6b 4.P-2f S-4b 5.S-4h G-3b 6.G-7h K-4a 7.P-5f P-5d 8.K-6i G-5b 9.P-3f S-3c 10.G-5h B-3a 11.B-7i P-7d 12.P-6f P-4d 13.G5h-6g G5b-4c 14.B-6h P-8e 15.K-7i B-6d 16.N-3g K-3a 17.K-8h K-2b 18.R-3h P-9d 19.P-1f P-1d 20.S-5g B-7c # p.14 Double Ranging Rook 1.P-7f P-3d 2.P-6f P-3e 3.S-7h R-3b 4.S-6g K-6b 5.B-7g K-7b 6.R-8h P-3f 7.Px3f Rx3f 8.P*3g R-3d 9.G-4h G-6b 10.K-4i S-3b 11.K-3h P-1d 12.P-1f P-2d 13.P-9f P-9d 14.G6i-5h G4a-5b 15.P-8f P-2e 16.P-8e S-2c 17.P-6e N-3c 18.B-6f S-8b 19.N-7g S-2d 20.S-5f S-3e # # Source: SHOGI November 1986 Issue No. 64 # # p.4 1.P-7f P-3d 2.P-2f P-4d 3.P-2e B-3c 4.S-4h S-3b 5.P-5f P-5d 6.P-3f R-4b 7.K-6h K-6b 8.K-7h K-7b 9.G4i-5h S-6b 10.P-9f P-9d 11.N-3g P-4e 12.S-5g S-5c 13.P-1f P-1d 14.R-2f G-6b 15.P-2d Px2d 16.P-3e Bx8h+ 17.Sx8h S-4d 18.Rx2d P*2c 19.R-2f Sx3e 20.R-2i B*3h # p.9 1.P-7f P-8d 2.S-6h P-3d 3.S-7g S-6b 4.P-2f S-4b 5.S-4h G-3b 6.G-7h K-4a 7.K-6i P-5d 8.P-5f G-5b 9.G-5h S-3c 10.P-6f P-4d 11.B-7i B-3a 12.P-3f P-7d 13.G5h-6g G5b-4c 14.S-3g P-8e 15.P-2e B-6d 16.B-4f S-7c 17.K-7i K-3a 18.K-8h K-2b 19.P-1f P-9d 20.P-9f P-1d # p.16 1.P-7f P-3d 2.P-2f P-4d 3.S-4h S-3b 4.P-5f R-4b 5.K-6h K-6b 6.K-7h S-7b 7.S-5g G4a-5b 8.B-7g K-7a 9.K-8h S-4c 10.L-9h S-5d 11.P-6f K-8b 12.K-9i P-6d 13.S-8h P-7d 14.G-7i G-6c 15.G-5h N-7c 16.P-2e B-3c 17.P-3f P-4e 18.G5h-6h P-9d 19.G6h-7h P-9e 20.B-5i P-8d # p.17 Game 4 1.P-7f P-8d 2.S-6h P-3d 3.S-7g S-6b 4.P-2f S-4b 5.S-4h G-3b 6.G-7h K-4a 7.K-6i P-5d 8.P-5f G-5b 9.P-3f P-4d 10.G-5h G5b-4c 11.P-6f S-3c 12.B-7i B-3a 13.G5h-6g P-7d 14.S-3g B-6d 15.B-6h K-3a 16.K-7i K-2b 17.K-8h P-8e 18.P-1f S-7c 19.S-4f P-7e 20.Px7e P-4e # p.17 Game 1 1.P-7f P-8d 2.S-6h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-5f P-5d 6.G-7h G6a-5b 7.K-6i P-4d 8.P-3f G-4c 9.G-5h S-3c 10.P-6f B-3a 11.B-7i P-8e 12.S-3g G-3b 13.P-3e Px3e 14.Bx3e B-6d 15.P-6e B-4b 16.G5h-6g S-5c 17.K-7i K-4a 18.K-8h P-6d 19.Px6d Sx6d 20.S-3f P-5e # p.17 Game 2 1.P-2f P-8d 2.P-2e P-8e 3.G-7h G-3b 4.P-2d Px2d 5.Rx2d P*2c 6.R-2f S-6b 7.P-9f P-1d 8.S-3h P-6d 9.P-7f P-3d 10.P-7e S-6c 11.K-4h K-4a 12.K-3i P-4d 13.S-6h S-4b 14.R-7f K-3a 15.P-6f B-3c 16.S-6g G-7b 17.B-9g K-2b 18.N-7g P-4e 19.K-2h R-8d 20.S-5h P-9d # p.17. Game 3 1.P-2f P-8d 2.P-2e P-8e 3.G-7h G-3b 4.P-2d Px2d 5.Rx2d P*2c 6.R-2f S-6b 7.P-1f P-3d 8.S-3h P-6d 9.P-7f P-8f 10.Px8f Rx8f 11.P*8g R-8b 12.P-1e S-6c 13.P-3f S-5d 14.N-3g G-5b 15.P*2d Px2d 16.Rx2d P*2c 17.Rx3d Bx8h+ 18.Sx8h G-3c 19.R-3e B*2d 20.P*2b Sx2b # # Source: SHOGI, March 1987, Issue No.66, p.17 # # p.4 # Static v. Fourth P7f P3d P2f P4d P2e B3c S4h S3b P5f P5d 4i5h R4b K6h K6b K7h K7b P3f S6b P9f P9d P5e P5e B5e S4c # p.4 P7f P8d S6h P3d S7g S6b P2f S4b S4h G3b G7h K4a P5f P5d K6i G5b P3f P4d G5h S3c B7i B3a P6f P7d # p.7 (game 1) P7f P3d P2f P4d S4h S4b K6h S6b 4i5h P7d P6f G3b K7h R7b G6g P7e P7e R7e P*7f R7a P5f K4a S6h P6d # p.7 (game 2) P7f P8d R7h P8e B7g P3d P6f S6b S6h K4b K4h K3b K3h 6a5b K2h P5d L1h B3c P5f K2b S5g S5c P3f L1b # p.7 (game 3) P7f P3d P2f P4d S4h R3b P2e B3c K6h S4b K7h K6b P5f K7b P3f K8b 4i5h P5d P4f 4a5b N3g R2b S6h S7b # p.7 (game 4) P2f P8d P2e P8e G7h G3b P2d P2d R2d P1d R2f P3d P9f N3c S6h P*2e R5f S4b P3f S6b P7f G2c P7e K4a # p.7 (game 5) P7f P3d P2f P4d S4h S4b K6h P5d K7h R5b P5f K6b 4i5h K7b P3f K8b P2e B3c P4f G3b S5g L9b R3h G4c # p.7 (game 6) P7f P8d P5f P8e B7g P5d R8h P3d S6h S6b P6f P6d K4h K4b K3h K3b K2h 6a5b L1h S5c K1i B3c S5g P4d S2h K2b # p.17 (game 1) P7f P8d S6h P3d S7g S6b P2f S4b S4h P5d P5f G3b G7h K4a K6i G5b G5h S3c B7i B3a P6f P4d P3f P7d 5h6g 5b4c B6h P9d K7i P9e S3g S5c P2e B4b K8h B5a S2f B7c B4f P6d # p.17 (game 2) P7f P8d S6h P3d S7g S6b P2f S4b S4h G3b P5f K4a G7h P5d K6i G5b P3f S3c G5h B3a B7i P4d P6f P7d # p.17 (game 3) P7f P8d S6h P3d S7g S6b P2f S4b S4h G3b G7h P5d K6i K4a P5f P7d G5h G5b P3f S3c B7i B3a P6f P4d # p.17 (game 4) P7f P8d S6h P3d S7g S6b P2f S4b S4h G3b G7h K4a K6i P5d P5f G5b G5h S3c P3f P4d P6f B3a B7i P7d # p.17 (game 5) P2f P3d P7f P4d P2e B3c S4h S4b P5f S4c G4i5h R2b P4f K6b P3f K7b K6h P4e 8h3c+ N3c B*8h G3b S5g R2a # p.17 (game 6) P7f P8d P5f P8e B7g P5d R5h K4b S6h P3d K4h S6b P5e P5e R5e K3b R5i S4b G7h P6d K3h P4d S5g S4c # # Source: SHOGI May 1987 Issue No. 67 # # p.4 1.P-7f P-3d 2.P-2f P-4d 3.P-2e B-3c 4.S-4h S-3b 5.P-5f P-5d 6.G4i-5h P-8d 7.S-7h P-8e 8.B-7g G6a-5b 9.B-6h K-4b 10.S-7g G-4c 11.P-2d Px2d 12.Bx2d P*2c 13.Bx3c+ Kx3c 14.K-6h K-2b 15.P-6f S-6b 16.G-6g S-5c 17.S-5g P-7d 18.K-7h P-4e 19.P-4f Px4f 20.Sx4f P*4d # p.15 1.P-7f P-8d 2.S-6h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-5f P-5d 6.G4i-5h G-3b 7.G-7h K-4a 8.K-6i G-5b 9.B-7i P-4d 10.P-3f G5b-4c 11.S-3g S-3c 12.P-6f B-3a 13.G5h-6g S-5c 14.B-6h B-4b 15.K-7i K-3a 16.K-8h P-7d 17.P-3e Px3e 18.Bx3e P-4e 19.R-4h S5c-4d 20.B-6h S-3d # p.16 Game 2 1.P-2f P-8d 2.P-2e P-8e 3.G-7h G-3b 4.P-2d Px2d 5.Rx2d P*2c 6.R-2f S-6b 7.P-1f P-1d 8.S-3h P-6d 9.P-7f P-8f 10.Px8f Rx8f 11.P*8g R-8b 12.P-3f P-3d 13.N-3g G-5b 14.P*2d Px2d 15.Rx2d K-4b 16.Rx3d G-2c 17.Rx6d Bx8h+ 18.Sx8h B*2h 19.P*2d G-1c 20.B*4e P*6c # p.16 Game 3 1.P-7f P-8d 2.S-6h P-3d 3.B-7g P-8e 4.S-4h S-6b 5.P-4f P-5d 6.S-4g S-5c 7.S-5f G-3b 8.G-7h P-7d 9.P-2f K-4a 10.P-2e P-7e 11.Px7e S-6d 12.S-4e P-5e 13.Sx3d P-5f 14.Px5f Bx7g+ 15.Sx7g B*5g 16.P-2d Px2d 17.B*6f Bx6f+ 18.Sx6f B*4g 19.Rx2d P*2b 20.B*2e Bx2e+ # p.16 Game 4 1.P-7f P-8d 2.S-6h P-3d 3.S-7g S-6b 4.S-4h P-5d 5.P-5f G6a-5b 6.G-7h S-3b 7.K-6i P-4d 8.G-5h G-4c 9.P-6f P-7d 10.B-7i B-3a 11.P-3f P-8e 12.G5h-6g B-6d 13.S-3g B-7c 14.B-6h K-4b 15.K-7i K-3a 16.K-8h S-5c 17.P-1f P-6d 18.R-3h R-6b 19.P-1e P-6e 20.Px6e Rx6e # p.16 Game 5 1.P-7f P-8d 2.S-6h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-5f P-5d 6.G4i-5h G-3b 7.P-6f K-4a 8.G-6g G-5b 9.B-7i P-4d 10.P-3f G5b-4c 11.K-6h S-3c 12.K-7h B-3a 13.S-3g S-5c 14.K-8h B-4b 15.G-7h K-3a 16.P-2f P-7d 17.P-2e K-2b 18.P-1f B-5a 19.P-1e B-7c 20.L-1g P-8e # p.16 Game 6 1.P-2f P-8d 2.P-2e P-8e 3.G-7h G-3b 4.P-2d Px2d 5.Rx2d P*2c 6.R-2f S-6b 7.P-1f P-1d 8.S-3h P-6d 9.P-7f P-3d 10.R-3f G-3c 11.B-7g P-4d 12.P-4f P-5d 13.S-6h S-5c 14.S-4g S-3b 15.R-2f S-4c 16.K-6i G-3b 17.G-5h G-5b 18.P-3f K-6b 19.P-5f G-6c 20.N-3g N-3c # p.17 Game 3 1.P-2f P-3d 2.P-7f P-4d 3.P-2e B-3c 4.S-4h S-4b 5.P-5f S-4c 6.G4i-5h P-3e 7.K-6h R-4b 8.K-7h K-6b 9.S-5g K-7b 10.S7i-6h K-8b 11.P-9f S-7b 12.P-9e G4a-5b 13.P-5e P-4e 14.S-5f S-4d 15.S-5g P-6d 16.R-4h P-5d 17.Px5d G-6c 18.P-4f Gx5d 19.Px4e Sx4e 20.Sx4e Gx4e # p.17 Game 1 1.P-7f P-8d 2.S-6h P-3d 3.S-7g S-6b 4.P-2f S-4b 5.S-4h G-3b 6.G-7h K-4a 7.K-6i P-5d 8.P-5f G-5b 9.G-5h P-7d 10.P-6f S-3c 11.B-7i B-3a 12.P-3f P-4d 13.B-4f N-7c 14.G5h-6g G5b-4c 15.P-2e B-4b 16.K-7i K-3a 17.K-8h R-7b 18.S-3g S-5c 19.S-2f P-4e 20.B-6h S5c-4d # p.17 Game 2 1.P-7f P-8d 2.P-2f P-8e 3.B-7g P-3d 4.S-8h G-3b 5.G-7h Bx7g+ 6.Sx7g S-4b 7.S-3h S-3c 8.P-3f S-7b 9.P-4f P-6d 10.S-4g S-6c 11.G-5h G-5b 12.K-6h K-4b 13.K-7i K-3a 14.S-5f P-7d 15.N-3g N-7c 16.P-6f G5b-4b 17.P-2e R-8a 18.K-8h R-6a 19.P-1f P-1d 20.P-9f P-9d # p.17 Game 3 1.P-7f P-8d 2.S-6h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.G-7h G-3b 6.K-6i K-4a 7.P-5f P-5d 8.G-5h G-5b 9.P-6f P-4d 10.B-7i S-3c 11.P-3f B-3a 12.S-3g G5b-4c 13.G5h-6g P-8e 14.P-3e Px3e 15.Bx3e P-4e 16.B-6h S-5c 17.K-7i S5c-4d 18.K-8h B-6d 19.P*3f P-7d 20.R-4h K-3a # p.17 Game 4 1.P-7f P-8d 2.P-2f P-8e 3.B-7g P-3d 4.S-8h G-3b 5.G-7h Bx7g+ 6.Sx7g S-4b 7.S-3h S-3c 8.P-3f S-7b 9.P-4f P-6d 10.S-4g S-6c 11.G-5h G-5b 12.K-6h K-4b 13.K-7i P-7d 14.S-5f S-5d 15.N-3g K-3a 16.P-6f P-9d 17.P-9f P-1d 18.P-1f K-2b 19.K-8h N-7c 20.P-4e R-6b # # Source: SHOGI July 1987 Issue No.68 # # p.2 Game 5 P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b S3h P6d P1f S6c P4f P3d S4g P1d S5f S5d P7f P8f P8f R8f P*8g R8b G4h G5b P3f P4d P9f P9d P3e 5b4c P3d G3d R3f P*3e # p.2 Game 6 P7f P8d S6h P3d S7g S6b S4h S4b P5f P5d G7h G3b K6i K4a G5h P7d P6f P8e 5h6g G5b B7i P6d P3f 4b5c B4f N7c S5g R8a K7i G6c P3e P3e B3e P6e R3h P6f 5g6f P*6e S5g G4b # p.16 Game 1 P7f P8d S6h P3d S7g S6b S4h S4b P5f P5d 4i5h G3b P6f K4a G6g G5b P3f P4d B7i S3c K6h B3a K7h 5b4c K8h B4b G7h K3a S3g S5c P2f K2b P2e P7d P1f B5a P1e B7c L1g P8e # p.16 Game 2 P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P1f P1d S3h P3d P7f P8f P8f R8f P*8g R8b P4f P6d S4g S6c S5f S5d G4h G5b S4e B8h+ S8h S4e P4e N3c N7g K4b P7e P2d # p.16 Game 3 P7f P8d S6h P3d S7g S6b S4h S4b P5f P5d 4i5h G3b P6f K4a G6g G5b P3f P4d B7i 5b4c K6h S3c K7h B3a S3g S5c K8h B4b G7h K3a P2f K2b P2e P7d P1f B5a P1e B7c L1g P8e # p.16 Game 4 P7f P8d S6h P3d S7g S6b S4h P5d P5f S4b G7h 6a5b K6i G3b G5h K4a P6f P7d P3f P5e S5g 6b5c P2f S5d P4f P5f S5f P6d P2e G6c 7h6g N7c K7h S5c P2d P2d R2d P*2c R2e S4d # p.16 Game 5 P2f P3d P7f P4d P2e B3c S4h S4b K6h S4c K7h R5b P4f K6b S6h K7b P5f K8b 4i5h S7b P3f S5d 4h5g R4b N3g 4a5b P5e S6e P7e P5d P6f S7f P5d G4c P7d S8e P9f G5d B9g P6d # # Source: SHOGI Sept.1987 Issue No.69 # # p.2 Game 1 P7f P8d S6h P3d S7g S6b S4h P5d P5f G3b G7h K4a K6i G5b G5h B3c P2f S2b P2e B5a P3f S5c P4f P7d N3g P4d S6f P8e P5e P8f P8f R8f P*8g R8d P4e P4e S6e P7e P2d P2d # p.2 Game 2 P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b S3h P3d P1f P1d P7f P8f P8f R8f P*8g R8d P4f P6d S4g S6c S5f K4b K6h G5b G4h S5d P3f P9d P9f P7d N3g P6e G4g G6b # p.2 Game 3 P7f P8d S6h P3d S7g S6b S4h S4b G7h G3b K6i K4a P5f P5d G5h G5b P6f S3c B7i B3a P3f P4d S3g 5b4c 5h6g P8e B6h P7d K7i S7c B4f B4b K8h K3a P1f K2b P2f P9d P2e P7e # p.4 Bishop exchange P7f P3d P2f P4d P2e B3c S4h S3b P5f P5d 4i5h 6a5b S7h G4c B7i K4b S7g K3a P2d P2d B2d B2d R2d P*2c R2h K2b K6h P8d K7h P9d P9f P7d P6f S6b G6g S7c S5g P8e 6i6h S8d # p.14 P7f P3d P2f P4d S4h S4b P5f P5d K6h R5b K7h K6b 4i5h K7b P9f K8b S5g L9b B7g K9a K8h S8b S7h S5c P6f P4e P2e B3c G6g S4d P8f P6d P8e G7a S8g P5e P5e R4b P5d G5b # p.16 P7f P8d S7h P3d P6f S6b R6h P5d K4h K4b K3h K3b 6i5h 6a5b K2h P7d S3h S4b P4f P8e B7g 4b5c P5f P1d P1f # p.17 50th Kisey Title Match - Game 1 - 16th June 1987 P7f P3d P2f P4d S4h S4b P5f S4c G4i5h R4b K6h K6b K7h S7b P9f P9d S5g P6d S7i6h K7a P5e G4a5b S5f P3e P2e B3c P6f R3b P6e Px6e Sx6e B4b R2f #rd S6g N3c B7i P4e P7e P*6d # p.17 50th Kisey Title Match - Game 2 - 30th June 1987 P7f P8d S6h P3d P6f S6b R5h K4b K4h K3b K3h G6a5b S6g P5d K2h S4b S3h P7d P4f P6d P5f P8e B7g P6e P5e Px5e Px6e P8f Px8f N7c G7h G6c S6f G5d G6g Nx6e B5i S6c N7g S6d # p.17 50th Kisey Title Match - Game 3 - 7th July 1987 P2f P3d P7f P4d S4h S3b P5f R4b K6h K6b K7h K7b G4i5h K8b S6h S4c P3f S7b S6h5g P6d P2e B3c P3e G3b Px3d Sx3d R3h G4c P1f P*3e B5e P6e G6i6h R3b P4f P9d S4g P9e P*3f P5d # p.17 9th Ladies' Osho Title Match - Game 1 - 11th March 1987 P7f P3d P2f P4d S4h S3b P5f S4c G4i5h P3e P2e B3c K6h R3b P1f K6b K7h S7b P9f K7a S5g G4a5b P8f K8b K8g P5d S7h B4b R2f P1d S4f P8d B7g P9d K8h S8c P6f G7b G6g G5b6b # p.17 9th Ladies' Osho Title Match - Game 2 - P7f P8d P5f P5d R5h S6b P5e Px5e Bx5e K4b B7g K3b S6h P3d P6f G6a5b S6g S5c K4h P8e K3h P1d K2h P1e S3h S3a4b S5f P4d P6e S4c P4f P*5d P3f G4a4b N3g N3c R6h B1c S3h4g P3e # p.17 28th Oi Title Match - Game 1 - 16th & 17th July 1987 P2f P8d P2e P8e G7h G3b P2d Px2d Rx2d P*2c R2f S7b P1f P1d S3h P3d P7f P8f Px8f Rx8f P*2d Px2d Rx2d Rx7f Bx2b+ Sx2b B*7g B*1c R2h P7d P4f N3c S4g N7c G5h R7e B6f R6e N7g R6d # # # Source: Shogi World Vol. 1 No. 1 # # p.11 # Third v. Static P7f P3d P6f P8d R7h P8e B7g S6b S6h P5d K4h K4b K3h K3b K2h P1d P1f P9d P9f 6a5b S3h P7d 6i5h S4b # p.13 # Central v. Static P7f P8d P5f P8e B7g P5d S6h P3d P6f S6b R5h K4b K4h K3b K3h 6a5b K2h P1d P1f S5c S3h B3c P4f P4d # # Source: Shogi World Vol. 1 No. 2 # # p.7 # Static v. Static P7f P8d S6h P3d S7g S6b P2f S4b S4h G3b G7h P5d P5f K4a K6i G5b G5h S3c P3f P4d B7i B3a P6f P7d # p.12 # Static v. Static P7f P8d P2f P8e B7g P3d S8h G3b G7h S4b B2b+ G2b S7g S7b S3h S8c P2e S3c P3f S8d S3g S9e B*5f B*7b # # Source: Shogi for beginners # # p.32 # Static v. Centre-file P7f P8d S6h P3d P6f S6b S6g P5d P9f 6a5b R5h K4b K4h K3b K3h P1d P1f P9d K2h S4b S3h P8e B7g S3c # p.74 # Static v. Third-file P7f P3d P2f P4d S4h R3b P2e B3c K6h S4b K7h K6b 4i5h K7b P5f 4a5b P3f K8b P9f P9d P1f P1d P4f S7b N3g R2b P5e S4c # p.81 # Static v. Static P7f P8d S6h P3d S7g S6b P2f S4b S4h G3b G7h P5d P5f K4a K6i G5b G5h S3c B7i B3a P6f P4d P1f P1d P3f P7d P2e P8e S3g B6d # p.146 # Static v. Fourth-file P7f P3d S4h P4d P4f S4b S4g S4c P3f R4b R4h B3c P1f P1d P2f K6b K6h K7b K7h S6b 4i5h P5d P5f S5c # p.147 # Centre Game, Bishops off P7f P3d P2f G3b P2e B8h+ S8h S2b S7g K4b S4h S3c G7h S6b K6h P9d P9f P6d P4f S6c S4g S5d S5f K3a # p.149 # Right-side King P7f P3d P2f P4d S4h S3b P5f S4c S6h P5d P3f B3c 6h5g R2b P4f K6b S4g K7b N3g S6b P8f R3b K4h B4b # p.150 # Static v. Opposing P7f P3d P2f P4d P2e B3c S4h S3b P5f P5d 4i5h S4c K6h R2b K7h K6b P3f K7b P9f P9d S6h K8b P4f S7b # p.150 # Static v. Third-File P7f P3d P2f P4d S4h R3b K6h P3e K7h K6b P4f 4a5b P2e R3d S4g K7b S6h K8b P9f S7b G3h P1d G2g S4b # p.151 # Static v. Opposing P2f P3d P7f P4d P2e B3c S4h R2b K6h S4b K7h K6b 4i5h K7b P5f K8b P3f S7b S6h S4c 6h5g G3b P4f P2d # p.152 # Static v. Third-file P7f P3d P9f P4d P2f R3b P2e B3c S4h S4b K6h K6b K7h K7b P5f K8b P3f P5d 4i5h 4a5b P1f P1d S6h S4c # p.152 # Double Ranging P7f P3d P6f P3e S7h R3b S6g K6b B7g K7b R8h P1d P1f 4a5b P8f P2d P8e R3d S2h P2e K4h S4b 6i5h S8b # p.153 P7f P3d P2f P4d S4h S4b P5f R5b K6h K6b K7h K7b 4i5h K8b P9f P9d P6f S4c G6g S5d S5g S7b B7g P6d # p.154 # Bishop Exchange P7f P8d P2f P8e P2e G3b B7g P3d S8h B7g+ S7g S2b S3h S6b G7h S3c S2g P7d S2f S7c S1e B*5d G5h S6d # p.155 # Rook-On-Pawn P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P1d P1f P3d R3f G3c K4h P6d B9g S6c P7f K4a # # Source: How to play shogi # # p.12 P7f P8d S7h P8e S7g P3d P2f S4b P2e S3c G7h G3b K6i S6b G5h K4a P5f P5d B7i G5b S3h P4d S2g 5b4c S2f P1d P1f P7d P1e P1e S1e L1e L1e P*1c P*1b S7c R1h S6d 1b1a+ B1a # p.13 P7f P8d P5f P8e B7g P5d R5h S6b S6h P3d K4h K4b K3h K3b P1f P1d K2h 6a5b S3h P9d P9f 2b7g+ S7g S4b P5e P5e R5e 6b5c R5i P*5d G7h P7d S6f P8f P8f R8f N7g R8b P*8e P6d # p.14 P7f P8d S6h P3d P6f S6b S6g P5d P9f 6a5b R5h K4b K4h K3b K3h P1d P1f P9d K2h S4b S3h P8e B7g S3c P4f P3e S4g S3d P5f S5c R8h P4d G3h P4e P4e S4e P*4f S3d G5h P6d # p.22 # Stativ v. Fourth-file P7f P3d S4h P4d P4f S4b S4g S4c P3f R4b R4h B3c P1f P1d P2f K6b K6h K7b K7h S6b 4i5h P5d P5f S5c # p.22 # Static v. Static P7f P3d P2f P4d P2e B3c S4h S3b P5f P5d 4i5h 6a5b S7h G4c B7i K4b P2d P2d B2d B2d R2d P*2c R2h K3a # p.23 # Centre Game P7f P3d P2f P5d P5f S6b S4h P8d P2e G3b G7h P8e P2d P2d R2d P*2c R2h P8f P8f R8f P*8g R8b K6i K4a # p.23 # Double Fortress P7f P8d S6h P3d S7g S6b P2f S4b S4h G3b G7h P5d P5f K4a K6i G5b P3f P7d G5h S3c B7i B3a P6f P4d # p.23 # Central v. Static P7f P8d P5f P5d S6h P3d P6f S6b R5h K4b K4h K3b K3h 6a5b S6g P1d P1f S4b K2h P7d B7g P8e G7h 4b5c # # Source: Guide to Shogi Openings # # Primitive Climbing Silver 1 1.P-2f P-8d 2.P-2e P-8e 3.P-2d? Px2d 4.Rx2d P-8f 5.P*2c? Px8g+ # Primitive Climbing Silver 2 1.P-2f P-8d 2.P-2e P-8e 3.P-2d? Px2d 4.Rx2d P-8f 5.Px8f P*8g 6.P*2c Px8h+ 7.Sx8h B*3e 8.R-2h Bx5g+ 9.Px2b+ Rx2b 10.Rx2b+? # Primitive Climbing Silver 3 1.P-2f P-8d 2.P-2e P-8e 3.P-2d? Px2d 4.Rx2d P-8f 5.Px8f P*8g 6.P*2c Px8h+ 7.Sx8h B*3e 8.R-2h Bx5g+ 9.Px2b+ Rx2b 10.P*2c R-1b 11.B*2b? G-3b? 12.Bx3a+ Gx3a 13.S*2b # Primitive Climbing Silver 4 1.P-2f P-8d 2.P-2e P-8e 3.P-2d? Px2d 4.Rx2d P-8f 5.Px8f P*8g 6.P*2c Px8h+ 7.Sx8h B*3e 8.R-2h Bx5g+ 9.Px2b+ Rx2b 10.P*2c R-1b 11.B*2b? P*2d 12.B-1a+ Rx1a 13.L*2g B*4e 14.Lx2d P*2g # Primitive Climbing Silver 5 1.P-2f P-8d 2.P-2e P-8e 3.P-2d? Px2d 4.Rx2d P-8f 5.Px8f P*8g 6.P*2c Px8h+ 7.Sx8h B*3e 8.R-2e Bx5g+ 9.R-5e +Bx6g 10.Rx5c+ P*5b # Primitive Climbing Silver 6 1.P-2f P-8d 2.P-2e P-8e 3.G-7h G-3b 4.P-2d Px2d 5.Rx2d P*2c 6.R-2h P-8f 7.Px8f Rx8f 8.P*8g R-8d 9.S-3h S-6b 10.S-2g G-5b? 11.S-3f K-4a 12.S-3e P-3d 13.P*2d Px2d 14.Sx2d B-4d 15.P-7f # Primitive Climbing Silver 7 1.P-2f P-8d 2.P-2e P-8e 3.G-7h G-3b 4.P-2d Px2d 5.Rx2d P*2c 6.R-2h P-8f 7.Px8f Rx8f 8.P*8g R-8d 9.S-3h S-6b 10.S-2g P-3d 11.S-3f B-3c 12.S-2e? P-3e # Primitive Climbing Silver 8 1.P-2f P-8d 2.P-2e P-8e 3.G-7h G-3b 4.P-2d Px2d 5.Rx2d P*2c 6.R-2h P-8f 7.Px8f Rx8f 8.P*8g R-8d 9.S-3h S-6b 10.S-2g P-3d 11.S-3f B-3c 12.P-7f S-2b 13.Bx3c+ Sx3c? 14.S-8h P-6d 15.S-2e # Primitive Climbing Silver 9 1.P-2f P-8d 2.P-2e P-8e 3.G-7h G-3b 4.P-2d Px2d 5.Rx2d P*2c 6.R-2h P-8f 7.Px8f Rx8f 8.P*8g R-8d 9.S-3h S-6b 10.S-2g P-3d 11.S-3f B-3c 12.P-7f S-2b 13.Bx3c+ Nx3c 14.S-8h G-5b 15.P-4f # # Wing Attack, Reclining Silver 1 1.P-2f P-8d 2.P-2e P-8e 3.G-7h G-3b 4.S-4h S-6b 5.P-2d Px2d 6.Rx2d P*2c 7.R-2f P-3d 8.P-7f P-8f 9.Px8f Rx8f 10.P*8g R-8d 11.P-4f P-6d 12.S-4g S-6c 13.S-5f S-7d? 14.S-4e S-6e # Wing Attack, Reclining Silver 2 1.P-2f P-8d 2.P-2e P-8e 3.G-7h G-3b 4.S-4h S-6b 5.P-2d Px2d 6.Rx2d P*2c 7.R-2f P-3d 8.P-7f P-8f 9.Px8f Rx8f 10.P*8g R-8d 11.P-4f P-6d 12.S-4g S-6c 13.S-5f S-5d 14.K-6i? S-6e 15.Sx6e Bx8h+ 16.Sx8h B*4g # Wing Attack, Reclining Silver 3 1.P-2f P-8d 2.P-2e P-8e 3.G-7h G-3b 4.S-4h S-6b 5.P-2d Px2d 6.Rx2d P*2c 7.R-2f P-3d 8.P-7f P-8f 9.Px8f Rx8f 10.P*8g R-8d 11.P-4f P-6d 12.S-4g S-6c 13.S-5f S-5d 14.K-6h P-7d? 15.Bx2b+ Sx2b 16.B*9e P*8c 17.R-2h # Wing Attack, Reclining Silver 4 1.P-2f P-8d 2.P-2e P-8e 3.G-7h G-3b 4.S-4h S-6b 5.P-2d Px2d 6.Rx2d P*2c 7.R-2f P-3d 8.P-7f P-8f 9.Px8f Rx8f 10.P*8g R-8d 11.P-4f P-6d 12.S-4g S-6c 13.S-5f S-5d 14.K-6h K-4b 15.P-1f P-1d 16.P-9f P-9d 17.G-4h G-5b 18.P-3f P-7d 19.N-3g # Wing Attack, Reclining Silver 5 1.P-2f P-8d 2.P-2e P-8e 3.G-7h G-3b 4.S-4h S-6b 5.P-2d Px2d 6.Rx2d P*2c 7.R-2f P-3d 8.P-7f P-8f 9.Px8f Rx8f 10.P*8g R-8d 11.P-4f P-6d 12.S-4g S-6c 13.S-5f S-5d 14.K-6h K-4b 15.P-1f P-1d 16.P-9f P-9d 17.G-4h G-5b 18.P*2d Px2d 19.Rx2d P*2c 20.Rx3d? Bx8h+ 21.Sx8h P*3c 22.R-3f B*2h # Wing Attack, Reclining Silver 6 1.P-2f P-8d 2.P-2e P-8e 3.G-7h G-3b 4.S-4h S-6b 5.P-2d Px2d 6.Rx2d P*2c 7.R-2f P-3d 8.P-7f P-8f 9.Px8f Rx8f 10.P*8g R-8d 11.P-4f P-6d 12.S-4g S-6c 13.S-5f S-5d 14.K-6h K-4b 15.P-1f P-1d 16.P-9f P-9d 17.G-5h G-5b 18.P*2d Px2d 19.Rx2d P*2c 20.Rx3d R-8e 21.R-3f R-2e 22.P*2f R-8e # # Side Pawn, B*4e Variation 1 1.P-7f P-3d 2.P-2f P-8d 3.P-2e P-8e 4.G-7h G-3b 5.P-2d Px2d 6.Rx2d P-8f 7.Px8f Rx8f 8.Rx3d Bx8h+ 9.Sx8h B*4e? 10.R-2d Bx6g+ 11.Gx6g Rx8h+ 12.Rx2a+ +Rx9i 13.+Rx3a Gx3a 14.B*3c # Side Pawn, B*4e Variation 2 1.P-7f P-3d 2.P-2f P-8d 3.P-2e P-8e 4.G-7h G-3b 5.P-2d Px2d 6.Rx2d P-8f 7.Px8f Rx8f 8.Rx3d Bx8h+ 9.Sx8h B*4e? 10.R-2d Bx6g+? 11.Gx6g Rx8h+ 12.Rx2a+ +Rx8i 13.P*6i N*5e 14.G-6h S*6g 15.G6h-5h Sx5h+ 16.Gx5h G*6g 17.G-4h +R-7h 18.S*5f # Side Pawn, B*4e Variation 3 1.P-7f P-3d 2.P-2f P-8d 3.P-2e P-8e 4.G-7h G-3b 5.P-2d Px2d 6.Rx2d P-8f 7.Px8f Rx8f 8.Rx3d Bx8h+ 9.Sx8h B*4e? 10.R-2d P*2c 11.R-2h # Side Pawn, B*4e Variation 4 1.P-7f P-3d 2.P-2f P-8d 3.P-2e P-8e 4.G-7h G-3b 5.P-2d Px2d 6.Rx2d P-8f 7.Px8f Rx8f 8.Rx3d Bx8h+ 9.Sx8h P*2h 10.Sx2h B*4e 11.R-2d P*2c 12.B*7g Rx8h+ 13.Bx8h Px2d 14.Bx1a+ # Side Pawn, B*4e Variation 5 1.P-7f P-3d 2.P-2f P-8d 3.P-2e P-8e 4.G-7h G-3b 5.P-2d Px2d 6.Rx2d P-8f 7.Px8f Rx8f 8.Rx3d Bx8h+ 9.Sx8h P*2h 10.Sx2h B*4e 11.R-2d P*2c 12.P*8g? Rx7f 13.P*7g R-6f 14.K-6h Px2d 15.Px6f # # King's Head Vanguard Pawn vs. Ranging Rook 1 1.P-7f P-3d 2.P-2f P-4d 3.P-5f S-3b 4.S-4h R-4b 5.K-6h K-6b 6.G4i-5h K-7b 7.K-7h K-8b 8.S-6h S-7b 9.P-9f P-9d 10.S6h-5g S-4c 11.P-7e? P-6d 12.G6i-6h S-6c 13.S-6f R-7b # King's Head Vanguard Pawn vs. Ranging Rook 2 1.P-7f P-3d 2.P-2f P-4d 3.P-5f S-3b 4.S-4h R-4b 5.K-6h K-6b 6.G4i-5h K-7b 7.K-7h K-8b 8.S-6h S-7b 9.P-9f P-9d 10.S4h-5g S-4c 11.P-7e P-6d? 12.S-7g S-6c 13.S-7f R-7b 14.S-6f # King's Head Vanguard Pawn vs. Ranging Rook 3 1.P-7f P-3d 2.P-2f P-4d 3.P-5f S-3b 4.S-4h R-4b 5.K-6h K-6b 6.G4i-5h K-7b 7.K-7h K-8b 8.S-6h S-7b 9.P-9f P-9d 10.P-2e B-3c 11.S4h-5g S-4c 12.P-7e? R-2b 13.S-7g G-3b 14.S-7f? P-2d 15.Px2d Rx2d # King's Head Vanguard Pawn vs. Ranging Rook 4 1.P-7f P-3d 2.P-2f P-4d 3.P-5f S-3b 4.S-4h R-4b 5.K-6h K-6b 6.G4i-5h K-7b 7.K-7h K-8b 8.S-6h S-7b 9.P-9f P-9d 10.S4h-5g S-4c 11.P-7e G4a-5b 12.S-7g P-5d 13.S-7f P-3e 14.P-2e B-3c 15.P-1f P-1d 16.B-7g R-3b 17.P-6f B-4b 18.R-2f R-3d 19.K-8h N-3c 20.G-7h # # Quick-Attack Line vs. Ranging Rook 1 1.P-7f P-3d 2.P-2f P-4d 3.P-5f S-3b 4.S-4h R-4b 5.K-6h K-6b 6.G4i-5h K-7b 7.K-7h K-8b 8.S-6h S-7b 9.P-9f P-9d 10.P-3f G4a-5b 11.S6h-5g S-4c 12.P-2e B-3c 13.S-4f P-6d? 14.P-3e Px3e? 15.Sx3e P*3d 16.P-2d Px3e 17.Px2c+ # Quick-Attack Line vs. Ranging Rook 2 1.P-7f P-3d 2.P-2f P-4d 3.P-5f S-3b 4.S-4h R-4b 5.K-6h K-6b 6.G4i-5h K-7b 7.K-7h K-8b 8.S-6h S-7b 9.P-9f P-9d 10.P-3f G4a-5b 11.S6h-5g S-4c 12.P-2e B-3c 13.S-4f P-6d? 14.P-3e P-4e? 15.Bx3c+ Nx3c 16.S-5e Px3e 17.P-2d # Quick-Attack Line vs. Ranging Rook 3 1.P-7f P-3d 2.P-2f P-4d 3.P-5f S-3b 4.S-4h R-4b 5.K-6h K-6b 6.G4i-5h K-7b 7.K-7h K-8b 8.S-6h S-7b 9.P-9f P-9d 10.P-3f G4a-5b 11.S6h-5g S-4c 12.P-2e B-3c 13.S-4f P-6d? 14.P-3e R-3b 15.Px3d Sx3d 16.R-3h P-4e 17.Bx3c+ Rx3c 18.S-5e # Quick-Attack Line vs. Ranging Rook 4 1.P-7f P-3d 2.P-2f P-4d 3.P-5f S-3b 4.S-4h R-4b 5.K-6h K-6b 6.G4i-5h K-7b 7.K-7h K-8b 8.S-6h S-7b 9.P-9f P-9d 10.P-3f G4a-5b 11.S6h-5g S-4c 12.P-2e B-3c 13.S-4f P-5d 14.P-3e R-3b 15.G6i-6h # Quick-Attack Line vs. Ranging Rook 5 1.P-7f P-3d 2.P-2f P-4d 3.P-5f S-3b 4.S-4h R-4b 5.K-6h K-6b 6.G4i-5h K-7b 7.K-7h K-8b 8.S-6h S-7b 9.P-9f P-9d 10.P-3f G4a-5b 11.S6h-5g S-4c 12.P-2e B-3c 13.S-4f P-5d 14.P-3e R-3b 15.R-3h? P-4e 16.Bx3c+ Rx3c # # Fortress Opening - the Basics 1 1.P-7f P-8d 2.S-6h P-3d 3.S-7g # Fortress Opening - the Basics 2 1.P-7f P-8d 2.S-7h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.G-7h? G-3b 6.G-5h K-4a 7.P-6f? P-6d 8.K-6i P-7d 9.G5h-6g S-6c 10.P-5f S-5d 11.B-7i R-6b 12.B-6h N-7c 13.K-7i? N-8e 14.S-8h P-6e # Fortress Opening - the Basics 3 1.P-7f P-8d 2.S-7h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-2f P-6d? 6.P-2e B-3c 7.P-5f # Fortress Opening - the Basics 4 1.P-7f P-8d 2.S-7h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-2f P-8e 6.P-5f? P-8f 7.Px8f Rx8f 8.Sx8f Bx8h+ # Fortress Opening - the Basics 5 1.P-7f P-8d 2.S-7h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-2f P-8e 6.P-5f? P-8f 7.Px8f Rx8f 8.G-7h Bx7g+ Nx7g S*8g # Fortress Opening - the Basics 6 1.P-7f P-8d 2.S-7h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-2f S-3c 6.G-7h G-3b 7.G-5h G-5b 8.P-5f P-5d 9.P-3f P-7d 10.B-7i B-3a 11.K-6i K-4a 12.P-6f P-4d 13.P-1f P-1d 14.P-2e P-8e 15.S-3g G5b-4c 16.G5h-6g P-6d? 17.P-3e Px3e 18.Bx3e S-6c 19.S-3f B-4b 20.P-4f P*3d 21.B-2f # Fortress Opening - the Basics 7 1.P-7f P-8d 2.S-7h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-2f S-3c 6.G-7h G-3b 7.G-5h G-5b 8.P-5f P-5d 9.P-3f P-7d 10.B-7i B-3a 11.K-6i K-4a 12.P-6f P-4d 13.P-1f P-1d 14.P-2e P-8e 15.S-3g B-6d 16.L-1g B-7c 17.R-1h S-5c? 18.P-1e Px1e 19.Lx1e Lx1e 20.Rx1e P*1c 21.R-1h G5b-4c 22.P*1b # Fortress Opening - the Basics 8 1.P-7f P-8d 2.S-7h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-2f S-3c 6.G-7h G-3b 7.G-5h G-5b 8.P-5f P-5d 9.P-3f P-7d 10.B-7i B-3a 11.K-6i K-4a 12.P-6f P-4d 13.P-1f P-1d 14.P-2e P-8e 15.S-3g B-6d 16.L-1g B-7c 17.R-1h S-5c? 18.P-1e Px1e 19.Lx1e P*1c 20.Lx1c+ Nx1c 21.Bx1c+ Lx1c 22.Rx1c+ S-2b 23.+R-1h B-5a 24.P*1d # Fortress Opening - the Basics 9 1.P-7f P-8d 2.S-7h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-2f S-3c 6.G-7h G-3b 7.G-5h G-5b 8.P-5f P-5d 9.P-3f P-7d 10.B-7i B-3a 11.K-6i K-4a 12.P-6f P-4d 13.P-1f P-1d 14.P-2e P-8e 15.S-3g B-6d 16.L-1g K-3a? 17.R-1h K-2b 18.S-2f G5b-4c 19.P-1e Px1e 20.Sx1e # Fortress Opening - the Basics 10 1.P-7f P-8d 2.S-7h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-2f S-3c 6.G-7h G-3b 7.G-5h G-5b 8.P-5f P-5d 9.P-3f P-7d 10.B-7i B-3a 11.K-6i K-4a 12.P-6f P-4d 13.P-1f P-1d 14.P-2e P-8e 15.S-3g B-6d 16.L-1g B-7c 17.R-1h G-2b 18.G5h-6g S-5c 19.B-5g P-6d 20.S-2f B-8d 21.K-7i N-7c 22.R-3h G-4c 23.P-3e Px3e 24.Sx3e P*3d 25.S-4f K-3a # # Fortress Opening, N-3g Variation 1 1.P-7f P-8d 2.S-7h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-2f S-3c 6.G-7h G-3b 7.G-5h G-5b 8.P-5f P-5d 9.P-3f P-7d 10.B-7i B-3a 11.K-6i K-4a 12.P-6f P-4d 13.P-1f P-8e 14.P-1e B-6d 15.N-3g G5b-4c 16.L-1g K-3a 17.R-1h B-7c? 18.P-1d Px1d 19.Lx1d P*1c 20.Lx1c Nx1c 21.Bx1c+ Lx1c Rx1c+ # Fortress Opening, N-3g Variation 2 1.P-7f P-8d 2.S-7h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-2f S-3c 6.G-7h G-3b 7.G-5h G-5b 8.P-5f P-5d 9.P-3f P-7d 10.B-7i B-3a 11.K-6i K-4a 12.P-6f P-4d 13.P-1f P-8e 14.P-1e B-6d 15.N-3g G5b-4c 16.L-1g K-3a 17.R-1h K-2b 18.B-6h S-7c? 19.P-6e B-4b 20. N-2e # Fortress Opening, N-3g Variation 3 1.P-7f P-8d 2.S-7h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-2f S-3c 6.G-7h G-3b 7.G-5h G-5b 8.P-5f P-5d 9.P-3f P-7d 10.B-7i B-3a 11.K-6i K-4a 12.P-6f P-4d 13.P-1f P-8e 14.P-1e B-6d 15.N-3g G5b-4c 16.L-1g K-3a 17.R-1h K-2b 18.B-6h B-7c 19.G5h-6g S-5c? 20.K-7i P-6d 21.K-8h B-8d 22.N-2e # Fortress Opening, N-3g Variation 4 1.P-7f P-8d 2.S-7h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-2f S-3c 6.G-7h G-3b 7.G-5h G-5b 8.P-5f P-5d 9.P-3f P-7d 10.B-7i B-3a 11.K-6i K-4a 12.P-6f P-4d 13.P-1f P-8e 14.P-1e B-6d 15.N-3g G5b-4c 16.L-1g K-3a 17.R-1h K-2b 18.B-6h B-7c 19.G5h-6g S-2d 20.P-4f B-8d # Fortress Opening, N-3g Variation 5 1.P-7f P-8d 2.S-7h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-2f S-3c 6.G-7h G-3b 7.G-5h G-5b 8.P-5f P-5d 9.P-3f P-7d 10.B-7i B-3a 11.K-6i K-4a 12.P-6f P-4d 13.P-1f P-8e 14.P-1e S-7c 15.G5h-6g G5b-4c 16.N-3g S-6d 17.B-5g P-7e 18.P-6e Sx6e 19.Px7e # Fortress Opening, N-3g Variation 6 1.P-7f P-8d 2.S-7h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-2f S-3c 6.G-7h G-3b 7.G-5h G-5b 8.P-5f P-5d 9.P-3f P-7d 10.B-7i B-3a 11.K-6i K-4a 12.P-6f P-4d 13.P-1f P-8e 14.P-1e S-7c 15.G5h-6g G5b-4c 16.N-3g S-6d 17.B-5g P-7e 18.Px7e? Sx7e 19.P*7f P-8f 20.Px8f Sx8f 21.Sx8f Bx8f 22.P*8g B-4b # Fortress Opening, N-3g Variation 7 1.P-7f P-8d 2.S-7h P-3d 3.S-7g S-6b 4.S-4h S-4b 5.P-2f S-3c 6.G-7h G-3b 7.G-5h G-5b 8.P-5f P-5d 9.P-3f P-7d 10.B-7i B-3a 11.K-6i K-4a 12.P-6f P-4d 13.P-1f P-8e 14.P-1e S-7c 15.G5h-6g G5b-4c 16.N-3g P-7e? 17.Px7e Bx7e 18.P-6e B-4b 19.B-4f P*7d 20.S-6f # # 1.P7g-7f P3c-3d 2.P6g-6f P3d-3e 3.S7i-6h R8b-3b 4.S6h-6g P3e-3f 5.P3gx3f R3bx3f 6.P*3g R3f-3d 7.B8h-7g S3a-4b 8.R2h-8h K5a-6b 9.G4i-4h K6b-7b 10.K5i-4i G4a-5b 11.K4i-3h G6a-6b 12.P8g-8f P1c-1d # 1.P7g-7f P3c-3d 2.P7f-7e K5a-4b 3.P6g-6f S7a-6b 4.R2h-7h P6c-6d 5.K5i-4h P8c-8d 6.S7i-6h P8d-8e 7.R7h-7f P6d-6e 8.S6h-7g P6ex6f 9.S7gx6f P*6e 10.S6f-7g S6b-6c 11.G6i-7h K4b-3b # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-7b 7.P9g-9f P1c-1d 8.P1g-1f P6c-6d 9.S3i-3h S7b-6c 10.P9f-9e P3c-3d 11.P7g-7f S6c-5d 12.K5i-4h P4c-4d 13.P7f-7e G6a-7b 14.R2f-7f S3a-4b # Tanaka p.20 Double Fortress 1. 7g7f 8c8d 2. 7i6h 3c3d 3. 6h7g 7a6b 4. 2g2f 3a4b 5. 3i4h 4a3b 6. 6i7h 5c5d 7. 5i6i 5a4a 8. 5g5f 7c7d 9. 3g3f 6b5c 10. 2f2e 4b3c # Tanaka, p.20 1. 7g7f 8c8d 2. 7i6h 3c3d 3. 6h7g 7a6b 4. 2g2f 3a4b 5. 3i4h 4a3b 6. 6i7h 5c5d 7. 5i6i 5a4a 8. 5g5f 7c7d 9. 3g3f 6b5c 10. 2f2e 4b3c 11. 4i5h 2b3a 12. 6g6f 6a5b 13. 8h7i 4c4d 14. 5h6g 3a4b 15. 7i4f 5c6d # Tanaka, p.31 2g2f 8c8d 2f2e 8d8e 6i7h 4a3b 2e2d 2c2d 2h2d P*2c 2d2f 7a7b 9g9f 1c1d 2f3f 6c6d 7g7f 8e8f 8g8f 8b8f 7f7e 8f8b 8i7g 7b6c 5i4h 3a4b 8h9g 6a7b P*8e 4c4d 3f7f 4d4e 7i6h 3c3d 6g6f 5a4a 5g5f 4a3a 4h3h 2b3c # Tanaka, p.40 7g7f 8c8d 2g2f 8d8e 2f2e 4a3b 8h7g 3c3d 7i6h 2b7g+ 6h7g 3a2b 6i7h 2b3c 3i3h 7a6b 5i6h 5a4b 3h2g 7c7d 2g2f 6b7c 2f1e 3c2b 2e2d 2c2d 1e2d P*2c 2d1e 7c6d 7g8h 1c1d 1e2f 7d7e 7f7e 6d7e 2f2e 8e8f 8g8f 8b8f # Tanaka, p.50 7g7f 8c8d 5g5f 3c3d 5f5e 7a6b 2h5h 5a4b 5i4h 4b3b 4h3h 3a4b 8h7g 6c6d 7i6h 6b6c 6h5g 6c7d 5g5f 6a5b 6g6f 8b6b 6i7h 6d6e 6f6e 7d6e 5f6e 6b6e 5h6h 6e6h+ 7h6h P*6g 6h6g R*7i 6g6h 7i8i+ S*7h N*4f 4g4f S*4g # Tanaka, p.70 7g7f 8c8d 7i6h 3c3d 6h7g 7a6b 3i4h 5c5d 5g5f 6a5b 6i7h 5a4b 5i6i 4b3b 3g3f 3a4b 8h7i 4b3c 4h3g 2b3a 3f3e 3d3e 7i3e 3a6d 2h3h P*3d 3e6h 4c4d 4i5h 5b4c # Tanaka, p.80 7g7f 8c8d 7i6h 3c3d 6h7g 7a6b 3i4h 5c5d 5g5f 6a5b 6i7h 5a4b 5i6i 4b3b 4i5h 3a4b 8h7i 7c7d 6g6f 4b3c 3g3f 2b3a 1g1f 4c4d 1f1e 5b4c 5h6g 6b7c 1i1g 7c6d # Tanaka, p.92 7g7f 8c8d 7i6h 3c3d 6h7g 7a6b 2g2f 3a4b 3i4h 4a3b 6i7h 5a4a 5i6i 5c5d 5g5f 7c7d 4i5h 6a5b 8h7i 4b3c 6g6f 2b3a 3g3f 4c4d 5h6g 5b4c 7i4f 3a6d 2f2e 4a3a 6i7i 3a2b 7i8h 8d8e 4h3g 6b7c 1g1f 9c9d 4f6d 7c6d # Tanaka, p.102 7g7f 3c3d 2g2f 4c4d 3i4h 3a3b 5g5f 8b4b 5i6h 5a6b 6h7h 6b7b 4i5h 7b8b 3g3f 7a7b 9g9f 9c9d 2f2e 2b3c 7i6h 3b4c 6h5g 4a5b 5g4f 4c3b 4f3g 5c5d 3g2f 3b4c 3f3e 4b3b 2h3h 3c4b 4g4f 4b6d 4h5g 5b5c 6g6f 7c7d # 1. 7g7f 8c8d 2. 7i6h 3c3d 3. 6h7g 7a6b 4. 2g2f 3a4b 5. 3i4h 4a3b 6. 6i7h 5a4a 7. 5i6i 5c5d 8. 5g5f 6a5b 9. 4i5h 4b3c 10. 8h7i 2b3a 11. 6g6f 4c4d 12. 3g3f 7c7d 13. 1g1f 6b7c 14. 5h6g 5b4c 15. 1f1e 8d8e # 1. 7g7f 8c8d 2. 7i6h 3c3d 3. 6h7g 3d3e 4. 5g5f 8b3b 5. 3i4h 5a6b 6. 5i6h 7a7b 7. 6h7h 6b7a 8. 4i5h 7c7d 9. 2g2f 4a5b 10. 2f2e 3b3d 11. 4h5g 2a3c 12. 2h2f 1c1d 13. 8h7i 2b1c 14. 1g1f 3a4b 15. 5g4f 8a7c 16. 6g6f 6c6d 17. 9g9f 4b5a 18. 7h8h 5a6b 19. 6i7h 6b6c 20. 5h6g 9c9d # 1. 2g2f 8c8d 2. 2f2e 8d8e 3. 6i7h 4a3b 4. 2e2d 2c2d 5. 2h2d P*2c 6. 2d2f 7a6b 7. 9g9f 3c3d 8. 2f3f 3b3c 9. 7g7f 5a4a 10. 3i3h 1c1d 11. 3f2f 3c3b 12. 4g4f 8e8f 13. 8g8f 8b8f 14. P*8g 8f8b 15. 3h4g 5c5d 16. 5i6i 6b5c 17. 4i5h 5d5e 18. 7i6h 5c5d 19. 3g3f 5d6e 20. 6h7g 5e5f # 1. 7g7f 8c8d 2. 7i6h 3c3d 3. 6h7g 7a6b 4. 3i4h 3a4b 5. 6i7h 4a3b 6. 5i6i 5a4a 7. 5g5f 5c5d 8. 2g2f 6a5b 9. 3g3f 4c4d 10. 4i5h 4b3c 11. 8h7i 2b3a 12. 6g6f 7c7d 13. 1g1f 6b7c 14. 5h6g 5b4c 15. 4h3g 7d7e # 1. 2g2f 8c8d 2. 2f2e 8d8e 3. 6i7h 4a3b 4. 2e2d 2c2d 5. 2h2d P*2c 6. 2d2f 7a6b 7. 9g9f 1c1d 8. 7g7f 3c3d 9. 8i7g 2b4d 10. 2f5f 3a4b 11. 3i3h 6c6d 12. 5i4h 6b6c 13. 7f7e 5a4a 14. 8h9g 6a7b 15. 8g8f 8e8f # 1. 7g7f 8c8d 2. 2h7h 3c3d 3. 6g6f 8d8e 4. 8h7g 5a4b 5. 7i6h 4b3b 6. 5i4h 7a6b 7. 4h3h 6a5b 8. 3h2h 7c7d 9. 3i3h 5c5d 10. 5g5f 1c1d 11. 1g1f 3a4b 12. 6i5h 4b5c 13. 4g4f 9c9d 14. 9g9f 4a4b 15. 3g3f 7d7e # 1. 2g2f 8c8d 2. 2f2e 8d8e 3. 6i7h 4a3b 4. 2e2d 2c2d 5. 2h2d P*2c 6. 2d2f 7a6b 7. 9g9f 1c1d 8. 3i3h 6c6d 9. 4g4f 6b6c 10. 3h4g 3c3d 11. 4g5f 6c5d 12. 5i6h 5a4b 13. 4i4h 8e8f 14. 8g8f 8b8f 15. P*8g 8f8d # 1. 7g7f 8c8d 2. 7i6h 3c3d 3. 6h7g 7a6b 4. 2g2f 3a4b 5. 3i4h 4a3b 6. 6i7h 5a4a 7. 5i6i 5c5d 8. 5g5f 6a5b 9. 3g3f 4c4d 10. 4g4f 5b4c 11. 4h4g 8d8e 12. 2i3g 1c1d 13. 9g9f 9c9d 14. 4i5h 7c7d 15. 2f2e 4b3c # 1. 2g2f 8c8d 2. 2f2e 8d8e 3. 6i7h 4a3b 4. 2e2d 2c2d 5. 2h2d P*2c 6. 2d2f 7a7b 7. 9g9f 1c1d 8. 7g7f 8e8f 9. 8g8f 8b8f 10. 8i7g 9c9d 11. 7g6e 8f8e 12. 6e5c+ P*8f 13. 2f5f 5a4a 14. 5f5e 8e5e 15. 8h5e 8f8g+ # 1. 7g7f 3c3d 2. 2g2f 4c4d 3. 3i4h 3a4b 4. 5i6h 8b5b 5. 6h7h 5a6b 6. 4i5h 6b7b 7. 5g5f 4b4c 8. 2f2e 2b3c 9. 3g3f 7b8b 10. 7i6h 7a7b 11. 6h5g 4a3b 12. 9g9f 9c9d 13. 6i6h 5c5d 14. 4g4f 6c6d 15. 4h3g 7c7d # 1. 2g2f 8c8d 2. 2f2e 8d8e 3. 6i7h 4a3b 4. 2e2d 2c2d 5. 2h2d P*2c 6. 2d2f 7a7b 7. 3i3h 6c6d 8. P*2d 2c2d 9. 2f2d 1c1d 10. 7g7f 8e8f 11. 8g8f 8b8f 12. 1g1f 6a7a 13. 1f1e 1d1e 14. P*1d P*2c 15. 2d2e 1e1f # # 1.P2g-2f P3c-3d 2.P2f-2e B2b-3c 3.P7g-7f P4c-4d 4.S3i-4h R8b-3b 5.P3g-3f S3a-4b 6.K5i-6h K5a-6b 7.K6h-7h K6b-7b 8.P5g-5f P5c-5d 9.G4i-5h G4a-5b 10.S7i-6h S4b-5c 11.P1g-1f P1c-1d 12.P4g-4f K7b-8b 13.N2i-3g S7a-7b # 1.P2g-2f P3c-3d 2.P2f-2e B2b-3c 3.P7g-7f P4c-4d 4.S3i-4h S3a-4b 5.P5g-5f S4b-4c 6.S4h-5g P5c-5d 7.B8h-7g G4a-3b 8.K5i-6h S7a-6b 9.S7i-7h S6b-5c 10.P6g-6f P7c-7d 11.S7h-6g K5a-4a 12.G6i-7h R8b-5b 13.P3g-3f N8a-7c # 1.P7g-7f P3c-3d 2.P2g-2f P4c-4d 3.S3i-4h S3a-3b 4.P5g-5f R8b-4b 5.K5i-6h K5a-6b 6.K6h-7h S7a-7b 7.S4h-5g G4a-5b 8.B8h-7g K6b-7a 9.K7h-8h S3b-4c 10.L9i-9h S4c-5d 11.P6g-6f K7a-8b 12.K8h-9i P6c-6d 13.S7i-8h P7c-7d 14.G6i-7i G5b-6c # 1.P7g-7f P3c-3d 2.P2g-2f P4c-4d 3.S3i-4h S3a-4b 4.P5g-5f S4b-4c 5.K5i-6h P3d-3e 6.K6h-7h R8b-3b 7.P2f-2e B2b-3c 8.G4i-3h K5a-6b 9.G3h-2g K6b-7b 10.P3g-3f B3c-4b 11.P3fx3e R3bx3e 12.G2g-2f R3e-3a # 1.P7g-7f P3c-3d 2.P2g-2f P4c-4d 3.S3i-4h S3a-3b 4.P5g-5f R8b-4b 5.K5i-6h K5a-6b 6.K6h-7h S7a-7b 7.G4i-5h K6b-7a 8.P9g-9f P9c-9d 9.S4h-5g G4a-5b 10.S7i-6h K7a-8b 11.P5f-5e S3b-4c 12.P2f-2e B2b-3c # 1.P2g-2f P3c-3d 2.P7g-7f P4c-4d 3.S3i-4h S3a-3b 4.P5g-5f R8b-4b 5.K5i-6h K5a-6b 6.K6h-7h S7a-7b 7.G4i-5h K6b-7a 8.P3g-3f G4a-5b 9.S7i-6h P9c-9d 10.P9g-9f K7a-8b 11.P2f-2e B2b-3c 12.P1g-1f P1c-1d # 1.P7g-7f P3c-3d 2.P2g-2f P4c-4d 3.S3i-4h S3a-3b 4.P5g-5f R8b-4b 5.K5i-6h K5a-6b 6.K6h-7h S7a-7b 7.G4i-5h K6b-7a 8.P9g-9f P9c-9d 9.P8g-8f S3b-4c 10.K7h-8g G4a-5b 11.S7i-7h P6c-6d 12.P2f-2e B2b-3c 13.S4h-5g K7a-8b 14.S5g-6f G5b-6c # 1.P2g-2f P3c-3d 2.P7g-7f P4c-4d 3.S3i-4h S3a-4b 4.G4i-5h S4b-4c 5.K5i-6h P5c-5d 6.P5g-5f P8c-8d 7.S7i-7h S7a-6b 8.P2f-2e G4a-3b 9.P2e-2d P2cx2d 10.R2hx2d P*2c 11.R2d-2h S6b-5c 12.S7h-7g P7c-7d 13.P6g-6f P6c-6d 14.K6h-7h G6a-5b # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-7b 7.P1g-1f P1c-1d 8.S3i-3h P9c-9d 9.P9g-9f P3c-3d 10.P7g-7f K5a-4b 11.K5i-6h P8e-8f 12.P8gx8f R8bx8f 13.P*8g R8f-8b # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.S3i-4h S3a-4b 5.P5g-5f P5c-5d 6.G6i-7h G4a-3b 7.K5i-6i K5a-4a 8.G4i-5h G6a-5b 9.P6g-6f S4b-3c 10.B8h-7i B2b-3a 11.P3g-3f P4c-4d 12.G5h-6g G5b-4c # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.S3i-4h P5c-5d 5.P5g-5f S3a-4b 6.G6i-7h G6a-5b 7.K5i-6i G4a-3b 8.G4i-5h K5a-4a 9.P6g-6f P7c-7d 10.P3g-3f P5d-5e 11.S4h-5g S6b-5c 12.P2g-2f S5c-5d # 1.P7g-7f P3c-3d 2.P2g-2f P4c-4d 3.S3i-4h S3a-3b 4.P5g-5f P5c-5d 5.G4i-5h S7a-6b 6.G6i-7h G6a-5b 7.S7i-6h P8c-8d 8.K5i-6i G5b-4c 9.P4g-4f S3b-3c 10.P3g-3f G4a-3b 11.S4h-4g K5a-4a # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-6b 7.P1g-1f P1c-1d 8.S3i-3h P3c-3d 9.P7g-7f P5c-5d 10.P4g-4f S6b-5c 11.B8hx2b+ S3ax2b 12.S7i-8h P8e-8f 13.P8gx8f R8bx8f 14.P*8g R8f-8b 15.P3g-3f G6a-5b # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-6b 7.P1g-1f P1c-1d 8.S3i-3h P3c-3d 9.P7g-7f P8e-8f 10.P8gx8f R8bx8f # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-6b 7.P1g-1f P1c-1d 8.S3i-3h P3c-3d 9.P7g-7f P6c-6d 10.R2f-3f B2bx8h+ 11.S7ix8h # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-6b 7.S3i-3h P6c-6d 8.P*2d P2cx2d 9.R2fx2d P1c-1d 10.P7g-7f P8e-8f # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-7b 7.S3i-3h P6c-6d 8.P1g-1f P1c-1d 9.P7g-7f P3c-3d 10.R2f-3f B2bx8h+ 11.S7ix8h B*2h # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-7b 7.S3i-3h P6c-6d 8.P1g-1f P1c-1d 9.P7g-7f P8e-8f 10.P8gx8f R8bx8f 11.P*2d P2cx2d 12.R2fx2d S7b-6c 13.P1f-1e P1dx1e 14.P*1d P*2c # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.P2g-2f S3a-4b 5.S3i-4h G4a-3b 6.G6i-7h P5c-5d 7.P5g-5f K5a-4a 8.K5i-6i G6a-5b 9.P3g-3f P7c-7d 10.G4i-5h S4b-3c 11.B8h-7i B2b-3a 12.P6g-6f P4c-4d # 1.P7g-7f P8c-8d 2.P2g-2f P8d-8e 3.P2f-2e G4a-3b 4.G6i-7h P8e-8f 5.P8gx8f R8bx8f 6.P2e-2d P2cx2d 7.R2hx2d P*2c 8.R2d-2f S7a-6b 9.P1g-1f P1c-1d 10.S3i-3h R8f-8b 11.P*8g P6c-6d 12.P4g-4f S6b-6c # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.S3i-4h S3a-4b 5.P5g-5f G4a-3b 6.G4i-5h K5a-4a 7.G6i-7h P5c-5d 8.K5i-6i G6a-5b 9.P6g-6f P6c-6d 10.G5h-6g S6b-5c 11.P2g-2f R8b-6b 12.S4h-5g P7c-7d # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-7b 7.S3i-3h P9c-9d 8.P1g-1f P1c-1d 9.P9g-9f P3c-3d 10.R2f-3f G3b-3c 11.S7i-6h P6c-6d 12.S3h-2g S3a-3b # 1.P7g-7f P8c-8d 2.P2g-2f P8d-8e 3.B8h-7g P3c-3d 4.S7i-8h G4a-3b 5.G6i-7h B2bx7g+ 6.S8hx7g S3a-4b 7.S3i-3h S7a-7b 8.P4g-4f P6c-6d 9.S3h-4g S7b-6c 10.G4i-5h P1c-1d 11.P1g-1f P9c-9d 12.P9g-9f G6a-5b # 1.P2g-2f P3c-3d 2.P7g-7f P8c-8d 3.P2f-2e P8d-8e 4.G6i-7h G4a-3b 5.P2e-2d P2cx2d 6.R2hx2d P8e-8f 7.P8gx8f R8bx8f 8.R2dx3d N2a-3c 9.R3d-3f R8f-8d 10.R3f-2f N3c-4e 11.R2f-5f P*2h 12.S3ix2h B2bx8h+ 13.S7ix8h B*9b # 1.P2g-2f P3c-3d 2.P7g-7f P8c-8d 3.P2f-2e P8d-8e 4.G6i-7h G4a-3b 5.P2e-2d P2cx2d 6.R2hx2d P8e-8f 7.P8gx8f R8bx8f 8.R2dx3d B2bx8h+ 9.S7ix8h P*2h 10.S3ix2h B*4e # 1.P2g-2f P3c-3d 2.P7g-7f P8c-8d 3.P2f-2e P8d-8e 4.G6i-7h G4a-3b 5.P2e-2d P2cx2d 6.R2hx2d P8e-8f 7.P8gx8f R8bx8f 8.R2dx3d B2b-3c # 1.P2g-2f P3c-3d 2.P7g-7f P8c-8d 3.P2f-2e P8d-8e 4.G6i-7h G4a-3b 5.P2e-2d P2cx2d 6.R2hx2d P8e-8f 7.P8gx8f R8bx8f 8.R2dx3d B2bx8h+ 9.S7ix8h R8fx7f # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G6i-7h G4a-3b 7.K5i-6i K5a-4a 8.G4i-5h P6c-6d 9.P2g-2f P8d-8e 10.S6h-7g P5d-5e 11.P5fx5e B2bx5e 12.P2f-2e B5e-2b 13.G5h-6g S6b-6c 14.B8h-7i P7c-7d # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.G5h-6g K5a-4a 8.S6h-7g P7c-7d 9.P2g-2f G6a-5b 10.P2f-2e S4b-3c 11.B8h-7i P8d-8e 12.P3g-3f B2b-3a 13.B7i-4f B3a-6d 14.S4h-3g P4c-4d 15.K5i-6h S6b-7c # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.G5h-6g K5a-4a 8.G6i-7h G6a-5b 9.K5i-6i S4b-3c 10.S6h-7g B2b-3a 11.B8h-7i P4c-4d 12.P3g-3f G5b-4c 13.B7i-6h P7c-7d 14.K6i-7i B3a-6d 15.N2i-3g K4a-3a # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.G5h-6g K5a-4a 8.G6i-7h G6a-5b 9.K5i-6i S4b-3c 10.S6h-7g B2b-3a 11.B8h-7i P4c-4d 12.P3g-3f P7c-7d 13.B7i-6h G5b-4c 14.K6i-7i B3a-6d 15.N2i-3g # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.G5h-6g K5a-4a 8.G6i-7h G6a-5b 9.K5i-6i S4b-3c 10.S6h-7g B2b-3a 11.B8h-7i P4c-4d 12.P3g-3f G5b-4c 13.B7i-6h P7c-7d 14.K6i-7i B3a-6d 15.S4h-3g K4a-3a # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.G5h-6g K5a-4a 8.S6h-7g P7c-7d 9.P2g-2f G6a-5b 10.B8h-7i S4b-3c 11.P3g-3f B2b-3a 12.K5i-6h P7d-7e 13.P7fx7e B3ax7e 14.K6h-7h B7e-6d 15.N2i-3g P4c-4d # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.S3i-4h P5c-5d 5.P5g-5f S3a-4b 6.G4i-5h G4a-3b 7.P6g-6f K5a-4a 8.G5h-6g P7c-7d 9.B8h-7i S4b-3c 10.K5i-6h P6c-6d 11.K6h-7h S6b-6c 12.P3g-3f S3c-4d # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.G5h-6g K5a-4a 8.S6h-7g P7c-7d 9.B8h-7i P6c-6d 10.G6i-7h S6b-6c 11.K5i-6i # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.P6g-6f K5a-4a 8.G5h-6g P7c-7d 9.B8h-7i S4b-3c 10.P3g-3f B2b-3a 11.K5i-6h P7d-7e 12.P7fx7e B3ax7e 13.P6f-6e B7e-4b 14.K6h-7h S6b-7c # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.G5h-6g K5a-4a 8.G6i-7h G6a-5b 9.K5i-6i S4b-3c 10.S6h-7g B2b-3a 11.B8h-7i P4c-4d 12.P3g-3f G5b-4c 13.B7i-6h P7c-7d # 1.P7g-7f P8c-8d 2.P2g-2f G4a-3b 3.G6i-7h P8d-8e 4.B8h-7g P3c-3d 5.S7i-8h B2bx7g+ 6.S8hx7g S3a-4b 7.S3i-3h S7a-7b 8.P4g-4f P6c-6d 9.S3h-4g S7b-6c 10.P6g-6f P4c-4d 11.G4i-5h G6a-5b 12.K5i-6h K5a-4a 13.K6h-7i K4a-3a # 1.P7g-7f P8c-8d 2.B8h-7g P3c-3d 3.S7i-6h S7a-6b 4.S3i-3h P6c-6d 5.P4g-4f S6b-6c 6.S3h-4g G4a-3b 7.G6i-7h G6a-5b 8.S4g-5f S6c-5d 9.R2h-4h K5a-4a 10.P4f-4e B2bx7g+ 11.S6hx7g S3a-4b 12.K5i-6h K4a-3a 13.P3g-3f P7c-7d # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h K5a-4b 6.P2g-2f S3a-3b 7.G4i-5h G6a-5b 8.G5h-6g S3b-3c 9.S6h-7g K4b-3b 10.K5i-6h P4c-4d 11.K6h-7h G5b-4c 12.B8h-7i B2b-3a 13.P3g-3f P7c-7d # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.G5h-6g K5a-4a 8.G6i-7h G6a-5b 9.K5i-6i S4b-3c 10.S6h-7g P4c-4d 11.B8h-7i B2b-3a 12.P3g-3f G5b-4c 13.B7i-6h P7c-7d # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.G5h-6g K5a-4a 8.S6h-7g P7c-7d 9.B8h-7i P6c-6d 10.P2g-2f S6b-6c 11.P2f-2e R8b-5b 12.G6i-7h N8a-7c # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.S3i-4h P5c-5d 5.P5g-5f S3a-4b 6.G6i-7h G4a-3b 7.K5i-6i K5a-4a 8.P2g-2f G6a-5b 9.P2f-2e S4b-3c 10.P3g-3f P4c-4d 11.S4h-3g G5b-4c 12.S3g-4f S6b-5c # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S6b-5c 6.G6i-7h S5c-6d 7.P2g-2f S3a-4b 8.K5i-6i G4a-3b 9.P2f-2e S4b-3c 10.P3g-3f G6a-5b 11.G4i-5h K5a-4a 12.P6g-6f P4c-4d 13.G5h-6g G5b-4c # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-7b 7.P1g-1f P1c-1d 8.S3i-3h P6c-6d 9.P7g-7f P8e-8f 10.P8gx8f R8bx8f 11.P*8g R8f-8b 12.P3g-3f P3c-3d # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.S3i-4h P5c-5d 5.P5g-5f S3a-4b 6.G4i-5h G4a-3b 7.P6g-6f K5a-4a 8.G5h-6g P7c-7d 9.P2g-2f S4b-3c 10.B8h-7i B2b-3a 11.K5i-6h S6b-7c 12.K6h-7h S7c-6d # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.G5h-6g K5a-4a 8.G6i-7h G6a-5b 9.K5i-6i S4b-3c 10.S6h-7g B2b-3a 11.B8h-7i P4c-4d 12.P3g-3f P7c-7d 13.B7i-6h P9c-9d 14.K6i-7i P9d-9e 15.K7i-8h L9a-9c # 1.P7g-7f P8c-8d 2.P2g-2f P8d-8e 3.B8h-7g P3c-3d 4.S7i-8h B2bx7g+ 5.S8hx7g S3a-2b 6.S3i-3h S2b-3c 7.P4g-4f S7a-7b 8.S3h-4g K5a-4b 9.G6i-7h G4a-3b 10.P6g-6f G6a-5b 11.P9g-9f P7c-7d 12.S4g-5f S7b-7c # 1.P7g-7f P3c-3d 2.P2g-2f P8c-8d 3.P2f-2e P8d-8e 4.G6i-7h G4a-3b 5.P2e-2d P2cx2d 6.R2hx2d P*2c 7.R2d-2h B2bx8h+ 8.S7ix8h # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.G5h-6g K5a-4a 8.G6i-7h G6a-5b 9.K5i-6i S4b-3c 10.S6h-7g B2b-3a 11.B8h-7i P4c-4d 12.P3g-3f G5b-4c # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.G5h-6g K5a-4a 8.G6i-7h P7c-7d 9.K5i-6i S6b-5c 10.P2g-2f P8d-8e 11.S6h-7g P5d-5e 12.P5fx5e B2bx5e # 1.P7g-7f P8c-8d 2.P2g-2f P8d-8e 3.B8h-7g P3c-3d 4.S7i-8h G4a-3b 5.G6i-7h B2bx7g+ 6.S8hx7g S3a-4b 7.S3i-3h S7a-7b 8.P4g-4f P6c-6d 9.S3h-4g S7b-6c 10.G4i-5h P4c-4d 11.K5i-6h G6a-5b 12.K6h-7i K5a-4a 13.P9g-9f P1c-1d # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-7b 7.S3i-3h P3c-3d 8.P9g-9f P1c-1d 9.P1g-1f P9c-9d # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-7b 7.P1g-1f P1c-1d 8.S3i-3h P3c-3d 9.P7g-7f P8e-8f 10.P8gx8f R8bx8f 11.P*8g R8f-8b # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-7b 7.P1g-1f P1c-1d 8.P9g-9f P3c-3d 9.S3i-3h P6c-6d 10.R2f-3f G3b-3c 11.S3h-2g S7b-6c 12.G4i-3h P4c-4d 13.R3f-2f G6a-5b 14.S2g-3f G5b-4c # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-7b 7.P1g-1f P1c-1d 8.S3i-3h P3c-3d 9.P7g-7f P8e-8f 10.P8gx8f R8bx8f 11.P*8g R8f-8b # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.P6g-6f K5a-4a 8.G5h-6g P7c-7d 9.G6i-7h G6a-5b 10.B8h-7i S4b-3c 11.K5i-6i B2b-3a 12.B7i-6h P4c-4d # 1.P7g-7f P3c-3d 2.P2g-2f P4c-4d 3.S3i-4h S3a-3b 4.P5g-5f P5c-5d 5.G4i-5h S7a-6b 6.S7i-7h G6a-5b 7.S7h-7g S3b-3c 8.B8h-7i G5b-4c 9.K5i-6h B2b-3a 10.K6h-7h K5a-4b 11.P6g-6f K4b-3b 12.G5h-6g P7c-7d 13.K7h-8h S6b-7c 14.S4h-5g K3b-2b # 1.P7g-7f P3c-3d 2.P2g-2f P8c-8d 3.P2f-2e P8d-8e 4.G6i-7h G4a-3b 5.P2e-2d P2cx2d 6.R2hx2d P8e-8f 7.P8gx8f R8bx8f # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.G5h-6g K5a-4a 8.G6i-7h G6a-5b 9.K5i-6i S4b-3c 10.S6h-7g P4c-4d 11.B8h-7i B2b-3a 12.P3g-3f P7c-7d 13.B7i-6h G5b-4c # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.P6g-6f K5a-4a 8.G5h-6g P7c-7d 9.G6i-7h G6a-5b 10.K5i-6i S4b-3c 11.B8h-7i B2b-3a 12.P3g-3f P4c-4d 13.S4h-3g B3a-6d 14.B7i-6h G5b-4c # 1.P7g-7f P8c-8d 2.P2g-2f P8d-8e 3.B8h-7g P3c-3d 4.S7i-8h G4a-3b 5.G6i-7h B2bx7g+ 6.S8hx7g S3a-4b 7.S3i-3h S7a-6b 8.P4g-4f P6c-6d 9.S3h-4g S6b-6c 10.P6g-6f P4c-4d 11.G4i-5h G6a-5b 12.K5i-6h K5a-4a 13.K6h-7i S6c-5d 14.S4g-5f P7c-7d 15.P3g-3f K4a-3a # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-7b 7.P1g-1f P1c-1d 8.P7g-7f P8e-8f 9.P8gx8f R8bx8f 10.S3i-3h R8f-8b 11.P*8g P6c-6d 12.P3g-3f P3c-3d # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.P6g-6f K5a-4a 8.G5h-6g G6a-5b 9.G6i-7h S4b-3c 10.K5i-6i B2b-3a 11.B8h-7i P4c-4d 12.P3g-3f G5b-4c # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-7b 7.P1g-1f P1c-1d 8.S3i-3h P9c-9d 9.P9g-9f P3c-3d 10.P7g-7f K5a-4b # 1.P7g-7f P8c-8d 2.P2g-2f P8d-8e 3.B8h-7g P3c-3d 4.S7i-8h G4a-3b 5.G6i-7h B2bx7g+ 6.S8hx7g S3a-4b 7.S3i-3h S7a-7b 8.P4g-4f S4b-3c 9.S3h-4g K5a-4b 10.G4i-5h S7b-8c 11.P6g-6f S8c-8d 12.P9g-9f P9c-9d 13.P3g-3f K4b-3a 14.N2i-3g P7c-7d 15.K5i-4h P4c-4d # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-7b 7.P1g-1f P1c-1d 8.S3i-3h P9c-9d 9.R2f-5f K5a-4b 10.P3g-3f P3c-3d 11.N2i-3g G6a-5b 12.P7g-7f P6c-6d 13.B8hx2b+ S3ax2b # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G6i-7h G4a-3b 7.K5i-6i K5a-4a 8.G4i-5h P6c-6d 9.P2g-2f P8d-8e 10.S6h-7g P5d-5e 11.P5fx5e B2bx5e 12.P2f-2e B5e-2b # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-7b 7.P1g-1f P1c-1d 8.S3i-3h P9c-9d 9.K5i-5h P9d-9e 10.R2f-5f S3a-4b 11.P3g-3f K5a-6b # 1.P7g-7f P8c-8d 2.P2g-2f P8d-8e 3.B8h-7g P3c-3d 4.S7i-8h G4a-3b 5.G6i-7h B2bx7g+ 6.S8hx7g S3a-4b 7.S3i-3h S7a-7b 8.P4g-4f S4b-3c 9.S3h-4g K5a-4b 10.G4i-5h S7b-8c 11.P6g-6f S8c-8d 12.P9g-9f P9c-9d 13.P3g-3f K4b-3a 14.N2i-3g G6a-5b # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.S3i-4h S3a-4b 5.P5g-5f G4a-3b 6.G4i-5h K5a-4a 7.P6g-6f P5c-5d 8.G5h-6g G6a-5b 9.G6i-7h S4b-3c 10.K5i-6i B2b-3a 11.B8h-7i P4c-4d 12.P3g-3f P7c-7d # 1.P2g-2f P8c-8d 2.P7g-7f P8d-8e 3.B8h-7g P3c-3d 4.S7i-8h G4a-3b 5.G6i-7h B2bx7g+ 6.S8hx7g S3a-4b 7.S3i-3h S4b-3c 8.P4g-4f S7a-7b 9.S3h-4g K5a-4b 10.G4i-5h S7b-8c 11.P3g-3f S8c-8d 12.P9g-9f P9c-9d # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.S3i-4h S3a-4b 5.P5g-5f G4a-3b 6.G4i-5h P5c-5d 7.P6g-6f P7c-7d 8.G5h-6g K5a-4a 9.G6i-7h P6c-6d 10.K5i-6i S6b-6c 11.P2g-2f N8a-7c 12.P2f-2e P8d-8e 13.B8h-7i S4b-3c # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.S3i-4h S3a-4b 5.P5g-5f P5c-5d 6.G4i-5h G4a-3b 7.P6g-6f K5a-4a 8.G5h-6g G6a-5b 9.G6i-7h S4b-3c 10.K5i-6i B2b-3a 11.B8h-7i P4c-4d # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G6i-7h G4a-3b 7.K5i-6i K5a-4a 8.G4i-5h G6a-5b 9.S6h-7g P7c-7d 10.G5h-6g P6c-6d 11.B8h-7i P8d-8e 12.P3g-3f N8a-7c 13.B7i-4f S4b-5c # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.P6g-6f K5a-4a 8.G5h-6g P7c-7d 9.G6i-7h G6a-5b 10.K5i-6i S4b-3c 11.B8h-7i B2b-3a 12.P3g-3f P4c-4d 13.B7i-6h G5b-4c 14.K6i-7i B3a-4b # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.G5h-6g K5a-4a 8.G6i-7h G6a-5b 9.K5i-6i P4c-4d 10.S6h-7g S4b-3c 11.B8h-7i B2b-3a 12.P3g-3f G5b-4c # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-7b 7.P1g-1f P1c-1d 8.S3i-4h P6c-6d 9.K5i-6i S7b-6c 10.P3g-3f P3c-3d 11.P7g-7f S6c-5d 12.G4i-5i P8e-8f 13.P8gx8f R8bx8f 14.P3f-3e R8f-8b 15.N2i-3g P3dx3e # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.P6g-6f S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G4i-5h G4a-3b 7.G5h-6g K5a-4a 8.G6i-7h G6a-5b 9.K5i-6i P4c-4d 10.S6h-7g S4b-3c 11.B8h-7i B2b-3a 12.P3g-3f P7c-7d # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2h-2f S7a-7b 6.P1g-1f P1c-1d 7.P7g-7f P8e-8f 8.P8gx8f R8bx8f 9.P*8g R8f-8b 10.S3i-3h P6c-6d 11.P3g-3f P3c-3d 12.S3h-3g S7b-6c # 1.P7g-7f P3c-3d 2.P2g-2f P8c-8d 3.P2f-2e P8d-8e 4.G6i-7h G4a-3b 5.P2e-2d P2cx2d 6.R2hx2d P8e-8f 7.P8gx8f R8bx8f 8.R2dx3d B2b-3c 9.R3d-3f R8f-8d 10.R3f-2f S3a-2b 11.P*8g # 1.P7g-7f P3c-3d 2.P2g-2f P8c-8d 3.P2f-2e P8d-8e 4.G6i-7h G4a-3b 5.P2e-2d P2cx2d 6.R2hx2d P8e-8f 7.P8gx8f R8bx8f 8.R2dx3d B2b-3c # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-7b 7.P1g-1f P1c-1d 8.S3i-4h P6c-6d 9.K5i-6i P3c-3d 10.G4i-5i K5a-4b 11.P9g-9f P9c-9d 12.P7g-7f P8e-8f 13.P8gx8f R8bx8f 14.R2f-5f R8f-8b 15.P3g-3f P4c-4d # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G6i-7h G4a-3b 7.K5i-6i K5a-4a 8.G4i-5h G6a-5b 9.P6g-6f S4b-3c 10.P3g-3f P4c-4d 11.B8h-7i B2b-3a 12.G5h-6g G5b-4c # 1.P2g-2f P8c-8d 2.P2f-2e P8d-8e 3.G6i-7h G4a-3b 4.P2e-2d P2cx2d 5.R2hx2d P*2c 6.R2d-2f S7a-7b 7.P1g-1f P1c-1d 8.S3i-4h P6c-6d 9.K5i-6i P3c-3d 10.G4i-5i S3a-4b 11.P7g-7f P4c-4d 12.B8h-7g S4b-4c # 1.P7g-7f P8c-8d 2.S7i-6h P3c-3d 3.S6h-7g S7a-6b 4.P5g-5f P5c-5d 5.S3i-4h S3a-4b 6.G6i-7h G4a-3b 7.K5i-6i K5a-4a 8.G4i-5h G6a-5b 9.P6g-6f P4c-4d 10.P3g-3f S4b-3c 11.B8h-7i B2b-3a 12.G5h-6g G5b-4c # 1.P7g-7f P8c-8d 2.P2g-2f P8d-8e 3.B8h-7g P3c-3d 4.P6g-6f S7a-6b 5.S3i-4h G6a-5b 6.P2f-2e B2b-3c 7.G6i-7h G4a-3b 8.G4i-5h K5a-4a 9.K5i-6i S3a-2b 10.P3g-3f # 1.P7g-7f P8c-8d 2.P2g-2f G4a-3b 3.P2f-2e P3c-3d 4.G6i-7h P8d-8e 5.P2e-2d P2cx2d # 1.P7g-7f P8c-8d 2.P2g-2f P8d-8e 3.B8h-7g P3c-3d 4.S7i-8h G4a-3b 5.G6i-7h B2bx7g+ 6.S8hx7g S3a-4b 7.P2f-2e S4b-3c 8.S3i-4h # 1.P7g-7f P8c-8d 2.P2g-2f P8d-8e 3.B8h-7g P3c-3d 4.S7i-8h G4a-3b 5.G6i-7h B2bx7g+ 6.S8hx7g S3a-4b 7.P2f-2e S4b-3c 8.S3i-4h S7a-6b 9.P4g-4f P6c-6d 10.S4h-4g S6b-6c 11.G4i-5h G6a-5b 12.K5i-6h K5a-4b # 1.P7g-7f P8c-8d 2.P2g-2f P8d-8e 3.B8h-7g P3c-3d 4.S7i-8h G4a-3b 5.G6i-7h B2bx7g+ 6.S8hx7g S3a-4b 7.S3i-4h S4b-3c 8.P4g-4f S7a-6b 9.G4i-5h G6a-5b 10.S4h-4g K5a-4b # 1.P7g-7f P8c-8d 2.P2g-2f P8d-8e 3.B8h-7g P3c-3d 4.S7i-8h G4a-3b 5.G6i-7h B2bx7g+ 6.S8hx7g S3a-4b 7.P2f-2e S4b-3c 8.S3i-4h S7a-6b 9.P4g-4f P6c-6d 10.S4h-4g S6b-6c 11.G4i-5h G6a-5b 12.K5i-6h K5a-4b 13.P3g-3f K4b-3a 14.P1g-1f P7c-7d 15.K6h-7i K3a-2b 16.N2i-3g K2b-3a 17.K7i-8h K3a-2b # 1.P7g-7f P8c-8d 2.P2g-2f P8d-8e 3.B8h-7g P3c-3d 4.P6g-6f S7a-6b 5.S3i-4h G6a-5b 6.G4i-5h G4a-3b 7.G6i-7h B2b-3c 8.S7i-8h K5a-4a 9.G5h-6g S3a-2b # 1.P2f P8d 2.P2e P8e 3.G7h G3b 4.P2d Px2d 5.Rx2d P'2c 6.R2f S7b 7.P1f P1d 8.S3h P6d 9.P7f P8f 10.Px8f Rx8f 11.P'8g R8b 12.P3f P3d 13.S3g S6c 14.P3e Px3e 15.S4f # 1.P7f P8d 2.S6h P3d 3.S7g S6b 4.P5f S4b 5.S4h P5d 6.G4i-5h G3b 7.P6f K4a 8.G6g G5b 9.B7i S3c 10.P3f B3a 11.K6h P4d 12.K7h G5b-4c 13.K8h B6d 14.S3g P8e 15.G7h # 1.P7f P8d 2.P2f P8e 3.B7g P3d 4.S8h G3b 5.G7h Bx7g+ 6.Sx7g S2b 7.S3h S7b 8.P4f S3c 9.S4g P6d 10.G5h S6c 11.P3f P1d 12.P1f P7d 13.K6h N7c 14.P6f G6b 15.P2e R8a # 1.P7f P8d 2.S6h P3d 3.S7g S6b 4.P5f S4b 5.S4h P5d 6.G4i-5h G3b 7.P6f K4a 8.G6g P6d 9.P2f S6c 10.P2e P5e 11.Px5e Bx5e 12.G7h P7d 13.K6i S5d 14.P2d Px2d 15.Rx2d # 1.P7f P8d 2.P2f P8e 3.B7g P3d 4.S8h G3b 5.G7h Bx7g+ 6.Sx7g S4b 7.S3h S7b 8.P4f P6d 9.S4g S6c 10.G5h P1d 11.P1f P9d 12.P9f G5b 13.P3f K4a 14.S5f S5d # 1.P7f P8d 2.S6h P3d 3.S7g S6b 4.P5f S4b 5.S4h P5d 6.G4i-5h G3b 7.P6f K4a 8.G6g G5b 9.B7i S6b-5c 10.P2f P6d 11.P2e R6b 12.G7h P6e 13.Px6e Rx6e 14.P'6f R6a # 1.P7f P8d 2.S6h P3d 3.S7g S6b 4.P5f G3b 5.S4h K4a 6.G4i-5h P6d 7.G7h B3c 8.K6i S2b 9.P6f S6c 10.G5h-6g B5a 11.P3f P7d 12.B7i B7c 13.S3g S3c 14.S4f P4d 15.N3g # 1.P7f P8d 2.S6h(3) P3d 3.S7g S6b 4.S4h(1) S4b 5.P5f P5d 6.G4i-5h G3b(2) 7.P6f(2) K4a 8.G6g P7d(5) 9.G7h(11) G5b(2) 10.K6i S3c(3) 11.B7i(5) B3a(1) 12.B6h(7) P9d(26) 13.P3f(12) P9e(38) 14.K7i(55) N7c(9) 15.K8h(21) L9c(42) # 1.P7f P8d 2.S6h(1) P3d 3.S7g S6b(1) 4.S4h S4b 5.P5f P5d(3) 6.G4i-5h(1) G3b 7.P6f(1) K4a(1) 8.G6g G5b(1) 9.B7i(8) S6b-5c(55) 10.G7h(26) P6d(5) 11.P2f(7) R6b(4) 12.P2e(1) P6e(1) 13.Px6e(1) Rx6e 14.P'6f R6a 15.K6i(16) S6d(14) # 1.P7f P8d(1) 2.P2f P8e(1) 3.B7g P3d 4.S8h G3b(1) 5.G7h Bx7g+(1) 6.Sx7g S4b 7.S3h S7b 8.P4f P6d(11) 9.S4g S6c 10.P6f P4d(3) 11.G5h G5b 12.K6h(1) K4a(1) # 1.P7f P8d(1) 2.S6h(1) P3d 3.S7g S6b 4.S4h S4b 5.P5f P5d 6.G4i-5h G3b 7.P6f K4a 8.G6g P7d 9.G7h(5) G5b(5) 10.K6i(1) S3c(3) 11.B7i(2) B3a(1) 12.P3f P4d(18) # 1.P7f P8d(1) 2.P2f P8e 3.B7g P3d 4.S8h G3b(1) 5.G7h Bx7g+(1) 6.Sx7g S4b 7.S3h S7b 8.P4f P6d(3) 9.S4g(1) S6c 10.P6f(3) P4d(1) 11.G5h(2) G5b(1) 12.K6h(2) # 1.P7f P8d(1) 2.S6h P3d 3.S7g S6b(1) 4.S4h(1) S4b 5.P5f P5d 6.G4i-5h G3b(2) 7.P6f K4a(1) 8.G6g P7d(7) 9.G7h(2) G5b(1) 10.K6i(1) S3c 11.B7i B3a(3) 12.P3f # 1.P7f P8d(1) 2.S6h(1) P3d 3.S7g(1) S6b 4.P5f(1) P5d 5.S4h S4b 6.G4i-5h G3b 7.P6f(1) K4a 8.G6g(2) G5b(42) 9.P2f(15) P7d(6) 10.B7i(17) P6d(17) 11.G7h(3) S6b-5c(3) 12.P2e(4) G6c(80) 13.K6i(17) N7c(4) 14.P3f(65) P5e(50) # 1.P7f P3d(2) 2.P2f P4d 3.S4h(3) S3b(5) 4.P5f R4b 5.K6h K6b 6.K7h K7b 7.G4i-5h K8b(1) 8.P9f P9d(28) 9.S6h S7b(2) 10.P2e(6) B3c 11.P3f G4a-5b(4) 12.S3g(68) S4c(13) 13.P3e(2) Px3e(31) 14.S2f S3d(6) 15.R3h P4e(27) # 1.P7f P8d 2.P2f P8e(1) 3.B7g P3d 4.S8h G3b(2) 5.G7h Bx7g+(1) 6.Sx7g S4b 7.S3h(2) S7b(2) 8.P4f(2) S8c(3) 9.S4g(10) S8d(1) 10.P9f P9d(7) 11.P6f(9) K4a 12.P6e(13) P9e(48) 13.Px9e(143) Sx9e 14.Lx9e Lx9e 15.P'9g P'9h(53) # 1.P7f P8d(1) 2.S6h P3d 3.S7g S6b 4.P5f P5d 5.S4h S4b 6.G7h(1) G3b 7.K6i(1) K4a 8.G5h P7d(13) 9.P6f(14) S6b-5c(7) 10.P2f(53) P5e(21) 11.Px5e(41) Bx5e 12.P2e(3) S5d(5) 13.G5h-6g(14) R5b(24) 14.P2d(15) Px2d(1) 15.Rx2d P'2c(10) # 1.P7f P8d(1) 2.S6h(1) P3d 3.S7g S6b 4.P5f P5d 5.S4h S4b(1) 6.G4i-5h(2) G3b(2) 7.P6f(1) K4a 8.G6g S6b-5c(36) 9.G7h(9) P5e(28) 10.Px5e(7) Bx5e 11.P2f S5d(67) 12.P2e(6) R5b(26) 13.K6i(14) K3a(23) 14.P'5f(27) B3c(15) # 1.P7f P8d(1) 2.S6h P3d 3.S7g S6b 4.P5f P5d 5.S4h S4b 6.G4i-5h G3b 7.P6f K4a 8.G6g P7d(3) 9.G7h(8) G5b(3) 10.K6i S3c(1) 11.P3f B3a(1) 12.B7i P4d # 1.P7f P8d 2.P2f P8e 3.B7g P3d 4.S8h G3b 5.G7h Bx7g+ 6.Sx7g S2b 7.S3h S7b 8.P4f S3c 9.S4g K4b 10.G5h G5b 11.P3f S8c 12.N3g S8d 13.P9f P7d 14.P6f P7e 15.R2i P4d # 1.P7f P8d 2.S6h P3d 3.P6f S6b 4.P5f P5d 5.S4h S4b 6.G4i-5h G3b 7.G6g P7d 8.P2f P6d 9.P2e S6c 10.P2d Px2d 11.Rx2d N7c 12.R2h P'2c 13.G7h P8e 14.B7g P4d 15.P4f # 1.P2f P8d 2.P2e P8e 3.G7h G3b 4.P2d Px2d 5.Rx2d P'2c 6.R2f S7b 7.P1f P1d 8.S3h P6d 9.P7f P8f 10.Px8f Rx8f 11.P'8g R8b 12.P4f S6c 13.S4g P3d 14.S5f S5d 15.P9f # 1.P7f P8d 2.S6h P3d 3.P6f S6b 4.P5f S4b 5.S4h P5d 6.G4i-5h G3b 7.G6g P7d 8.P2f P6d 9.P2e S6c 10.P2d Px2d 11.Rx2d N7c 12.R2h P'2c 13.G7h P8e 14.B7g P4d 15.K6i # 1.P7f P8d 2.P2f P8e 3.B7g P3d 4.S8h G3b 5.G7h Bx7g+ 6.Sx7g S2b 7.S3h S3c 8.P4f S7b 9.S4g K4b 10.G5h G5b 11.P6f S8c 12.P3f S8d 13.P9f P7d 14.N3g P4d 15.R2i S7c # 1.P7f P3d 2.P6f P3e 3.P5f R3b 4.S4h S4b 5.K6h K6b 6.K7h K7b 7.P9f P4d 8.G4i-5h S4c 9.G6g P1d 10.B7g K8b 11.K8h L9b 12.S7h K9a 13.P8f S8b 14.S8g R3d 15.G7h B1c # 1.P7f P3d(4) 2.P2f P4d 3.P2e B3c 4.S4h S3b(3) 5.P5f R4b(2) 6.K6h K6b 7.K7h K7b 8.G4i-5h(6) K8b(11) 9.P9f(2) S4c(20) 10.S5g(14) G4a-5b(16) 11.P8f(4) P6d(4) 12.K8g(9) L9b(51) 13.S7h K9a 14.P3f(69) S8b(1) 15.S4f G7a(42) # 1.P7f P8d 2.S6h P3d 3.S7g S6b 4.P5f P5d 5.S4h S4b 6.G4i-5h G3b 7.P6f K4a 8.G6g P7d 9.G7h(4) G5b(2) 10.K6i S3c 11.B7i B3a 12.P3f(1) P4d 13.B6h(23) # 1.P7f P3d(1) 2.P2f P8d(1) 3.P2e P8e 4.G7h G3b 5.P2d Px2d 6.Rx2d P8f(4) 7.Px8f Rx8f 8.Rx3d(3) Bx8h+(34) 9.Sx8h Rx7f 10.N7g(24) G3c(47) 11.R8d(11) P'8b(5) 12.K5h(33) R2f(9) 13.P'2h K5b 14.G3h(3) G7b(2) 15.P2g R2b 16.R8f(1) P8c(5) # 1.P2f P8d(2) 2.P2e P8e 3.G7h(2) G3b 4.P2d Px2d 5.Rx2d P'2c(8) 6.R2f S7b 7.P1f(6) P1d(1) 8.P9f(7) P6d(9) 9.S3h(39) S6c(6) 10.P7f(2) P8f(3) 11.Px8f Rx8f 12.N7g P9d(28) 13.K4h(5) S4b(21) 14.B9g(55) R8b(112) 15.P7e(1) P3d(1) # 1.P7f G3b(6) 2.P5f(8) P5d(9) 3.R5h(2) S6b(7) 4.P5e(1) Px5e(1) 5.Bx5e K4a 6.B7g P3d(2) 7.P6f P'5e(20) 8.S6h S5c 9.S6g S5d 10.K4h S4b(3) 11.K3h R5b(13) 12.R8h(16) P4d(22) 13.P8f P4e 14.P8e R8b 15.K2h(21) K3a 16.P7e(22) B4d(6) # 1.P7f P8d(1) 2.S6h P3d(1) 3.P6f S6b(2) 4.P5f P5d 5.S4h(2) S4b(2) 6.G4i-5h G3b(2) 7.G6g(1) K4a(8) 8.G7h(3) G5b(5) 9.K6i(1) S3c(1) 10.S7g(1) B3a(1) 11.B7i(2) P4d(2) 12.P3f(5) P7d(15) 13.B6h(14) P9d(32) # 1.P7f P8d 2.P2f(3) P8e(2) 3.B7g P3d 4.S8h G3b(1) 5.G7h(1) Bx7g+(8) 6.Sx7g S4b 7.S3h S7b(1) 8.P4f(2) K4a(17) 9.S4g(1) S8c(3) 10.P3f(2) S8d(1) 11.P9f(6) P9d(5) 12.G5h(2) K3a(9) 13.N3g(2) G5b(8) 14.P4e(20) # 1.P7f P8d(2) 2.S6h P3d(1) 3.P6f S6b(2) 4.P5f P5d(1) 5.S4h S4b 6.G4i-5h G3b(1) 7.G6g(1) K4a(1) 8.G7h(3) G5b(1) 9.K6i S3c 10.S7g(1) B3a(1) 11.B7i P4d(5) 12.P3f(2) P7d(3) 13.B6h(26) G5b-4c(18) 14.K7i(4) P8e(3) # 1.P7f P8d 2.S6h(6) P3d 3.P6f(1) S6b 4.P5f(2) P5d 5.G4i-5h(1) S4b(1) 6.S4h(2) G3b(2) 7.G6g(4) K4a 8.G7h(4) G5b(6) 9.K6i(3) S3c(4) 10.S7g(3) B3a(2) 11.B7i(6) P4d 12.P3f(3) G5b-4c(3) 13.B6h(1) P7d(26) 14.K7i(2) # 1.P2f P8d 2.P2e P8e 3.G7h G3b 4.P2d Px2d 5.Rx2d P'2c 6.R2f S7b 7.P1f P1d 8.S3h P3d 9.K5h P9d 10.P3f B4d 11.P3e Bx3e 12.R5f S4b 13.P7f B4d 14.Bx4d Px4d 15.N7g # 1.P7f P8d 2.S6h P3d 3.P6f S6b 4.P5f P6d 5.G7h S6c 6.G5h P6e 7.S7g Px6f 8.Sx6f P8e 9.G5h-6g P8f 10.Px8f Rx8f 11.S7e R8b 12.P'8d P'6d 13.Bx2b+ Sx2b 14.G7h-7g # 1.P2f P8d 2.P2e P8e 3.G7h G3b 4.P2d Px2d 5.Rx2d P'2c 6.R2h P8f 7.Px8f Rx8f 8.P'8g R8d 9.S3h S7b 10.P7f P9d 11.P9f P1d 12.P4f R7d 13.G7g R2d 14.P'2e R8d # 1.P7f P8d 2.S6h P3d 3.S7g S6b 4.S4h S4b 5.P5f P5d 6.G4i-5h G3b 7.P6f P6d 8.G6g S6c 9.P2f P5e 10.Px5e Bx5e 11.P2e B2b 12.G7h K4a 13.K6i P7d 14.S5g S5d 15.P2d # 1.P7f(1) P8d(1) 2.P5f(3) P8e(5) 3.B7g P5d 4.R8h(1) P3d(2) 5.S6h S6b 6.K4h P7d(20) 7.P6f(9) K4b(2) 8.K3h K3b 9.K2h G6a-5b 10.G6i-5h(6) S5c 11.S5g(13) B3c(5) 12.L1h(3) K2b 13.K1i S3b 14.S2h P1d(3) 15.G3i(1) P2d 16.G6g(24) # 1.P7f P3d(1) 2.P2f P4d 3.P2e B3c 4.S4h S4b(5) 5.P5f(1) R5b(1) 6.K6h K6b 7.K7h K7b(1) 8.G4i-5h K8b(2) 9.P3f(10) S4c(5) 10.P4f(4) G3b(4) 11.S5g(2) L9b(2) 12.N3g(44) R5a(12) 13.P9f(7) P5d(5) 14.P9e(12) K9a 15.B6f(3) S8b(1) # 1.P7f(1) P8d(1) 2.S6h(6) P3d(1) 3.P6f S6b 4.G4i-5h S4b(1) 5.S4h P5d 6.G6g(1) G3b(1) 7.P5f(2) K4a 8.S7g P7d 9.G7h(2) G5b 10.B7i S3c 11.K6i(3) B3a 12.P3f(6) P4d(10) 13.B6h(12) G5b-4c(13) 14.K7i B6d 15.N3g(5) K3a(1) 16.K8h # 1.P7f P3d(1) 2.P2f P4d 3.S4h S4b(3) 4.P5f P5d 5.K6h(3) S6b(4) 6.K7h(2) P7d(1) 7.S6h(2) R7b(7) 8.G4i-5h(6) P7e(6) 9.Px7e(2) Rx7e 10.S7g N7c(5) 11.P'7f(7) R7d 12.P6f N8e(4) 13.S8f(11) Rx7f(7) 14.K6g(8) R7b(1) 15.Sx8e # 1.P7f P8d(1) 2.P5f(2) P3d(8) 3.P6f(2) S6b 4.S6h P5d 5.R5h(1) K4b(2) 6.K4h K3b 7.K3h G6a-5b(6) 8.K2h(1) S5c(2) 9.L1h(2) B3c 10.K1i K2b 11.S5g P4d(1) 12.S4f(29) G4c(2) 13.P5e(1) P4e(14) 14.Sx4e(1) Px5e 15.S3f(6) S3b(6) # 1.P7f P3d 2.P2f P4d 3.S4h S4b(5) 4.P5f P5d 5.G4i-5h G6a-5b(3) 6.S6h(2) S6b 7.S7g S3c 8.K6h K4b 9.K7h K3b 10.P6f B3a 11.G6g P7d 12.B7i S7c 13.S5g(1) G4c # 1.P2f P8d(1) 2.P2e P8e 3.G7h G3b 4.P2d Px2d 5.Rx2d P'2c 6.R2f S7b 7.P1f(2) P3d(3) 8.P1e(3) P6d(1) 9.R3f(22) G3c(3) 10.S3h(25) S6c(5) 11.P7f(1) P8f(2) 12.Px8f Rx8f 13.P'8g(2) R8b(10) 14.R2f S5d(3) 15.P3f G3b(1) 16.N3g B4d(3) # 1.P7f(1) P8d 2.S6h P3d 3.P6f S6b 4.G4i-5h(1) S4b 5.S4h G3b 6.G6g K4a 7.G7h P5d 8.K6i G5b 9.P5f(1) P4d(1) 10.S7g S3c 11.B7i B3a 12.P3f P7d(10) # 1.P2f P8d(1) 2.P2e(1) P8e 3.G7h(2) G3b 4.P2d Px2d 5.Rx2d P'2c 6.R2f S7b 7.P9f(1) P1d(1) 8.P7f P8f(5) 9.Px8f Rx8f 10.N7g S4b(1) 11.K4h(1) P9d(3) 12.S3h(1) K4a(2) 13.B9g(13) R8b(6) 14.P7e P3d(2) 15.R8f(5) P'8e(13) # 1.P7f P8d 2.P2f(1) P8e(1) 3.B7g P3d(1) 4.S8h G3b(3) 5.G7h Bx7g+ 6.Sx7g S4b 7.S3h(1) S7b(2) 8.P4f(1) P6d(1) 9.S4g S6c 10.P6f(3) P4d(2) 11.G5h(3) G5b(3) 12.K6h(1) K4a(3) 13.K7i(1) K3a(2) 14.P3f(1) P7d(5) 15.S5f(4) S5d(1) 16.P9f # 1.P7f P8d(1) 2.S6h(1) P3d 3.S7g S6b 4.P5f(1) P5d 5.S4h S4b 6.G4i-5h(2) G3b 7.P6f K4a 8.G6g P7d(5) 9.G7h(10) G5b 10.K6i(1) S3c(3) 11.B7i(6) B3a(1) 12.P3f(1) P4d(1) 13.B6h(26) G5b-4c(13) 14.K7i(3) B6d(8) 15.N3g(2) K3a # 1.P7f P8d(1) 2.S6h(2) P3d(1) 3.S7g S6b(1) 4.S4h P5d(1) 5.P5f S4b 6.G4i-5h(6) G3b(2) 7.P6f(2) K4a(3) 8.G6g P7d(2) 9.G7h(5) G5b(2) 10.K6i S3c 11.B7i(2) B3a(7) 12.P3f(10) P4d(4) 13.S3g(9) B6d(17) 14.B6h(10) G5b-4c(8) 15.K7i(4) # 1.P7f P8d 2.S6h(2) P3d(1) 3.S7g S6b 4.P5f(1) P5d 5.S4h(1) S4b 6.G4i-5h(1) G3b(2) 7.P6f(1) K4a 8.G6g P7d(5) 9.G7h(5) G5b 10.K6i(2) S3c(3) 11.B7i(3) B3a 12.P3f(1) P4d(6) 13.B6h(5) G5b-4c(14) 14.K7i(1) S7c(7) 15.K8h(22) P9d(8) # 1.P7f P8d(1) 2.P2f P8e(1) 3.B7g P3d(1) 4.S8h G3b 5.G7h Bx7g+(4) 6.Sx7g S4b 7.S3h S7b(2) 8.P4f P6d(1) 9.S4g S6c 10.P6f P4d(2) 11.G5h(1) G5b 12.K6h K4a # 1.P7f P8d 2.S6h(2) P3d(1) 3.S7g S6b(1) 4.P5f(1) P5d 5.S4h S4b(1) 6.G4i-5h G3b 7.P6f K4a 8.G6g P7d(2) 9.G7h(6) G5b(6) 10.K6i(2) S3c(6) 11.B7i(3) B3a(1) 12.P3f(7) P4d(1) 13.B6h(11) P9d(13) 14.K7i(49) P9e(11) 15.K8h(11) L9c(21) # 1.P7f P8d 2.S6h(1) P3d 3.S7g S6b(1) 4.S4h P5d 5.P5f S4b(1) 6.G4i-5h G3b(1) 7.P6f K4a(1) 8.G6g P7d(4) 9.G7h(20) G5b(8) 10.K6i S3c 11.B7i B3a(2) 12.P3f P4d(3) 13.B6h(4) G5b-4c(20) 14.K7i(2) B6d(4) 15.N3g(2) K3a(4) 16.K8h(9) # 1.P7f P8d 2.S6h P3d 3.S7g S6b 4.S4h P5d 5.P5f S4b 6.G4i-5h G3b 7.P6f K4a 8.G6g P7d 9.G7h S3c 10.K6i G5b 11.B7i B3a 12.P3f P4d 13.S3g B6d # 1.P7f P8d 2.S6h P3d 3.S7g S6b 4.P5f G3b 5.S4h K4a 6.G4i-5h G5b 7.P6f P6d 8.P2f S4b 9.G6g P7d 10.G7h S6c 11.K6i N7c 12.P2e S3c 13.B7i P8e 14.P3f P5d 15.S3g # 1.P7f P8d 2.P2f P8e 3.B7g P3d 4.S8h G3b 5.G7h Bx7g+ 6.Sx7g S4b 7.S3h S7b 8.P4f P6d 9.S4g S6c 10.G5h G5b 11.K6h K4a 12.S5f S5d 13.P6f P4d 14.P3f P7d 15.K7i K3a 16.N3g P1d 17.P1f G5b-4c # 1.P7f P8d 2.P2f P8e 3.B7g P3d 4.S8h G3b 5.G7h Bx7g+ 6.Sx7g S4b 7.S3h S7b 8.P4f S3c 9.S4g K4b 10.G5h S8c 11.P6f S8d 12.P9f P7d # 1.P7f P3d 2.P2f P4d 3.P2e B3c 4.S4h S3b 5.P5f R4b 6.K6h K6b 7.K7h K7b 8.G4i-5h G4a-5b 9.P9f P9d 10.S5g K8b 11.P8f S4c 12.K8g S7b 13.S7h P6d 14.S6f G6c # 1.P2f(1) P8d 2.P2e(1) P8e 3.G7h G3b 4.P2d(1) Px2d 5.Rx2d P'2c 6.R2f S7b(3) 7.S3h(2) P6d(12) 8.P1f(8) P1d(17) 9.P7f(3) P8f(7) 10.Px8f(2) Rx8f 11.P'8g(15) R8b(20) 12.P4f(5) S6c(3) 13.S4g(2) S5d(4) 14.S5f(3) P3d 15.G4h(21) G5b(2) # 1.P7f P8d(1) 2.S6h(1) P3d 3.S7g S6b 4.P5f(1) P5d(1) 5.S4h S4b(1) 6.G4i-5h(1) G3b(2) 7.P6f(1) K4a(1) 8.G6g P7d(7) 9.G7h(10) S6b-5c(28) 10.P2f(13) P5e(3) 11.Px5e(11) Bx5e(1) 12.P2e S5d(1) 13.P2d(7) Px2d(4) 14.Rx2d P'2c(1) 15.R2h # 1.P7f P8d(1) 2.S6h P3d 3.P6f(1) S6b(1) 4.P5f(2) P5d(1) 5.S4h(1) S4b(1) 6.G4i-5h(2) G3b(5) 7.G6g(1) K4a(1) 8.G7h(5) G5b(15) 9.K6i(1) S3c 10.S7g(1) B3a 11.B7i(1) P4d 12.P3f(2) P7d(5) 13.B6h(29) G5b-4c(12) 14.K7i(8) B6d(3) # 1.P7f P8d 2.S6h(1) P3d 3.P6f S6b(3) 4.P5f P5d(1) 5.S4h(1) S4b(1) 6.G4i-5h(2) G3b 7.G6g(1) K4a(1) 8.G7h G5b(4) 9.K6i(1) S3c(3) 10.S7g(1) B3a(1) 11.B7i(1) P4d(5) 12.P3f G5b-4c(3) 13.S3g(39) P8e(28) 14.P3e(97) Px3e(7) 15.Bx3e P4e(1) # 1.P7f(1) P8d(1) 2.S6h(3) P3d 3.P6f(1) S6b 4.P5f P5d 5.S4h(2) S4b 6.G4i-5h(2) G3b 7.G6g(3) K4a 8.G7h(4) G5b(3) 9.K6i(4) S3c(1) 10.S7g(1) B3a(2) 11.B7i(2) P4d 12.P3f(2) G5b-4c(9) 13.B6h(3) P7d(19) 14.K7i(2) B6d(6) 15.S3g(25) K3a(36) # 1.P7f P8d(2) 2.P2f G3b(2) 3.G7h(2) P8e(5) 4.B7g(2) P3d 5.S8h Bx7g+(3) 6.Sx7g S4b(1) 7.S3h S7b(2) 8.P4f(2) P6d(15) 9.S4g(8) S6c 10.P6f(9) P1d(26) 11.P1f(11) P9d(3) 12.P9f(5) S5d 13.S5f(1) P4d(4) 14.G5h(35) G5b(8) 15.K6h(10) K4a(2) # 1.P7f(1) P8d 2.S6h(2) P3d 3.P6f S6b(1) 4.P5f(1) P5d 5.S4h(2) S4b 6.G4i-5h(4) G3b 7.G6g(1) K4a(1) 8.G7h(3) G5b(1) 9.K6i(1) S3c(2) 10.S7g(2) B3a(2) 11.B7i(1) P4d 12.P3f(2) G5b-4c(9) 13.B6h(3) B6d(26) 14.S3g(11) P7d(3) 15.K7i(5) K3a(1) # 1.P7f(2) P8d(1) 2.G7h(5) G3b(11) 3.B7g(15) P3d(5) 4.S6h(3) S6b(2) 5.S4h(4) P6d(4) 6.P4f(1) S6c(7) 7.S4g(1) S5d(10) 8.S5f(4) G5b(9) 9.G5h(9) K4a(2) 10.K6i(5) Bx7g+(18) 11.Sx7g(1) S4b 12.P6f(10) P4d(4) 13.K7i(1) K3a(3) # # 31-st Oi Title Match, 1-st game, July 12-th and 13-th 1990. # Black: Tanigawa, Oi; White: Sato, 5-dan 1.P2f P8d 2.P2e P8e 3.G7h G3b 4.P2d Px2d 5.Rx2d P'2c 6.R2f S7b 7.P1f P1d 8.S3h P6d 9.P7f P8f 10.Px8f Rx8f 11.P'8g R8b 12.P3f P3d 13.S3g S6c 14.P3e Px3e 15.S4f S5d 16.K5h Bx8h+ 17.Sx8h S2b 18.P'3d G5b 19.G3h P4d 20.P7e K4b 21.Sx3e S4c 22.N7g P'3c 23.Px3c+ Sx3c 24.P7d Px7d 25.P'7b Rx7b 26.B'8c R7c 27.B6a+ G5a 28.N8e Gx6a 29.Nx7c+ Nx7c 30.R'8a S5b 31.Rx9a+ N6e 32.G4h B'3i 33.G6h P'3d 34.S4f N'7f 35.G6i Nx8h+ 36.L'6c +N7h 37.Gx7h S'6i 38.Kx6i Bx4h+ 39.R2h B'5h 40.K7i +B5i 41.Lx6a+ +B6i 0-1 # # 31-st Oi Title Match, 2-nd game, July 23-rd and 24-th 1990. # Black: Sato, 5-dan; White: Tanigawa, Oi 1.P7f P8d 2.S6h P3d 3.S7g S6b 4.P5f S4b 5.S4h P5d 6.G4i-5h G3b 7.P6f K4a 8.G6g G5b 9.B7i S3c 10.P3f B3a 11.K6h P4d 12.K7h G5b-4c 13.K8h B6d 14.S3g P8e 15.G7h P7d 16.S4f K3a 17.N3g S5c 18.P1f P1d 19.P2f K2b 20.R5h B7c 21.P5e Px5e 22.Sx5e P'5d 23.S4f S6d 24.R3h S2d 25.L1g S5e 26.S5g N3c 27.P4f P3e 28.P2e Nx2e 29.Nx2e Sx2e 30.Px3e S2f 31.P6e Sx1g+ 32.P'5f +S2g 33.R3i N'8f 34.Px5e Nx7h+ 35.Kx7h P'3f 36.Px5d P3g+ 37.R5i L'8c 38.S5g-6h +P4h 39.R5g P8f 40.Px8f Lx8f 41.Sx8f Rx8f 42.P'8g S'6i 43.K8h R8b 44.P5c+ G'4g 45.+Px4c Gx5g 46.+Px3b Kx3b 47.G'7g +P5h 48.Sx5g R'3h 49.S6h +Px6h 50.Gx6h Bx4f 51.P'5h Sx5h+ 52.L'3d K4c 53.L3c+ K5c 54.S'4g +Sx6h 55.Sx3h +Sx7i 56.R'5f S'5e 57.Rx4f Sx4f 58.B'7a K5d 59.Bx8b+ G'7h 60.Gx7h +Sx7h 61.Kx7h B'5f 62.K7g B6g+ 0-1 # # 31-st Oi Title Match, 3-rd game, August 9-th and 10-th 1990. # Black: Tanigawa, Oi; White: Sato, 5-dan 1.P7f P8d 2.P2f P8e 3.B7g P3d 4.S8h G3b 5.G7h Bx7g+ 6.Sx7g S2b 7.S3h S7b 8.P4f S3c 9.S4g P6d 10.G5h S6c 11.P3f P1d 12.P1f P7d 13.K6h N7c 14.P6f G6b 15.P2e R8a 16.N3g K4b 17.S5f K3a 18.K7i S5d 19.K8h P6e 20.P3e P4d 21.P4e B'6d 22.R2g Px6f 23.P2d Px2d 24.Px3d Sx3d 25.Px4d P8f 26.Sx8f P'3f 27.Rx2d S2c 28.Rx2c+ Gx2c 29.P4c+ Sx4c 30.B'4e R'2h 31.Bx8a+ Rx5h+ 32.+Bx3f +Rx5g 33.P'4d G'6h 34.R'2h Gx7h 35.Kx7h +Rx5f 36.G'4b Kx4b 37.Px4c+ K5a 38.S'5b Gx5b 39.+Px5b Kx5b 40.S'4c 1-0 # # 31-st Oi Title Match, 4-th game, August 23-rd and 24-th 1990. # Black: Sato, 5-dan; White: Tanigawa, Oi 1.P7f P8d 2.S6h P3d 3.S7g S6b 4.P5f S4b 5.S4h P5d 6.G4i-5h G3b 7.P6f K4a 8.G6g P6d 9.P2f S6c 10.P2e P5e 11.Px5e Bx5e 12.G7h P7d 13.K6i S5d 14.P2d Px2d 15.Rx2d P'2c 16.R2h B2b 17.S5g S5c 18.S7g-6h G5b 19.K7i G6c 20.P3f P8e 21.B7g N7c 22.P'5f P1d 23.P9f P9d 24.S4f S4d 25.P1f P'5e 26.Px5e S4dx5e 27.P'5f Sx4f 28.Px4f P8f 29.Px8f P'8e 30.Px8e Nx8e 31.B8f P6e 32.P'8c R9b 33.S5g Px6f 34.Gx6f P'6e 35.P'6d G6b 36.G5e Sx5e 37.Px5e Bx5e 38.P8b+ Rx8b 39.S'7a S'7g 40.Nx7g Nx7g+ 41.Bx7g Bx7g+ 42.Gx7g G'8i 43.K6i R8h+ 44.Rx8h Gx8h 45.K5h R'2h 46.N'4h P'5f 47.Sx6b+ Px5g+ 48.Kx5g K3a 49.S'4a B'6h 50.K5f Bx7g+ 51.Sx3b+ Kx3b 52.S'4a Kx4a 53.G'4b 1-0 # # 31-st Oi Title Match, 5-th game, August 30-th and 31-st 1990. # Black: Tanigawa, Oi; White: Sato, 5-dan 1.P7f P8d 2.P2f P8e 3.B7g P3d 4.S8h G3b 5.G7h Bx7g+ 6.Sx7g S4b 7.S3h S7b 8.P4f P6d 9.S4g S6c 10.G5h P1d 11.P1f P9d 12.P9f G5b 13.P3f K4a 14.S5f S5d 15.K6h P4d 16.P6f P7d 17.K7i K3a 18.N3g N7c 19.P2e P6e 20.Px6e P7e 21.P2d Px2d 22.P'2e Px2e 23.Px7e Nx6e 24.Sx6e Sx6e 25.Rx2e B'4c 26.P'2b P'2d 27.Px2a+ Kx2a 28.Rx2d P'2c 29.R2h P'7f 30.S6h S6f 31.N'5f P8f 32.Px8f P'8h 33.Nx4d Px8i+ 34.K6i S'7g 35.Nx3b+ Bx3b 36.N'4d Sx7h+ 37.K5i N'2d 38.Nx3b+ Kx3b 39.K4i N'4d 40.S5i N4dx3f 41.R2e +S6i 42.P'3c Sx3c 43.N4e N'4a 44.P'3g +Sx5i 45.Gx5i P'4d 46.Px3f Px4e 47.B'6e S'5d 48.Bx5d Px5d 49.B'6d B'4g 50.G4h Bx3f+ 51.G'3a K2b 52.Gx4a N'5c 53.S'3a K2a 54.P'2b K3b 55.Bx8b+ +Bx2e 56.N'4d Sx4d 57.R'4b K3c 58.Rx4d+ Kx4d 59.N'5f 1-0 # # 31-st Oi Title Match, 6-th game, September 10-th and 11-th 1990. # Black: Sato, 5-dan; White: Tanigawa, Oi 1.P7f P8d 2.S6h P3d 3.S7g S6b 4.P5f S4b 5.S4h P5d 6.G4i-5h G3b 7.P6f K4a 8.G6g G5b 9.B7i S6b-5c 10.P2f P6d 11.P2e R6b 12.G7h P6e 13.Px6e Rx6e 14.P'6f R6a 15.P3f S6d 16.P2d Px2d 17.Bx2d P'2c 18.B4f P4d 19.B3g P4e 20.K6i K3a 21.S5g S4c 22.K7i P9d 23.P9f G5b-4b 24.P1f P5e 25.P4f Px5f 26.Sx5f Px4f 27.Bx4f P'5e 28.S4g P'4e 29.B6h P'6e 30.P'2d Px2d 31.P'2e Px2e 32.P'2d B4d 33.Px6e Sx6e 34.P'6f S6e-5d 35.Rx2e P'2b 36.N3g N9c 37.R2h N8e 38.P'4f Nx7g+ 39.G6gx7g Px4f 40.Sx4f S'5f 41.P'4e B5c 42.K8h P'6e 43.Px6e P'6f 44.Gx6f S5dx6e 45.Gx6e Rx6e 46.P'6f R6c 47.Sx5e G'6g 48.P'5d Gx7h 49.Kx7h G'6g 50.K8h Gx6h 51.Px5c+ Rx5c 52.P'5d Sx5d 53.S'4d Sx5e 54.Sx5c+ B'7i 55.K9h Gx5c 56.B'8f P'5b 57.R'6a P'4a 58.Bx6h Bx6h+ 59.Rx6h B'4f 60.G'5a K4b 61.Gx4a K3c 62.N'2e Kx2d 63.G'1e K2c 64.P'2d K1b 65.G4b Bx6h+ 66.Rx2a+ 1-0 # # 31-st Oi Title Match, 7-th game, September 20-th and 21-st 1990. # Black: Sato, 5-dan; White: Tanigawa, Oi 1.P7f P8d 2.S6h P3d 3.S7g S6b 4.P5f G3b 5.S4h K4a 6.G4i-5h P6d 7.G7h B3c 8.K6i S2b 9.P6f S6c 10.G5h-6g B5a 11.P3f P7d 12.B7i B7c 13.S3g S3c 14.S4f P4d 15.N3g P8e 16.P2f S5d 17.P5e S4c 18.B6h G5b 19.K7i B8d 20.R3h S2d 21.P1f P1d 22.K8h N7c 23.N2e P6e 24.Px6e Nx6e 25.S6f P'6d 26.P9f P9d 27.L1g G5b-4b 28.R1h K3a 29.P3e Px3e 30.P1e Px1e 31.P'1c Lx1c 32.Sx3e Sx2e 33.Px2e P'3d 34.S4f P9e 35.Px9e P'9g 36.Lx9g P4e 37.Sx4e Bx6f 38.Gx6f S'5g 39.G6f-6g Sx6h+ 40.Rx6h P'9f 41.Lx9f N'8d 42.K9h Nx9f 43.B'7c R9b 44.S'9g P7e 45.Sx9f Px7f 46.Bx6d+ P7g+ 47.Nx7g Nx7g+ 48.G6gx7g P'7f 49.Gx7f N'8d 50.+B7c Rx9e 51.R6a+ P'4a 52.Sx9e Lx9e 53.K8i Nx7f 54.+Bx9e S'9g 55.S'7g B'5g 56.P'9h L'8h 57.Sx8h Sx8h+ 58.Gx8h S'9g 0-1 # # 32-nd Oi Title Match, 1-st game, 11-th and 12-th July 1991. # Black: Tanigawa Koji, Oi; White: Nakada Hiyoki, challenger. 1.P7f P8d 2.S6h(3) P3d 3.S7g S6b 4.S4h(1) S4b 5.P5f P5d 6.G4i-5h G3b(2) 7.P6f(2) K4a 8.G6g P7d(5) 9.G7h(11) G5b(2) 10.K6i S3c(3) 11.B7i(5) B3a(1) 12.B6h(7) P9d(26) 13.P3f(12) P9e(38) 14.K7i(55) N7c(9) 15.K8h(21) L9c(42) 16.P3e(22) Px3e(27) 17.Bx3e S4d(35) 18.B4f(27) S4e(6) 19.B6h(6) R9b 20.S8f(8) N8e(8) 21.R3h(42) P'3c(6) 22.S5g(25) Nx9g+(21) 23.Sx9g(3) P9f 24.S8f(38) P8e(80) 25.N'8d(2) R9a 26.P'9b R7a 27.S9e(6) S7c(40) 28.R3e(17) Lx9e(5) 29.Bx9e S'4d(1) 30.R3h(18) P9g+(4) 31.Lx9g P'9d 32.B5i Sx8d 33.L'4f Sx4f(9) 34.Px4f P7e(2) 35.P4e(9) S5c(2) 36.B3g(9) P6d(5) 37.B2f Px7f(1) 38.P5e(1) P8f(15) 39.Px8f(3) P'8g 40.K7i R7c 41.Px5d(26) Sx5d(14) 42.P'5c(3) Bx5c 43.P'7d R8c(1) 44.Bx5c+ Rx5c 45.B'2f R8c(4) 46.B7a+(4) N'5e 47.G6g-6h(3) N4g+(3) 48.R1h +Nx5g(5) 49.Gx5g L'7g 50.Nx7g(6) Px7g+ 51.Gx7g P'5f(14) 52.Gx5f(3) B'4g 53.G5g S'8h 54.Resigns(2) # # 32-nd Oi Title Match, 2-nd game, 22-nd and 23-rd July 1991. # Black: Nakada Hiyoki, challenger; White: Tanigawa Koji, Oi. 1.P7f P8d 2.S6h(1) P3d 3.S7g S6b(1) 4.S4h S4b 5.P5f P5d(3) 6.G4i-5h(1) G3b 7.P6f(1) K4a(1) 8.G6g G5b(1) 9.B7i(8) S6b-5c(55) 10.G7h(26) P6d(5) 11.P2f(7) R6b(4) 12.P2e(1) P6e(1) 13.Px6e(1) Rx6e 14.P'6f R6a 15.K6i(16) S6d(14) 16.P2d(4) Px2d 17.Bx2d P'2c(3) 18.B4f P5e(39) 19.S5g(34) S4b-5c(15) 20.P3f(11) S5d(6) 21.N3g(50) P4d(38) 22.K7i(14) P1d(41) 23.K8h(58) P4e(31) 24.Bx5e(1) S6dx5e 25.Px5e Bx5e 26.P4f P'5c 27.P3e(84) P7d(66) 28.G5f(26) B7c(30) 29.P'5e(7) Sx5e(16) 30.Gx5e Bx5e 31.P'5d(22) B'3i(23) 32.Nx4e(44) Px5d(8) 33.P'5c(10) G5a 34.R2g(16) K3a(11) 35.Px3d(1) G'3f 36.S5f B3ix6f+ 37.Sx5e(11) +Bx5e 38.P'2b(13) Gx2g(5) 39.Px2a+ Kx2a 40.S'3c(6) R'3h(2) 41.Sx3b+ K1b 42.G'4h S'7i(13) 43.Kx7i(1) +Bx4f(4) 44.S'5g(1) +Bx5g(10) 45.Gx5g S'6i 46.N'5h Sx7h+(20) 47.Kx7h G'6g 48.Gx6g(1) Rx5h+ 49.K7i Resigns # # 32-nd Oi Title Match, 3-rd game, 6-th and 7-th August 1991. # Black: Tanigawa Koji, Oi; White: Nakada Hiyoki, challenger. 1.P7f P8d(1) 2.P2f P8e(1) 3.B7g P3d 4.S8h G3b(1) 5.G7h Bx7g+(1) 6.Sx7g S4b 7.S3h S7b 8.P4f P6d(11) 9.S4g S6c 10.P6f P4d(3) 11.G5h G5b 12.K6h(1) K4a(1) 13.K7i K3a 14.P3f(2) P7d(3) 15.S5f(1) S5d 16.P9f(17) P9d(19) 17.N3g(13) P1d(16) 18.P1f(4) S3c(68) 19.R4h(29) P3e(43) 20.Px3e(37) S2d 21.P3d S3e(16) 22.G4g(10) Sx2f(35) 23.R2h(58) S3e(29) 24.N2e(36) G5b-4c(66) 25.P1e(7) P2d(3) 26.P3c+(1) Nx3c 27.Nx3c+ G4cx3c 28.Px1d P'1b(4) 29.P'3d(25) Gx3d(62) 30.B'7a(8) R5b 31.P'3f Sx4f 32.Gx4f B'3g 33.G3e(23) Gx3e 34.S'6a R9b(12) 35.Rx2d P'2c(5) 36.R2i(19) G3d(3) 37.Bx5c+ N'4b 38.P'4c(13) Gx4c(3) 39.+Bx4c(2) Sx4c 40.Rx2c+ G'3b(3) 41.G'2b Gx2b 42.+Rx4c G'3c(9) 43.+R8c(1) K3b(1) 44.P'4c(8) K2c(19) 45.Px4b+(1) Rx4b 46.S'3a(4) R3b(1) 47.Sx2b+ Rx2b 48.P'2e(1) Gx2e(2) 49.N'3e(3) K2d(2) 50.+Rx3c Kx3c 51.G'4c Resigns # # 32-nd Oi Title Match, 4-th game, 19-th and 20-th August 1991. # Black: Nakada Hiyoki, challenger; White: Tanigawa Koji, Oi. 1.P7f P8d(1) 2.S6h(1) P3d 3.S7g S6b 4.S4h S4b 5.P5f P5d 6.G4i-5h G3b 7.P6f K4a 8.G6g P7d 9.G7h(5) G5b(5) 10.K6i(1) S3c(3) 11.B7i(2) B3a(1) 12.P3f P4d(18) 13.B6h(41) G5b-4c(3) 14.K7i B6d(7) 15.N3g(5) K3a(2) 16.K8h(1) P8e(7) 17.P2f(3) K2b(5) 18.R3h(2) S5c(7) 19.P1f(45) P1d(21) 20.P9f(44) P9d(13) 21.S5g B7c(18) 22.S4f(1) S2d(17) 23.L1h(6) P9e(24) 24.Px9e(16) Lx9e 25.P'9g(16) S4b(25) 26.N2e(8) N3c(17) 27.P5e(57) Px5e(40) 28.P3e(1) Px3e 29.P1e Px1e(1) 30.Sx3e Sx3e 31.Rx3e(24) P'3d(5) 32.R3i Nx2e(15) 33.Px2e P5f 34.Lx1e(29) Lx1e(18) 35.N'1d(1) K3c 36.B1c+(1) S5c(1) 37.S'4a(81) B2h+(16) 38.R5i(2) L'5d(5) 39.P'5b(25) G4c-4b(42) 40.P5a+(1) P5g+(11) 41.Gx5g(1) S'4h 42.Sx3b+(24) Gx3b 43.R5h(3) Lx5g+(4) 44.P'5d Sx5d 45.Rx4h(1) +Lx4h 46.G'5c P3e(3) 47.+Bx3e(11) G'3d 48.+B1c(4) P'1b(13) 49.S'2b(4) Gx2b 50.Nx2b+ Px1c 51.G'3b Rx3b 52.+Nx3b Kx3b 53.R'5b K2a 54.Gx5d P'3b(3) 55.G4c(2) G'3c 56.S'4a(2) S'3a(1) 57.Gx3c(1) Gx3c 58.P'3d B'4e(7) 59.Px3c+(4) Bx7h+(1) 60.Kx7h G'7i 61.Resigns # # 32-nd Oi Title Match, 5-th game, 28-th and 29-th August 1991. # Black: Tanigawa Koji, Oi; White: Nakada Hiyoki, challenger. 1.P7f P8d(1) 2.P2f P8e 3.B7g P3d 4.S8h G3b(1) 5.G7h Bx7g+(1) 6.Sx7g S4b 7.S3h S7b 8.P4f P6d(3) 9.S4g(1) S6c 10.P6f(3) P4d(1) 11.G5h(2) G5b(1) 12.K6h(2) K4a(1) 13.K7i K3a(1) 14.P3f(1) P7d(10) 15.S5f(13) S5d(4) 16.P9f(11) P9d(7) 17.P1f(18) P1d(1) 18.N3g(3) N7c(33) 19.P2e(19) S3c(5) 20.P4e(46) Px4e(2) 21.P3e P6e(93) 22.Px6e(12) P7e(67) 23.P2d(90) Px2d(2) 24.B'6f B'4d(45) 25.Nx4e(9) Bx6f(12) 26.Sx6f S4d(5) 27.P'2b(7) Kx2b(17) 28.Px3d(11) B'4f(12) 29.R2i(64) P8f(26) 30.Px8f S5dx4e(17) 31.B'2f Sx5f(33) 32.Bx4d(1) P'3c 33.P'4g(13) S'3h(1) 34.Px4f(10) Sx2i+ 35.Px5f R'3i(9) 36.K6h(3) Rx8f(12) 37.P'2c(10) Gx2c(2) 38.P'8g P'6g(3) 39.Kx6g(1) R8d(1) 40.B5e(15) R8dx3d(6) 41.B'4a(5) R3d-3g+(4) 42.S5g G4b(5) 43.S'3a Kx3a 44.Bx2c+ S'2b 45.+B4e Nx6e(3) 46.P'2c Nx5g+(8) 47.Gx5g(3) S'3d 48.N'3e(13) S2bx2c(5) 49.Nx2c+(22) Sx4e 50.Px4e R6i+(3) 51.G'6h(2) B'4i 52.K7g Bx7f+(5) 53.K8h +Bx8g 54.Gx8g(7) +Rx6h 55.K9g +R3gx5g 56.S'2b K4a 57.B'8e P'6c(3) 58.S'7g(15) N'9c(1) 59.Bx9d(3) P'8f(2) 60.Gx8f(1) G'7h(2) 61.G8g(8) P'8e(1) 62.P'8f(5) Gx7g 63.Nx7g(1) S'7h 64.G'8h(2) Sx8g+ 65.Gx8g Px8f 66.Kx8f G'8d 67.S'4c(3) Gx4c 68.S'3b(2) K5a 69.B7c+ Resigns # # 32-nd Oi Title Match, 6-th game, 10-th and 11-th September 1991. # Black: Nakada Hiyoki, challenger; White: Tanigawa Koji, Oi. 1.P7f P8d(1) 2.S6h P3d 3.S7g S6b(1) 4.S4h(1) S4b 5.P5f P5d 6.G4i-5h G3b(2) 7.P6f K4a(1) 8.G6g P7d(7) 9.G7h(2) G5b(1) 10.K6i(1) S3c 11.B7i B3a(3) 12.P3f P4d 13.B6h(10) G5b-4c(10) 14.K7i(1) B6d(12) 15.N3g(7) K3a(5) 16.K8h(1) K2b(1) 17.P2f(1) P8e(9) 18.R3h(11) S5c(12) 19.P1f(3) P1d(8) 20.L1g(12) P5e(28) 21.S5g(69) Px5f(38) 22.Sx5f(4) S5d(11) 23.P'5e(30) Sx5e(72) 24.S6e B3a 25.Sx7d(50) P'5f(31) 26.Sx6c+(75) P8f(26) 27.Sx8f(12) R8c(22) 28.+S5b P'6e(1) 29.Px6e N7c(9) 30.P'5h(48) R8b(49) 31.+S4a(9) B5c 32.P1e Px1e(4) 33.P'1b(3) Lx1b 34.P'1c Lx1c 35.N2e(9) S2d 36.Nx1c+(8) Sx1c 37.R1h(1) P'6f(15) 38.Bx1c+(10) Nx1c(7) 39.G6g-6h(3) P4e(7) 40.Lx1e(1) K3c(1) 41.Lx1c+ N'9d(4) 42.L'4f(17) Nx8f(19) 43.Px8f(35) P'1g(11) 44.Lx4e(3) G4d(4) 45.Lx4d(1) Kx4d 46.N'3g(14) Bx8f(8) 47.P'8g(3) Bx6h+ 48.Gx6h Rx8g+ 49.Kx8g P'8f 50.Kx8f B'9e 51.K8g L'8f 52.Resigns # # 33-rd Oi Title Match, 1-st game, 10-th and 11-th July 1992. # Black: Tanigawa Koji, Oi; White: Gouda Masataka, challenger. 1.P7f P8d(1) 2.S6h(1) P3d 3.S7g(1) S6b 4.P5f(1) P5d 5.S4h S4b 6.G4i-5h G3b 7.P6f(1) K4a 8.G6g(2) G5b(42) 9.P2f(15) P7d(6) 10.B7i(17) P6d(17) 11.G7h(3) S6b-5c(3) 12.P2e(4) G6c(80) 13.K6i(17) N7c(4) 14.P3f(65) P5e(50) 15.Px5e(36) Bx5e 16.S3g S5d(52) 17.P2d(13) Px2d(3) 18.Bx2d P'2c 19.B1e N8e(22) 20.S6h(62) P6e(1) 21.S4f(7) B3c(72) 22.Bx3c+(1) Nx3c 23.Px6e R5b 24.P8f(23) Sx6e(21) 25.Px8e(3) P'6f 26.G6g-7g B'5f(6) 27.B'5h(14) N4e(25) 28.P'5g(8) Bx7h+ 29.Gx7h P'5f 30.Px5f Sx5f 31.N'5e(55) G6d(23) 32.B'7c(3) Gx5e(2) 33.Bx5e+ Rx5e(6) 34.Sx5e N5g+ 35.P'5c(21) P'5a 36.R'2a S3a(14) 37.Sx5g(22) Sx5g= 38.S4f B'3i(3) 39.Sx5g(2) Bx2h+(2) 40.S'6c R'3i(3) 41.K6h G'4b 42.Sx6f(16) Rx8i+(2) 43.G'6b(12) G2b(2) 44.P5b+(2) Px5b 45.Sx5b+ Gx5b(6) 46.Gx5b Kx5b 47.Rx3a+ S'5i(4) 48.K6g(2) S'5f 49.Resigns # # 33-rd Oi Title Match, 2-nd game, 21-st and 22-nd July 1992. # Black: Gouda Masataka, challenger; White: Tanigawa Koji, Oi. 1.P7f P3d(2) 2.P2f P4d 3.S4h(3) S3b(5) 4.P5f R4b 5.K6h K6b 6.K7h K7b 7.G4i-5h K8b(1) 8.P9f P9d(28) 9.S6h S7b(2) 10.P2e(6) B3c 11.P3f G4a-5b(4) 12.S3g(68) S4c(13) 13.P3e(2) Px3e(31) 14.S2f S3d(6) 15.R3h P4e(27) 16.Bx3c+(5) Nx3c 17.Sx3e(1) Sx3e(1) 18.Rx3e B'4d(36) 19.R3f(128) P'3e(92) 20.R2f(2) Bx9i+(29) 21.S'8h +B9h 22.P'3d(2) R4d 23.Px3c+(1) R8d 24.S6h-7g(21) P9e(38) 25.Px9e(30) S'9f 26.N'8f(2) R8e 27.G7i(56) Rx9e(4) 28.P'9i(46) Sx8g=(2) 29.Sx8g +Bx8g 30.Kx8g P'9h 31.K7h(1) Px9i+ 32.K6i(10) L'8g(10) 33.K5i(5) +Px8i(1) 34.G7i-6h +P7i(11) 35.B'3d(1) R9i+(2) 36.K4h +P6i(10) 37.+P4c(4) G5b-6b(15) 38.B'4d(3) +Px6h(29) 39.Sx6h S'3i 40.K5g(4) N'6e 41.K6f +R9e 42.+Px5c(15) +R8d 43.B4c+(17) +Rx4d(28) 44.+Bx4d B'9i 45.P'8h(14) Bx8h+(2) 46.S'7g Gx5c 47.+Bx5c Nx7g+ 48.Sx7g(7) G'6e 49.Kx6e(2) +Bx7g 50.N'7d(4) Px7d(1) 51.Nx7d K7c 52.G'7e N'5b(6) 53.R'4c Resigns # # 33-rd Oi Title Match, 3-rd game, 4-th and 5-th August 1992. # Black: Tanigawa Koji, Oi; White: Gouda Masataka, challenger. 1.P7f P8d 2.P2f P8e(1) 3.B7g P3d 4.S8h G3b(2) 5.G7h Bx7g+(1) 6.Sx7g S4b 7.S3h(2) S7b(2) 8.P4f(2) S8c(3) 9.S4g(10) S8d(1) 10.P9f P9d(7) 11.P6f(9) K4a 12.P6e(13) P9e(48) 13.Px9e(143) Sx9e 14.Lx9e Lx9e 15.P'9g P'9h(53) 16.S'8h K3a(11) 17.P3f(1) L'9a(155) 18.K4h(45) G5a(64) 19.G5h(24) P9i+(2) 20.Sx9i(12) Lx9g+ 21.Nx9g Lx9g+ 22.P'9h(6) +L9f(51) 23.L'8i(45) R9b(35) 24.P6d(1) Px6d 25.B'6c P'9g 26.Bx8a+(1) R9e 27.+B7b(2) Px9h+ 28.Sx9h P'9g 29.P'6c Px9h+(1) 30.P6b+(1) R9b 31.+Bx7c(20) Gx6b(5) 32.P'9c R7b(9) 33.+Bx7b(4) Gx7b 34.R'6a(1) K2b(1) 35.P2e B'1e(14) 36.K3h(1) +Px8i(1) 37.P1f(1) L'2f 38.Px1e S'4i(1) 39.Kx4i(3) Lx2h+ 40.K5i(1) R'3i(4) 41.N'4i B'2g(6) 42.G4h(5) +L3h 43.Sx3h(3) Bx3h+ 44.B'4a(3) N'4g(1) 45.K5h(1) S'6i 46.Kx6i(7) +Bx4h 47.Bx3b+ Kx3b 48.S'4a K2b 49.Resigns # # 33-rd Oi Title Match, 4-th game, 17-th and 18-th August 1992. # Black: Gouda Masataka, challenger; White: Tanigawa Koji, Oi. 1.P7f P8d(1) 2.S6h P3d 3.S7g S6b 4.P5f P5d 5.S4h S4b 6.G7h(1) G3b 7.K6i(1) K4a 8.G5h P7d(13) 9.P6f(14) S6b-5c(7) 10.P2f(53) P5e(21) 11.Px5e(41) Bx5e 12.P2e(3) S5d(5) 13.G5h-6g(14) R5b(24) 14.P2d(15) Px2d(1) 15.Rx2d P'2c(10) 16.R2h B8b(7) 17.S6h(14) S3c(99) 18.P'5f(72) P'5e(12) 19.Px5e(9) Sx5e 20.P6e K3a(20) 21.S4h-5g(53) G5a(21) 22.P'5f(7) S5e-4d 23.K7i G5a-4b 24.P4f(27) P8e(8) 25.P3f(30) P9d(9) 26.P9f(12) P6d(34) 27.Px6d Bx6d 28.P'6e(3) B7c(2) 29.N3g R6b(12) 30.B6f(16) Rx6e(8) 31.P7e(19) Px7e(7) 32.N7g(4) R6a 33.Nx8e(8) B8d 34.P4e(5) P'6e(2) 35.B8h S5c 36.P3e N7c(18) 37.Px3d(17) S2b(1) 38.P3c+ Sx3c(4) 39.N2e(15) Nx8e(3) 40.Nx3c+ Nx3c 41.P'3d N'6f(2) 42.Sx6f Px6f(8) 43.Bx6f S'7g 44.Px3c+(5) Sx6f+(5) 45.S'2b(8) Gx2b(3) 46.+Px2b Kx2b 47.N'3d(9) K3b 48.N'3e(4) +Sx6g(25) 49.Gx6g P7f(1) 50.Rx2c+ K4a 51.Nx4b+ Sx4b 52.G'3b K5a 53.Gx4b K6b 54.G'7d S'8h(5) 55.Kx8h B'6f 56.P'7g Px7g+ 57.Sx7g Nx7g+ 58.Gx7g N'7f 59.Resigns # # 33-rd Oi Title Match, 5-th game, 25-th and 26-th August 1992. # Black: Tanigawa Koji, Oi; White: Gouda Masataka, challenger. 1.P7f P8d(1) 2.S6h(1) P3d 3.S7g S6b 4.P5f P5d 5.S4h S4b(1) 6.G4i-5h(2) G3b(2) 7.P6f(1) K4a 8.G6g S6b-5c(36) 9.G7h(9) P5e(28) 10.Px5e(7) Bx5e 11.P2f S5d(67) 12.P2e(6) R5b(26) 13.K6i(14) K3a(23) 14.P'5f(27) B3c(15) 15.S5g(18) P7d(22) 16.S7g-6h(9) S5c(28) 17.K7i(9) S4d 18.P4f(11) N7c(3) 19.P3f(8) B4b(3) 20.P1f(9) P8e(5) 21.B7g(11) P9d(23) 22.P9f(19) R8b(25) 23.P1e(35) G5b 24.L1h(16) S3c(17) 25.R3h(6) B6d(32) 26.P3e(1) Px3e 27.Rx3e P'3d 28.R3h P4d 29.R4h(49) K2b(8) 30.P5e(8) Bx5e 31.S5f(5) B6d 32.P'5e Sx5e(28) 33.Sx5e Bx5e 34.S'4a G3b-4b 35.Sx5b+ Rx5b 36.G'5f(6) S'3f(23) 37.P2d(20) Px2d(2) 38.Gx5e Rx5e(1) 39.P4e G'5h(6) 40.R2h(3) S4g+(33) 41.Px4d(3) R3e(1) 42.P'3g(11) P7e(2) 43.P6e(7) S'3b 44.B'5d(8) P8f(4) 45.Px8f(7) P'8g 46.Gx8g P'5c(7) 47.Bx6c+(13) Gx6h(4) 48.Gx6h(2) P'6g(1) 49.P'2c(6) Sx2c 50.G7h(3) S'6h 51.K8h Sx7g+ 52.Nx7g Px7f 53.P4c+(8) Gx4c 54.+B4a S3b(2) 55.S'3a(17) K2c 56.P'4d Gx4d 57.+B5a Px7g+ 58.G8gx7g P'4b 59.P'2b(23) Nx6e 60.Px2a+ Sx2a 61.Sx4b=(2) Sx4b 62.+Bx4b S'3c 63.+B3a Nx7g+ 64.Gx7g P'8g 65.Gx8g G'2b 66.P'2e(11) Px2e 67.N'1f N'7e 68.P'2d(1) Sx2d 69.Nx2d Nx8g+ 70.Kx8g G4c 71.N'3f(2) Rx3f 72.Px3f B'5d 73.P'6e(1) Bx6e 74.S'7f B5d 75.Rx2e Resigns # # 33-rd Oi Title Match, 6-th game, 8-th and 9-th September 1992. # Black: Gouda Masataka, challenger; White: Tanigawa Koji, Oi. 1.P7f P8d(1) 2.S6h P3d 3.S7g S6b 4.P5f P5d 5.S4h S4b 6.G4i-5h G3b 7.P6f K4a 8.G6g P7d(3) 9.G7h(8) G5b(3) 10.K6i S3c(1) 11.P3f B3a(1) 12.B7i P4d 13.S3g(51) B6d(12) 14.B6h G5b-4c(3) 15.K7i K3a 16.K8h P8e(13) 17.P1f(3) K2b(1) 18.P2f P7e(43) 19.P6e(84) B4b(4) 20.Px7e(44) Bx7e 21.S4h S7c(21) 22.B4f(7) P4e(15) 23.B3g R9b 24.S5g(2) B5c(15) 25.S5g-6f(4) P3e(38) 26.Px3e(1) P'3f(1) 27.B5i(52) P6d(13) 28.Px6d(33) Sx6d(6) 29.S7f(11) P'7e(35) 30.Sx8e(1) Bx3e 31.P'6e(14) Sx6e(10) 32.Sx6e P'6f 33.Gx6f(2) B5g+(9) 34.G7h-6g(38) +B3i(44) 35.R7h N7c 36.Rx7e(44) Nx8e(1) 37.B8f(1) +Bx2i(36) 38.R7a+(29) +Bx1i(1) 39.P5e(18) +B3g(5) 40.S'4a(4) +Bx2f(27) 41.P'6b(5) G4c-4b(6) 42.Sx3b+(4) Gx3b 43.G'3a(1) P2d(2) 44.P'3d(1) P'7h(27) 45.Px3c+(6) Gx3c 46.P'3d K2c(8) 47.Px3c+ Nx3c 48.+R4a(1) +B3e(1) 49.+R4c(4) +B7i(2) 50.K9h Resigns # # 40-th Osho Title Match, 1-st game, 17-th and 18-th January 1991. # Black: Yonenaga; White: Minami. 1.P7f P8d 2.P2f P8e 3.B7g P3d 4.S8h G3b 5.G7h Bx7g+ 6.Sx7g S2b 7.S3h S7b 8.P4f S3c 9.S4g K4b 10.G5h G5b 11.P3f S8c 12.N3g S8d 13.P9f P7d 14.P6f P7e 15.R2i P4d 16.K4h K3a 17.P6e Px7f 18.Sx7f R7b 19.S6g B'9b 20.P5f Bx6e 21.P2e S7e 22.P2d Sx2d 23.P4e S6d 24.Px4d P3e 25.N7g B5d 26.B'6a R6b 27.B8c+ Px3f 28.N2e G5b-4b 29.P'6e P'7f 30.Px6d Px7g+ 31.Gx7g Px6d 32.P'7d N'6e 33.G6f N3c 34.Nx3c+ G4bx3c 35.N'4f N'4e 36.P'3h N6e-5g+ 37.Gx5g Nx5g+ 38.Kx5g Bx8g+ 39.P7c+ R4b 40.N'4e G'3e 41.Nx5c+ Rx4d 42.G5e P'4e 43.N5d P4f 44.K6f Px4g+ 45.Gx4d Gx4d 46.K7e Resigns. # # 40-th Osho Title Match, 2-nd game, 28-th and 29-th January 1991. # Black: Minami; White: Yonenaga. 1.P7f P8d 2.S6h P3d 3.P6f S6b 4.P5f P5d 5.S4h S4b 6.G4i-5h G3b 7.G6g P7d 8.P2f P6d 9.P2e S6c 10.P2d Px2d 11.Rx2d N7c 12.R2h P'2c 13.G7h P8e 14.B7g P4d 15.P4f G5b 16.S4g R8a 17.P3f K6b 18.K6i P1d 19.S7i S5c 20.S8h R4a 21.B6h P4e 22.Px4e P6e 23.Px6e Rx4e 24.P'4f P'6f 25.G5g R4a 26.N7g P7e 27.Px7e P3e 28.Px3e P8f 29.P3d R4d 30.R3h G3b-4c 31.R2h Rx3d 32.P'3e R3a 33.Rx2c+ B4d 34.P5e P'7f 35.Gx6f Px7g+ 36.Sx7g Px8g+ 37.Gx8g P'2b 38.+R2h Px5e 39.N3g N'5f 40.B7i G5d 41.S7f P'6g 42.Gx6g Gx6e 43.P'6f G6d 44.N4e S4b 45.P'5d Sx5d 46.P'5g P'6h 47.K7h N3c 48.Px5f Nx4e 49.Px4e Sx4e 50.P'4f P'8f 51.Gx8f N'9d 52.G9f Sx5f 53.Sx5f Px5f 54.P7d P'7g 55.Gx7g P'7e 56.Px7c+ Kx7c 57.S8e P5g+ 58.N'6e Gx6e 59.S'7d K6b 60.Sx6e N'7c 61.N'5d K5a 62.S6d Nx8e 63.Gx8e S'6e 64.P'5c P7f 65.Px5b+ Kx5b 66.G'6c K4c 67.Nx4b+ Kx4b 68.S5c+ K3b 69.G'4b K2a 70.G3a Kx3a 71.N'4c K2a 72.R'3a K1b 73.S'2c Resigns. # # 40-th Osho Title Match, 3-rd game, 7-th and 8-th February 1991. # Black: Yonenaga; White: Minami. 1.P2f P8d 2.P2e P8e 3.G7h G3b 4.P2d Px2d 5.Rx2d P'2c 6.R2f S7b 7.P1f P1d 8.S3h P6d 9.P7f P8f 10.Px8f Rx8f 11.P'8g R8b 12.P4f S6c 13.S4g P3d 14.S5f S5d 15.P9f G5b 16.G5h P4d 17.K6i S4b 18.P3f S4b-4c 19.B7g K4a 20.N3g K3a 21.S8h G5b-4b 22.K7i P9d 23.P8f P7d 24.S8g N7c 25.B8h R8a 26.G5h-6h B3c 27.P1e Px1e 28.P3e Px3e 29.P'1c G2b 30.N2e B2d 31.S5e N6e 32.Sx5d Px5d 33.P6f Nx5g+ 34.Gx5g S'3g 35.R2i P3f 36.B7g S3h= 37.R2h P3g+ 38.R1h Nx1c 39.Nx1c+ Lx1c 40.S'2e B3e 41.N'3d Sx3d 42.Sx3d P'3c 43.Sx3c+ G2bx3c 44.N'2e G3c-4c 45.P'3f B2d 46.Nx1c+ Bx1c 47.Rx1e S'2d 48.Rx1c+ Sx1c 49.Lx1c+ R'1i 50.K8h Rx1c+ 51.P4e P7e 52.Px4d Gx4d 53.P6e P5e 54.L'4f P'4e 55.Lx4e Gx4e 56.B'5d R8c 57.P'4c Gx4c 58.Bx4c+ Rx4c 59.S'3d R4d 60.S'3c P'3b 61.G'4b Rx4b 62.Sx4b+ Kx4b 63.R'4c K3a 64.Rx4e+ L'5a 65.P'5b Lx5b 66.G'4b K2b 67.Gx3b Kx3b 68.+R4c K2a 69.+Rx5b G'3a 70.P'2b K1b 71.L'3c +Rx2b 72.P'2d Px2d 73.Lx3a+ +Rx5b 74.G'2c K1a 75.Bx5e +Rx5e 76.P'2b B'5d 77.P2a+ Bx2a 78.S3c+ Resigns. # # 40-th Osho Title Match, 4-th game, 20-th and 21-st February 1991. # Black: Minami; White: Yonenaga. 1.P7f P8d 2.S6h P3d 3.P6f S6b 4.P5f S4b 5.S4h P5d 6.G4i-5h G3b 7.G6g P7d 8.P2f P6d 9.P2e S6c 10.P2d Px2d 11.Rx2d N7c 12.R2h P'2c 13.G7h P8e 14.B7g P4d 15.K6i S5c 16.P3f P4e 17.S4h-5g S4d 18.N3g R4b 19.K7i K6b 20.K8h P9d 21.P4f Px4f 22.Sx4f P'4e 23.S4f-5g G5b 24.L9h P1d 25.K9i P9e 26.S7i N3c 27.S8h B1c 28.B6h R4a 29.P1f B3a 30.S4h P8f 31.Px8f B5c 32.S4g P3e 33.Px3e Sx3e 34.P'3d P'3f 35.Px3c+ Gx3c 36.P'4b Px3g+ 37.Px4a+ +Px2h 38.P5e Px5e 39.P'5d Sx5d 40.P7e R'3g 41.R'8b K6c 42.P'3f S4d 43.Px7d S4c 44.P'4h Kx7d 45.N'3e G6b 46.+P4b P'8a 47.Rx8a+ Bx4b 48.Nx4c+ Gx4c 49.S'5a Bx5a 50.+Rx5a S5c 51.B3e N'4d 52.+Rx6b Sx6b 53.B'5b S'6c 54.P'7e Kx7e 55.Bx4c+ R3i+ 56.G'8c R'5i 57.G7f Resigns. # # 40-th Osho Title Match, 5-th game, 28-th February and 1-st March 1991. # Black: Yonenaga; White: Minami. 1.P7f P8d 2.P2f P8e 3.B7g P3d 4.S8h G3b 5.G7h Bx7g+ 6.Sx7g S2b 7.S3h S3c 8.P4f S7b 9.S4g K4b 10.G5h G5b 11.P6f S8c 12.P3f S8d 13.P9f P7d 14.N3g P4d 15.R2i S7c 16.P1f P1d 17.P9e G3b-4c 18.P2e K3b 19.K6h S6d 20.K7i P7e 21.P4e Px4e 22.Nx4e S2b 23.S5f P8f 24.Px8f P'4d 25.P6e Px7f 26.Sx7f S7c 27.S8e Px4e 28.G5h-6g B'3g 29.P'7d S6b 30.Sx4e P'4d 31.S5f P5d 32.G6g-7g B4f+ 33.K8h +Bx5g 34.S6g +B4g 35.R5i +B3g 36.R4i G5b-4b 37.B'4f +Bx4f 38.Rx4f B'2h 39.R4i S3c 40.S6f P6d 41.Px6d Bx6d+ 42.P'6e +B3g 43.B'6d +Bx6d 44.Px6d B'3h 45.R5i B4g+ 46.S7f P'6h 47.Gx6h P'6c 48.P7c+ Nx7c 49.P'7d +Bx7d 50.S7f-7e +B4g 51.P'7d N6e 52.G7g-6g P'8e 53.P6c+ Sx6c 54.K9g N'8c 55.S8d Nx9e 56.S7c+ +B3g 57.R5h Px8f 58.P'8c +B6d 59.B'7e P8g+ 60.K9f R8a 61.Bx6d Sx6d 62.Kx9e B'4i 63.K8d Bx5h+ 64.P8b+ +Bx6h 65.Gx6h G'9b 66.+Px8a +P8f 67.P'8e R'8h 68.R'9e P'8c 69.+Sx8c +Px8e 70.Rx8e Gx8c 71.Kx8c Rx8e+ 72.P'8d S'9b 73.Resigns # # 40-th Osho Title Match, 6-th game, 11-th and 12-th March 1991. # Black: Minami; White: Yonenaga. 1.P7f P3d 2.P6f P3e 3.P5f R3b 4.S4h S4b 5.K6h K6b 6.K7h K7b 7.P9f P4d 8.G4i-5h S4c 9.G6g P1d 10.B7g K8b 11.K8h L9b 12.S7h K9a 13.P8f S8b 14.S8g R3d 15.G7h B1c 16.P2f N3c 17.P2e G4a-5b 18.R2f S5d 19.P8e P6d 20.B8f S6c 21.S5g G7b 22.P9e G5b-6b 23.P1f P4e 24.P5e P5d 25.P1e Px1e 26.Px5d Rx5d 27.P6e P3f 28.P'5e Rx5e 29.S5f R5d 30.B7g Px3g+ 31.Nx3g R3d 32.P'3f Px6e 33.Sx6e B3a 34.P2d Px2d 35.P3e Rx3e 36.Rx2d P'6d 37.R2a+ B4b 38.+R2f R3d 39.P'3e R1d 40.S5f P'2e 41.+R3f P7d 42.P'2d P6e 43.P3d P'3e 44.+Rx3e B5c 45.+R3f P'3e 46.+R2g P2f 47.+Rx2f P3f 48.+Rx3f Rx2d 49.Px3c+ R2h+ 50.+P4c B2f 51.Nx4e B3g+ 52.+Rx3g +Rx3g 53.+P5c Resigns. # # 41-st Osho Title Match, 1-st game, 16-th and 17-th January 1992. # Black: Minami Yoshikazu; White: Tanigawa Koji. 1.P7f P3d(4) 2.P2f P4d 3.P2e B3c 4.S4h S3b(3) 5.P5f R4b(2) 6.K6h K6b 7.K7h K7b 8.G4i-5h(6) K8b(11) 9.P9f(2) S4c(20) 10.S5g(14) G4a-5b(16) 11.P8f(4) P6d(4) 12.K8g(9) L9b(51) 13.S7h K9a 14.P3f(69) S8b(1) 15.S4f G7a(42) 16.P3e(4) R3b 17.Px3d(125) Sx3d(1) 18.S5e S4c(46) 19.P'3d(9) B5a(107) 20.R3h(2) P7d 21.Sx4d(65) Sx4d 22.Bx4d S'4i(3) 23.R3i(19) Sx5h+(1) 24.Gx5h B8d 25.R3e(7) G'5g(42) 26.P8e(49) Gx5h 27.Px8d R4b 28.Bx1a+ Rx4g+ 29.S'7g(8) G'7i(28) 30.Px8c+(7) Sx8c 31.P'8d S7b(3) 32.L'8f(9) P'8b 33.+Bx2a Gx7h(12) 34.Kx7h G5g 35.G'7i(10) Gx6g 36.K8h +R4f(14) 37.R3g(6) +Rx3g 38.Nx3g R'3i 39.P'6i(2) Rx3g+ 40.R'4a N'6a(2) 41.B'5e(5) +R3h(5) 42.S'6h G5b-6b(3) 43.+B4c(17) S'5d(7) 44.Bx6d Gx7g 45.Nx7g S'7c 46.N'8c(1) Px8c 47.Px8c+ Sx8c 48.Lx8c+ Sx4c(1) 49.Rx6a+ G6bx6a 50.Bx7c+ Resigns # # 41-st Osho Title Match, 2-nd game, 27-th and 28-th January 1992. # Black: Tanigawa Koji; White: Minami Yoshikazu. 1.P7f P8d 2.S6h P3d 3.S7g S6b 4.P5f P5d 5.S4h S4b 6.G4i-5h G3b 7.P6f K4a 8.G6g P7d 9.G7h(4) G5b(2) 10.K6i S3c 11.B7i B3a 12.P3f(1) P4d 13.B6h(23) G5b-4c(22) 14.K7i B6d 15.N3g(2) K3a 16.K8h(1) K2b(17) 17.P2f(8) P8e(29) 18.R3h(4) S5c(12) 19.P4f(24) P5e(9) 20.Px5e(91) Bx5e 21.G5f B7c(33) 22.G6e R8d(10) 23.S4g S6d(34) 24.Gx6d Bx6d 25.R5h P'5d(4) 26.S5f(4) N7c(15) 27.P9f(9) P9d(4) 28.P1f(8) P9e(54) 29.Px9e P7e(9) 30.Px7e Bx7e 31.S'7f(39) B4b(20) 32.P'7e(7) P8f(12) 33.Sx8f(12) P5e(4) 34.S4g(2) P6d(39) 35.Rx5e(42) P'5d 36.R5i P6e(3) 37.B5g(3) B6d(37) 38.P'5f(22) Px6f(2) 39.P'6e(12) B5c(7) 40.Bx6f(13) P'6d 41.Px6d(20) Rx6d 42.B4h P4e(11) 43.Nx4e(3) B4d 44.P5e Bx5e(33) 45.P'6f(1) Rx6f(2) 46.Bx6f(32) Bx6f 47.S7g B4h+ 48.Nx3c+ Nx3c(4) 49.R6i P'6e 50.S5f(1) +B5h 51.R6h(3) +Bx6h 52.Gx6h R'5i(10) 53.P'6i(1) Rx5f+ 54.R'6a(2) P'4a(1) 55.S'5b(10) G4c-4b(1) 56.Sx4a+ Gx4a 57.Rx4a+ G'3a 58.+Rx9a B'5e(14) 59.L'5g(16) N'8d 60.Lx5f(19) Nx7f 61.K7h Nx6h+ 62.Px6h Bx7g+ 63.Nx7g P'7f 64.B'4d G'4c(12) 65.R'8b(1) S'4b(1) 66.N'2e S'4a(4) 67.B6b+(8) S'6f 68.K8h(1) Px7g+ 69.K9g Sx7e 70.+Bx7c N'8d 71.+Bx8d Sx8d 72.Rx8d+ Nx2e 73.K8f(1) P'8c(1) 74.+R7d(2) B'5g(1) 75.K8e N'6b 76.+Rx8c S'7d 77.K9d Sx8c 78.Kx8c N3g+(1) 79.P9d(1) R'8i(1) 80.P9c+ Rx9i+ 81.B'7c L'8a(1) 82.K7b Bx9c+ 83.Kx8a Resigns # # 41-st Osho Title Match, 3-rd game, 5-th and 6-th February 1992. # Black: Minami Yoshikazu; White: Tanigawa Koji. 1.P7f P3d(1) 2.P2f P8d(1) 3.P2e P8e 4.G7h G3b 5.P2d Px2d 6.Rx2d P8f(4) 7.Px8f Rx8f 8.Rx3d(3) Bx8h+(34) 9.Sx8h Rx7f 10.N7g(24) G3c(47) 11.R8d(11) P'8b(5) 12.K5h(33) R2f(9) 13.P'2h K5b 14.G3h(3) G7b(2) 15.P2g R2b 16.R8f(1) P8c(5) 17.P9f(17) P1d(9) 18.P9e(55) S8b(8) 19.R5f(39) S4b(21) 20.P3f(1) P7d(11) 21.N3g(58) P4d(24) 22.P3e(15) P1e(148) 23.R2f(67) P'2d(2) 24.R5f(16) P2e(25) 25.S8g(14) P6d(14) 26.P1f(25) P'3f 27.Rx3f B'6c 28.R6f(6) Px1f 29.Rx6d(14) P1g+(36) 30.N6e(12) N7c(10) 31.B'8a(12) P'6b(8) 32.P3d(10) G4c 33.Nx7c+(3) Gx7c 34.Bx6c+ Px6c 35.R6f B'5e(2) 36.R9f(3) +Px2g(4) 37.Lx1a+(5) +Px3h(4) 38.Sx3h N'2f 39.L'5f(1) B6d 40.N'7f(5) B7e(3) 41.S2g P9d(2) 42.Px9d G'8e(2) 43.R9h P'9f 44.R8h(3) Lx9d(5) 45.P'9h P9g+(3) 46.Px9g Lx9g+ 47.Lx9g Bx9g+ 48.R8i P'3f 49.+Lx2a(3) Rx2a(1) 50.N'5e Gx3d(3) 51.L'6f(5) Px3g+(8) 52.P'9h(1) +B7e(2) 53.Sx2f(3) Px2f 54.Lx6c+(8) Gx6c 55.Nx6c+ Kx6c 56.N'5e K6b(1) 57.G'6c(1) K7a(2) 58.P'7c K8a 59.P7b+ K9b 60.+Px8b Kx8b 61.P'8d(2) N'6e(2) 62.P6f +Bx6f(1) 63.B'6d K9c 64.Px8c+ K9d(1) 65.S'9e Kx8c 66.P'8d K9b 67.G6g +Bx6g 68.Kx6g P'6f 69.Kx6f G'7e 70.Resigns # # 41-st Osho Title Match, 4-th game, 17-th and 18-th February 1992. # Black: Tanigawa Koji; White: Minami Yoshikazu. 1.P2f P8d(2) 2.P2e P8e 3.G7h(2) G3b 4.P2d Px2d 5.Rx2d P'2c(8) 6.R2f S7b 7.P1f(6) P1d(1) 8.P9f(7) P6d(9) 9.S3h(39) S6c(6) 10.P7f(2) P8f(3) 11.Px8f Rx8f 12.N7g P9d(28) 13.K4h(5) S4b(21) 14.B9g(55) R8b(112) 15.P7e(1) P3d(1) 16.R8f(40) P'8d 17.P6f(16) K4a 18.S6h P4d(14) 19.S6g(6) G4c 20.S5f(40) K3b(6) 21.R7f(4) P5d(16) 22.P6e(38) S5c 23.Px6d(1) S5cx6d 24.S6e Sx6e(7) 25.Nx6e(8) S'6d 26.P'6f P4e(2) 27.L9h(7) Sx6e(61) 28.Px6e(1) B9i+ 29.P'8c(21) R5b(66) 30.S'8g(23) +B3c(6) 31.K3i P5e(1) 32.G6h(5) R6b(22) 33.G6h-5h(12) G5b(14) 34.S'7a(16) R6a 35.P8b+ P5f(13) 36.Rx5f(16) S5d 37.S7f(1) S5e(6) 38.R3f(3) +B4d(2) 39.+P7b(2) R6c(1) 40.P7d(2) Px7d(3) 41.P5f(11) S6f(1) 42.P6d(14) R9c 43.+P6b Gx6b 44.Sx6b= +Bx6b 45.P6c+ +Bx6c(5) 46.G'3a(8) K2b 47.G6g Sx6g+(5) 48.Sx6g G'4a(2) 49.P'2d(5) Px2d(1) 50.Gx2a(1) Kx2a 51.N'5e +B5b(7) 52.Nx4c+ Rx4c 53.Rx3d(3) G'3b 54.G'4d(5) S'2c(2) 55.Rx3b+(4) Gx3b(1) 56.Gx4c +Bx4c 57.R'4a P'3a 58.G'4b(6) +Bx4b(2) 59.Bx4b+(2) Gx4b(1) 60.Rx4b+ R'3b(2) 61.P'2b(4) Rx2b 62.+Rx2b Kx2b 63.R'8b G'3b(1) 64.B'6f P'5e 65.Bx5e N'3c 66.G'4c P'6b(3) 67.Gx3b(1) Px3b 68.Rx8a+ G'2a(3) 69.B6d(4) R'6h(10) 70.N'4c(1) Resigns(2) # # 41-st Osho Title Match, 5-th game, 27-th and 28-th February 1992. # Black: Minami Yoshikazu; White: Tanigawa Koji. 1.P7f G3b(6) 2.P5f(8) P5d(9) 3.R5h(2) S6b(7) 4.P5e(1) Px5e(1) 5.Bx5e K4a 6.B7g P3d(2) 7.P6f P'5e(20) 8.S6h S5c 9.S6g S5d 10.K4h S4b(3) 11.K3h R5b(13) 12.R8h(16) P4d(22) 13.P8f P4e 14.P8e R8b 15.K2h(21) K3a 16.P7e(22) B4d(6) 17.G3h(14) K2b(1) 18.P6e(31) S4b-4c(24) 19.S6f(1) B3c 20.R8f(13) G5b(13) 21.G5h(18) G5c(38) 22.R7f(37) P6d(50) 23.P7d Px7d(1) 24.Rx7d P'7c 25.R7f Px6e(34) 26.S7e R7b(36) 27.P'5i(18) P7d(28) 28.Sx7d P'7e(4) 29.Rx7e G6d 30.P'7c Gx7e(1) 31.Px7b+ Gx7d 32.+Px8a(9) R'6i(4) 33.R'7b(3) Gx8e(1) 34.+Px9a(5) Rx8i+ 35.P4f(3) Px4f(59) 36.P'4b(2) N'3e(1) 37.L'4i(4) P4g+(7) 38.Lx4g(3) Nx4g+(1) 39.G5hx4g L'4d(1) 40.N'2e B2d(5) 41.N'3f(4) Lx4g+(2) 42.Gx4g +R7h(9) 43.L'4h(4) B7i+(6) 44.P4a+(10) P'4f(14) 45.Gx4f(7) +Bx4f(12) 46.P'6h(16) P'4g(7) 47.P'4d(1) +Rx7g(3) 48.Rx7g+ G'3h 49.Kx3h Px4h+ 50.Sx4h B'5f 51.G'4g L'4e(2) 52.R'5g(2) +Bx4g(5) 53.Sx4g Lx4g+ 54.Rx4g S'4f 55.L'4i S'5g(4) 56.Resigns # # 42-nd Osho Title Match, 1-st game, 13-th and 14-th January 1993. # Black: Tanigawa Koji; White: Murayama Satoshi. 1.P7f P8d(1) 2.S6h P3d(1) 3.P6f S6b(2) 4.P5f P5d 5.S4h(2) S4b(2) 6.G4i-5h G3b(2) 7.G6g(1) K4a(8) 8.G7h(3) G5b(5) 9.K6i(1) S3c(1) 10.S7g(1) B3a(1) 11.B7i(2) P4d(2) 12.P3f(5) P7d(15) 13.B6h(14) P9d(32) 14.K7i(34) P9e(7) 15.K8h N7c(9)16.P3e(26) L9c(17) 17.Px3d(23) Sx3d(1) 18.R3h S4c(19) 19.B4f(2) R9b(4) 20.S8f(5) P6d(4) 21.S5g(10) S6c(15) 22.P'3d(27) B5c(13) 23.P5e(9) Px5e(32) 24.Bx5e G5b-4b 25.S5f(9) K3a(6) 26.P1f(12) K2b(12) 27.B4f(42) S6c-5d(14) 28.P'5e(14) S4e(10) 29.Sx4e(4) Px4e 30.B2h P'3e(16) 31.S'8c(28) R5b(36) 32.Sx7d=(19) B4d(10) 33.Sx7c=(4) Bx5e(13) 34.Bx5e(2) Rx5e 35.P'5f(10) R5d(1) 36.S7g Rx3d(38) 37.Sx6d=(35) B'4i(15) 38.R2h P3f(1) 39.N'2f(11) R3e(8) 40.S6h(1) P3g+(17) 41.Nx3g S'4d(4) 42.P'3f(16) Rx3f 43.P'3h B5h+(6) 44.G5g(14) +Bx7f(10) 45.S6g +B8e 46.P4f(1) Px4f(4) 47.B'8b +Bx6g(26) 48.G7hx6g S'4h 49.S5e(39) Sx3g+(9) 50.Px3g(1) Rx3g+ 51.R7h(6) P4g+(2) 52.Sx4d +Px5g 53.Bx3g+ +Px6g 54.R7a+ G'7h(8) 55.+Rx7h +Px7h 56.Kx7h R'5g(3) 57.R'6g(4) P'7g(1) 58.Rx7g(2) Rx7g+(2) 59.Nx7g N'7e(5) 60.B'7f(1) G'6g(6) 61.Bx6g(12) R'5g 62.S'7f Nx6g+ 63.Sx6g Rx3g+ 64.N'3d Sx3d 65.Nx3d +Rx3d 66.S'3e +R4e 67.G'4f +Rx4d(3) 68.Sx4d P'7f 69.P'3c(1) Px7g+ 70.Kx7g B'5i 71.K7f G4bx3c 72.Sx3c+ Nx3c 73.P'3d S'8e 74.K7e Resigns (1) # # 42-nd Osho Title Match, 2-nd game, 27-th and 28-th January 1993. # Black: Murayama Satoshi; White: Tanigawa Koji. 1.P7f P8d 2.P2f(3) P8e(2) 3.B7g P3d 4.S8h G3b(1) 5.G7h(1) Bx7g+(8) 6.Sx7g S4b 7.S3h S7b(1) 8.P4f(2) K4a(17) 9.S4g(1) S8c(3) 10.P3f(2) S8d(1) 11.P9f(6) P9d(5) 12.G5h(2) K3a(9) 13.N3g(2) G5b(8) 14.P4e(20) S3c(57) 15.S6f(50) P7d(6) 16.K4h(20) S7c(3) 17.S5e(7) P8f(24) 18.Px8f(1) Rx8f 19.R2i(5) R8b(29) 20.N7g(31) P6d(26) 21.P4d(63) Px4d(6) 22.P'4e(1) P5d(36) 23.S5e-4f P'8g(20) 24.Px4d(15) P8h+(4) 25.P'8c(13) Rx8c 26.B'6a R8b 27.Gx8h Sx4d(9) 28.G7h(3) P'4c(17) 29.Bx5b+(17) Rx5b 30.R8i P'8d 31.G'8c(1) S5e(45) 32.Gx7c(55) Nx7c(2) 33.Rx8d Sx4f(2) 34.R8a+ K2b 35.Sx4f S'6i(18) 36.G7h-6h(15) B'2g(2) 37.S'4i(6) Sx5h+(19) 38.Gx5h(2) G'2h(1) 39.G5i(24) G'3i(19) 40.N2e(21) B'6i(39) 41.Gx6i(30) Bx4i+ 42.K4g S'5h(6) 43.K5f +B3h 44.K6f(2) P6e 45.Nx6e(1) +Bx6e 46.K7g N'8e(2) 47.K8g(3) Sx6i= 48.Resigns (2) # Time black: 7.07; time white: 7.27. # # --------------------------------------------------------------------------- # # 42-nd Osho Title Match, 3-rd game, 9-th and 10-th February 1993. # # Black: Tanigawa Koji; White: Murayama Satoshi. # 1.P7f P8d(2) 2.S6h P3d(1) 3.P6f S6b(2) 4.P5f P5d(1) 5.S4h S4b 6.G4i-5h G3b(1) 7.G6g(1) K4a(1) 8.G7h(3) G5b(1) 9.K6i S3c 10.S7g(1) B3a(1) 11.B7i P4d(5) 12.P3f(2) P7d(3) 13.B6h(26) G5b-4c(18) 14.K7i(4) P8e(3) 15.K8h(19) B6d(6) 16.S3g(12) K3a(7) 17.P2f K2b(10) 18.P1f S7c(28) 19.S4f(5) P7e(53) 20.Px7e(5) P4e(53) 21.S3g(1) Bx7e 22.P'7f(16) B6d(14) 23.P2e(6) S6b(2) 24.P4f(37) Px4f(6) 25.Bx4f Bx4f(9) 26.Sx4f(2) P'4e 27.S3g S5c(1) 28.P7e(77) P5e(2) 29.Px5e(37) S5c-4d(16) 30.P5d(38) Gx5d(2) 31.P7d G6d(7) 32.P2d(1) Px2d(1) 33.P'2e Px2e(4) 34.N1g(24) P'7f(14) 35.Sx7f(1) P'7e 36.Nx2e(1) P'2c(6) 37.Nx3c+(15) Sx3c 38.P'4d(8) Px7f(18) 39.S'4c P8f(1) 40.Sx3b+(23) Kx3b(1) 41.B'4c K2b(2) 42.Px8f P'8g(13) 43.Gx8g(12) N'7e(20) 44.Bx7f+(3) B'6i 45.P4c+(9) Nx8g+(63) 46.+Bx8g Bx8g+ 47.Kx8g B'6i 48.K7g(5) S'3b 49.P'4d(5) Resigns (13) # Time black: 6.39; time white: 6.59. # # --------------------------------------------------------------------------- # # 42-nd Osho Title Match, 4-th game, 17-th and 18-th February 1993. # # Black: Murayama Satoshi; White: Tanigawa Koji. # 1.P7f P8d 2.S6h(6) P3d 3.P6f(1) S6b 4.P5f(2) P5d 5.G4i-5h(1) S4b(1) 6.S4h(2) G3b(2) 7.G6g(4) K4a 8.G7h(4) G5b(6) 9.K6i(3) S3c(4) 10.S7g(3) B3a(2) 11.B7i(6) P4d 12.P3f(3) G5b-4c(3) 13.B6h(1) P7d(26) 14.K7i(2) P8e(1) 15.K8h(5) B6d(23) 16.N3g(5) K3a 17.R3h(1) K2b(1) 18.P2f(3) S5c(6) 19.P1f(14) P5e(27) 20.P6e(27) B7c 21.Px5e(2) P6d(13) 22.N2e(5) S2d(10) 23.P3e(9) Sx3e(17) 24.P1e(4) Px6e(41) 25.Nx1c+(15) Lx1c(21) 26.P1d(15) Lx1d(10) 27.Lx1d(3) P'1c 28.Lx1c+(9) Kx1c(1) 29.P'3f(20) L'6f(17) 30.Px3e(44) P8f(2) 31.Px3d(28) K2b(1) 32.Sx8f(2) Lx6g+(54) 33.Gx6g(2) G'6f 34.G7g(16) N'5f(9) 35.B7i(14) P'8e(36) 36.Sx8e(1) Nx4h+(3) 37.Rx4h(8) Bx5e(3) 38.S'7h(3) P'5f(6) 39.L'5i(8) P7e(33) 40.R1h(73) N7c(4) 41.Gx6f(2) Bx6f 42.G'7g(2) P'1g(2) 43.Rx1g(15) B3i+ 44.N'1d(28) K3a(1) 45.S7d(1) N8e(6) 46.Sx8e(2) +Bx1g 47.Lx5f(14) R'5i(8) 48.Lx5c+(4) Gx5c 49.L'5g(9) Px7f(3) 50.S'6h(10) Px7g+(6) 51.Nx7g R5h+ 52.P'5i +R3h 53.Lx5c+ +Rx3d 54.S6h-6g(5) P6f(4) 55.Sx6f(1) P'6h(3) 56.Bx6h(7) G'5f(1) 57.N'1c(4) P'6g(3) 58.Nx2a+ Kx2a 59.B1c+ L'1a 60.P'3c(1) Lx1c(2) 61.Px3b+ Rx3b 62.P'3c +Rx3c 63.N'2e S'7i(1) 64.Resigns # Time black: 7.59; time white: 7.03. # # 38-th Oza Title Match 1990 (professional, no comment). # # # 38-th Oza Title Match, 1-st game, September 9-th 1990. # Black: Nakahara, Oza; White: Tanigawa, Oi # 1.P2f P8d 2.P2e P8e 3.G7h G3b 4.P2d Px2d 5.Rx2d P'2c 6.R2f S7b 7.P1f P1d 8.S3h P3d 9.K5h P9d 10.P3f B4d 11.P3e Bx3e 12.R5f S4b 13.P7f B4d 14.Bx4d Px4d 15.N7g P6d 16.P1e Px1e 17.P'1c Lx1c 18.R5e N3c 19.G3i S6c 20.Rx8e P'8d 21.R8f S5d 22.P7e S4b-4c 23.P7d G7b 24.P'1d Lx1d 25.B'3f Px7d 26.Bx1d P3e 27.R2f S3d 28.S6h G6c 29.N3g P7e 30.P8f G2b 31.L'5f G1c 32.N2e Nx2e 33.Bx2e Sx2e 34.Rx2e N'4f 35.K6i B'5h 36.K7i Nx3h+ 37.Gx3h S'6i 38.G8h G2d 39.R2i P7f 40.Rx6i Px7g+ 41.Sx7g N'6e 42.R6h Nx5g+ 43.N'7e +Nx6h 44.Kx6h B4i+ 45.Nx6c= Sx6c 46.P'5i N'6e 47.S6f R7b 48.Lx5c= P'5b 49.P'7g P'7f 50.Px7f Rx7f 51.S'7g B'5g 0-1 # # --------------------------------------------------------------------------- # # 38-th Oza Title Match, 2-nd game, September 13-th 1990. # Black: Tanigawa, Oi; White: Nakahara, Oza # 1.P7f P8d 2.S6h P3d 3.P6f S6b 4.P5f P6d 5.G7h S6c 6.G5h P6e 7.S7g Px6f 8.Sx6f P8e 9.G5h-6g P8f 10.Px8f Rx8f 11.S7e R8b 12.P'8d P'6d 13.Bx2b+ Sx2b 14.G7h-7g P7d 15.S6f N7c 16.R8h P'8e 17.G7h K4b 18.N7g Rx8d 19.B'9e R8c 20.P'8d R8a 21.Nx8e Nx8e 22.Rx8e P9d 23.N'7c Px9e 24.Nx8a+ N'3e 25.S4h B'3h 26.+Nx9a Bx2i+ 27.R'9b S5b 28.P8c+ +B3h 29.G5g B'5d 30.G7h-6g N'4e 31.G5h Nx3g+ 32.Sx3g +Bx3g 33.K6h Nx4g+ 34.Gx4g +Bx4g 35.K7g +B5h 36.P'6h S'7e 37.Sx7e Px7e 38.N'4f B6c 39.Rx7e P'8e 40.L'8i G'6e 41.Rx8e Bx8e 42.Lx8e S'7e 43.Px7e R'7f 0-1 # # Time used = Black: 4.45, White:3.19 # # --------------------------------------------------------------------------- # # 38-th Oza Title Match, 3-rd game, September 25-th 1990. # Black: Nakahara, Oza; White: Tanigawa, Oi # 1.P2f P8d 2.P2e P8e 3.G7h G3b 4.P2d Px2d 5.Rx2d P'2c 6.R2h P8f 7.Px8f Rx8f 8.P'8g R8d 9.S3h S7b 10.P7f P9d 11.P9f P1d 12.P4f R7d 13.G7g R2d 14.P'2e R8d 15.S4g P3d 16.P2d Px2d 17.Rx2d P'2c 18.R2h P6d 19.S3f P6e 20.K6h S6c 21.G5h G5b 22.P1f B3c 23.S4e S2b 24.P6f Px6f 25.S7h P2d 26.K7i S2c 27.Gx6f R8b 28.G5h-6g K4a 29.P3f P9e 30.Px9e P'9g 31.Lx9g S7d 32.N7g N9c 33.P3e P'6e 34.G6f-5f Px3e 35.P'3d B2b 36.P9d N8e 37.Nx8e B8h+ 38.Kx8h Rx8e 39.B'5e P'9f 40.Lx9f N'8d 41.N'3c Nx3c 42.Px3c+ Nx9f 43.K7i B'8h 44.K6h Bx5e+ 45.+Px3b Sx3b 46.Gx5e L'6f 47.P'3c Sx3c 48.B'2c K5a 49.S5f N'3f 50.R1h N8h+ 51.N'6d R9e 52.Nx5b+ Kx5b 53.G'8i +Nx8i 54.Sx8i R9i+ 55.N'6d K6b 56.B4e+ B'9e 57.K5h Lx6g+ 58.Sx6g B5i+ 59.K4g N'6c 60.G'7b K5a 61.+B2c S4d 62.+Bx2d K4a 63.Gx4d N4h+ 64.Rx4h G'3f 0-1 # # --------------------------------------------------------------------------- # # 38-th Oza Title Match, 4-th game, October 2-nd 1990. # Black: Tanigawa, Oi; White: Nakahara, Oza # 1.P7f P8d 2.S6h P3d 3.S7g S6b 4.S4h S4b 5.P5f P5d 6.G4i-5h G3b 7.P6f P6d 8.G6g S6c 9.P2f P5e 10.Px5e Bx5e 11.P2e B2b 12.G7h K4a 13.K6i P7d 14.S5g S5d 15.P2d Px2d 16.Rx2d P'2c 17.R2h R5b 18.P'5f G6b 19.K7i G6c 20.S7g-6h N7c 21.S4f P4d 22.P5e Sx5e 23.P7e Sx4f 24.Px4f Px7e 25.P'7d N8e 26.P8f S'5h 27.Px8e Sx6g+ 28.Gx6g P'5a 29.S'7h Px8e 30.B7g P8f 31.Bx8f G'8e 32.B7g P7f 33.B8h P'8g 34.Sx8g P'8f 35.S7h G7e 36.N'1e P2d 37.P'2e R8b 38.P'8e B3c 39.Px2d P'2b 40.P2c+ Px2c 41.Nx2c+ P'2b 42.+Nx3c Nx3c 43.P6e N'9e 44.Bx4d P8g+ 45.S'8d Gx8e 46.P'8c R5b 47.Sx9e P'8f 48.B7a+ Gx9e 49.P'5g S'8h 50.K6i +Px7h 51.Kx7h Sx8i= 52.K6i S'3i 53.R3h P8g+ 54.N'4d P7g+ 55.Sx7g N'5e 56.G6h N4g+ 57.Nx5b+ Px5b 58.R'6a N'5a 59.Rx3i +Px7g 60.Gx7g +Nx5g 61.R3h P'4h 62.S'6h S'4g 63.Sx5g Sx3h= 64.P7c+ G8f 65.+Px6c Gx7g 66.+Px5b K3a 67.+Px4b Gx4b 68.Rx5a+ G'4a 69.N'2c Px2c 70.N'4c K3b 71.G'2b 1-0 # # Time used = Black: 4.50, White:4.57 # # Black: Fukuzaki Bungo, challenger; White: Tanigawa Koji, Oza # 1.P7f(1) P8d(1) 2.P5f(3) P8e(5) 3.B7g P5d 4.R8h(1) P3d(2) 5.S6h S6b 6.K4h P7d(20) 7.P6f(9) K4b(2) 8.K3h K3b 9.K2h G6a-5b 10.G6i-5h(6) S5c 11.S5g(13) B3c(5) 12.L1h(3) K2b 13.K1i S3b 14.S2h P1d(3) 15.G3i(1) P2d 16.G6g(24) S2c(5) 17.S4f(1) P4d(3) 18.P5e(8) Px5e(6) 19.Sx5e(3) P'5d 20.S4f G3b 21.B6h(7) G5b-4c(4) 22.P3f(4) P6d(15) 23.N7g(3) P2e(1) 24.S4f-3g(10) P5e(26) 25.P8f Px8f 26.P'8e P4e(1) 27.Rx8f P'8c 28.P9f(18) S4d(18) 29.R8i(1) B1e(9) 30.R5i(1) P8d(2) 31.P1f Bx3g+(6) 32.Nx3g Px8e 33.P4f P8f(44) 34.Px4e S3c 35.B'7a(57) R5b(10) 36.Nx2e(4) P8g+ 37.N8e +P8f(16) 38.Nx3c+(14) G4cx3c 39.S'4a N'4g(7) 40.Sx5b=(4) Nx5i+ 41.Bx5i(1) R'6i 42.B7a-2f+(1) +Px8e(13) 43.N'2e(24) N'4g 44.Nx3c+(1) Nx3c(1) 45.S4a=(4) Nx3i+(3) 46.Sx3b+ Sx3b 47.Sx3i P'2e(4) 48.+B4h(7) Rx6g+(2) 49.G'2h(6) P2f(9) 50.P'5g(4) Px2g+(2) 51.Gx2g P'4g 52.+Bx4g(20) S'5h(4) 53.+B4f(1) +Rx6f 54.P'2c(15) Resigns(1) # # Time used black: 4.47; white: 4.10 # # --------------------------------------------------------------------------- # # 39-th Oza Title Match, 2-nd game, 17-th September 1991. # # Black: Tanigawa Koji, Oza; White: Fukuzaki Bungo, challenger # 1.P7f P3d(1) 2.P2f P4d 3.P2e B3c 4.S4h S4b(5) 5.P5f(1) R5b(1) 6.K6h K6b 7.K7h K7b(1) 8.G4i-5h K8b(2) 9.P3f(10) S4c(5) 10.P4f(4) G3b(4) 11.S5g(2) L9b(2) 12.N3g(44) R5a(12) 13.P9f(7) P5d(5) 14.P9e(12) K9a 15.B6f(3) S8b(1) 16.S8h(1) S5b(22) 17.R4h(36) G7a(5) 18.N7g S5c(7) 19.P4e (41) Px4e 20.Bx3c+ Nx3c 21.Nx4e Nx4e 22.Rx4e B'2g(19) 23.B'4g(8) N'3e(1) 24.B2i(4) Bx3f+ 25.R8e P'4f(21) 26.P'4h(2) R4a 27.N'7e(41) G7b(11) 28.P5e(1) P4g+ 29.Gx4g Nx4g+ 30.Bx4g +Bx4g(7) 31.Px4g B'7d 32.S6h(8) G'7a(12) 33.G7i(7) Rx4g+(4) 34.P9d Px9d 35.N'8f Bx8e(6) 36.Nx8e +R5f 37.S8h-7g(4) S6d 38.Nx9d(14) P'9h(40) 39.Lx9h(8) P'9g 40.Nx8b+ G7ax8b 41.P'9c Nx9c(2) 42.Nx9c+ Lx9c(6) 43.P'9d(11) Lx9d(6) 44.P'9b(5) Kx9b(11) 45.Nx6c+(1) N'8e(16) 46.+Nx7b Gx7b 47.S8f(5) N'6f(12) 48.Px6f P'6g 49.Sx8e(3) Px6h+ 50.Gx6h S'8i(27) 51.K7g R'7h(6) 52.K8f(2) N'7d 53.Sx7d S7e 54.Kx7e Px7d 55.K6d +Rx5e 56.K5c S'6b 57.K5b(1) Rx6h+ 58.Resigns # # Time used black: 4.45; white: 4.40 # # --------------------------------------------------------------------------- # # 39-th Oza Title Match, 3-rd game, 24-th September 1991. # # Black: Fukuzaki Bungo, challenger; White: Tanigawa Koji, Oza # 1.P7f(1) P8d(1) 2.S6h(6) P3d(1) 3.P6f S6b 4.G4i-5h S4b(1) 5.S4h P5d 6.G6g(1) G3b(1) 7.P5f(2) K4a 8.S7g P7d 9.G7h(2) G5b 10.B7i S3c 11.K6i(3) B3a 12.P3f(6) P4d(10) 13.B6h(12) G5b-4c(13) 14.K7i B6d 15.N3g(5) K3a(1) 16.K8h K2b 17.P2f P8e(5) 18.R3h(2) S5c(4) 19.P1f(2) P1d(9) 20.P4f(15) P5e(16) 21.S4g(1) S5d(3) 22.L1g(2) Px5f(20) 23.Sx5f N7c 24.R1h(18) P'5e(12) 25.S4g S2d 26.P2e(3) S3c(1) 27.P4e(20) Px4e(14) 28.P'4f P5f(83) 29.Gx5f(25) Px4f(2) 30.Sx4f(3) P'5e 31.G5g(25) P8f 32.Sx8f(1) P'4e 33.Nx4e(2) S4d 34.R4h P7e 35.G5g-6g(19) Px7f(1) 36.P'7d(21) N8e 37.Gx7f(3) P'7g(23) 38.Nx7g(2) Nx7g+ 39.Bx7g N'8d 40.S8e(23) Nx7f(4) 41.Sx7f N3c 42.P6e(7) G'7e 43.P7c+ Gx7f(5) 44.+Px8b B7e 45.R2h(2) B3i+(1) 46.R2g +B4i(1) 47.R'7b Nx4e(3) 48.P2d(7) +Bx2g(9) 49.Px2c+ Kx2c 50.P'2d Kx2d(7) 51.Rx3b+(1) Gx7g 52.Gx7g R'4h 53.Resigns # # Time used black: 4.02; white: 4.11 # # --------------------------------------------------------------------------- # # 39-th Oza Title Match, 4-th game, 1-st October 1991. # # Black: Tanigawa Koji, Oza; White: Fukuzaki Bungo, challenger # 1.P7f P3d(1) 2.P2f P4d 3.S4h S4b(3) 4.P5f P5d 5.K6h(3) S6b(4) 6.K7h(2) P7d(1) 7.S6h(2) R7b(7) 8.G4i-5h(6) P7e(6) 9.Px7e(2) Rx7e 10.S7g N7c(5) 11.P'7f(7) R7d 12.P6f N8e(4) 13.S8f(11) Rx7f(7) 14.K6g(8) R7b(1) 15.Sx8e P8d(1) 16.S9f(11) P4e(6) 17.P2e(53) B3c(11) 18.P2d(32) Px2d 19.S5g P6d(10) 20.K6h S6c(2) 21.P3f(9) G3b(5) 22.N3g(6) S4c 23.G6g(3) S7d(1) 24.P8f(2) S7e(19) 25.Nx4e(9) B4d 26.P'7f(19) Sx7f(2) 27.Gx7f Rx7f 28.S8g R7c(25) 29.S'5c(4) Bx5c(10) 30.Nx5c+ Rx5c 31.P6e P5e 32.Bx5e(2) Rx5e(22) 33.Px5e P'5f(5) 34.Sx5f G'6f(4) 35.N'5c(46) G5b(16) P5d(4) G3a(53) 37.P'2b(2) K4b(9) 38.Px2a+(3) B'5g 39.K7h(1) Gx5f +Px3a(2) S'6g(3) 41.K8h N'7e 42.P'7g(13) Nx8g+(4) 43.Kx8g B6f+ 44.N'7i(2) +Bx6e(3) 45.K8h +Bx5d 46.N4a+ K5c(1) 47.R'8c S'6c 48.N'7e P'7c(4) 49.Rx7c+(1) S'6b(4) 50.Nx6c+(1) +Bx6c 51.+Rx6c(1) Sx6c(1) 52.B'7a N'6b 53.S'4b(1) Gx4b(1) 54.+Nx4b P'7f(1) 55.+Nx4c(2) Kx4c 56.Bx6b+(1) Resigns # # Time used black: 4.31; white: 4.23 # # --------------------------------------------------------------------------- # # 39-th Oza Title Match, 5-th game, 14-th October 1991. # # Black: Fukuzaki Bungo, challenger; White: Tanigawa Koji, Oza # 1.P7f P8d(1) 2.P5f(2) P3d(8) 3.P6f(2) S6b 4.S6h P5d 5.R5h(1) K4b(2) 6.K4h K3b 7.K3h G6a-5b(6) 8.K2h(1) S5c(2) 9.L1h(2) B3c 10.K1i K2b 11.S5g P4d(1) 12.S4f(29) G4c(2) 13.P5e(1) P4e(14) 14.Sx4e(1) Px5e 15.S3f(6) S3b(6) 16.G7h(1) P8e(2) 17.B7g S5d 18.G6g(1) P2d(7) 19.P4f(4) S2c(4) 20.S2h(1) G3b(2) 21.G3i P7d(10) 22.P9f(14) P1d(3) 23.P9e(4) P2e(7) 24.S4g(3) P3e(10) 25.P3f(6) Px3f(1) 26.R3h(3) B4b(19) 27.G5g(10) P8f(15) 28.Px8f Bx8f 29.R8h(1) P'8g(1) 30.Rx8g(12) P'8e 31.P'8h(11) B4b(18) 32.B5i(15) P8f(2) 33.R6g P8g+ 34.Px8g P'8h 35.Sx3f(1) Px8i+(1) 36.P4e +Px9i(5) 37.G4f(1) B9g+(18) 38.B3g(9) R8e(2) 39.P'5f(1) +B7i(9) 40.Px5e(13) +Bx4f 41.Bx4f Sx5e 42.B6h(2) G'4f(6) 43.P8f(7) R8b(10) 44.Bx4f(15) Sx4f 45.G'5f B'7c(7) 46.P4d(7) G4c-3c(1) 47.Gx4f(43) Bx4f 48.P'3d Sx3d(2) 49.P'3e S2c 50.S'3d(5) B7c(9) 51.P'5e(6) P'4b(25) 52.Sx2c+(5) G3cx2c 53.S'3d S'3c(3) 54.Sx3c+(1) G2cx3c 55.S'3d(1) S'2c 56.Sx3c+ Gx3c 57.G'3d G'3b(2) 58.Gx3c Gx3c 59.G'3d G'3b 60.Gx3c Gx3c 61.G'3d G'3b 62.Gx3c Gx3c Sennichite # # Time used black: 4.08; white: 4.03 # # --------------------------------------------------------------------------- # # 39-th Oza Title Match, Replay 5-th game, 14-th October 1991. # # Black: Tanigawa Koji, Oza; White: Fukuzaki Bungo, challenger # 1.P7f P3d 2.P2f P4d 3.S4h S4b(5) 4.P5f P5d 5.G4i-5h G6a-5b(3) 6.S6h(2) S6b 7.S7g S3c 8.K6h K4b 9.K7h K3b 10.P6f B3a 11.G6g P7d 12.B7i S7c 13.S5g(1) G4c 14.P3f K2b 15.K8h G3b 16.G7h P8d(1) 17.N3g(1) P8e 18.S4f(2) S2d(1) 19.B6h(3) S6d(2) 20.B5g(9) P9d(10) 21.P1f N7c 22.P1e(2) P7e 23.Px7e R8d 24.P3e(7) P8f(6) 25.Sx8f Sx7e 26.Sx7e(5) Bx7e 27.P'7f B4b(1) 28.S'7e R8a(8) 29.Px3d(7) P'3f(3) 30.N2e(2) K3a(2) 31.S7d(6) P4e(1) 32.Sx4e(3) P3g+ 33.R1h +Px4g(9) 34.B6h(1) P'4d 35.S3f +P3g(3) 36.S3e S'2g(1) 37.Sx7c=(2) Sx3e 38.Bx3e Gx3d(2) 39.B6h(1) Sx1h= 40.P'4c Gx4c 41.S'8b(1) R4a(1) 42.Lx1h R'3h 43.P'3c(1) Nx3c 44.Nx1c+ K3b 45.N'3e(4) Lx1c 46.P1d(2) Gx3e 47.Px1c+ P'8f 48.Bx3e(1) N'9f 49.K7i B3a 50.S'2b(1) S'8h 51.K6i Bx2b 52.+Px2b Kx2b 53.L1c+ K3b 54.Gx8h Nx8h+ 55.+Lx2c Kx2c 56.S'2d K3b 57.G'2c K4b 58.Sx3c+ Gx3c 59.Gx3c Kx3c 60.G'2d K2b 61.N'3d K3b 62.P'3c K4c 63.Resigns # # Time used black: 1.04; white: 0.59 # # 40-th Oza Title Match 1992 (professional, no comment). # Black: Habu Yoshiharu, challenger; White: Fukuzaki Bungo, Oza 1.P2f P8d(1) 2.P2e P8e 3.G7h G3b 4.P2d Px2d 5.Rx2d P'2c 6.R2f S7b 7.P1f(2) P3d(3) 8.P1e(3) P6d(1) 9.R3f(22) G3c(3) 10.S3h(25) S6c(5) 11.P7f(1) P8f(2) 12.Px8f Rx8f 13.P'8g(2) R8b(10) 14.R2f S5d(3) 15.P3f G3b(1) 16.N3g B4d(3) 17.Bx4d(6) Px4d 18.S8h S6e(14) 19.P3e(31) Px3e(10) 20.B'5e(13) R4b(23) 21.P1d(3) Px1d 22.P'1c Lx1c(6) 23.N2e(27) S2b(4) 24.N7g(1) S7d(3) 25.Bx6d K5b(7) 26.Nx1c+(14) Sx1c(2) 27.L'8b(2) S6c(11) 28.B2h(1) G7a(9) 29.Lx8a+ Gx8a 30.Bx7c+ B'8b(13) 31.+Bx8b(2) Gx8b 32.P'2b(2) N3c(2) 33.P2a+(13) N'3d(27) 34.R6f(40) P'6e(35) 35.Rx6e(22) P'6d(15) 36.R7e(1) P'7d(6) 37.R5e(1) P5d(4) 38.R5f(3) R4a(6) 39.P7e(7) Px7e(1) 40.P'7d(1) Sx7d(5) 41.Rx5d(5) L'5c(3) 42.B'5f(1) G7c(10) 43.Bx3d G4c 44.Rx4d(5) Gx3d 45.Rx4a+ Kx4a 46.R'7a K3b(7) 47.Rx7c+ P'5b 48.N'5e(4) N4e(4) 49.G'4c(2) Kx2a 50.+R7a K1b 51.G3b R'2b 52.Gx2b(1) Sx2b 53.N'2f(1) K1c(7) 54.Nx3d(2) B'2f 55.P'3g(1) Nx3g= 56.R'1b(1) Resigns # Time used black: 4.28; white: 4.26 # # --------------------------------------------------------------------------- # # 40-th Oza Title Match, 2-nd game, 14-th September 1992. # # Black: Fukuzaki Bungo, Oza; White: Habu Yoshiharu, challenger 1.P7f(1) P8d 2.S6h P3d 3.P6f S6b 4.G4i-5h(1) S4b 5.S4h G3b 6.G6g K4a 7.G7h P5d 8.K6i G5b 9.P5f(1) P4d(1) 10.S7g S3c 11.B7i B3a 12.P3f P7d(10) 13.S3g(9) B6d(1) 14.B6h(2) G5b-4c(1) 15.K7i(1) K3a 16.K8h P8e(1) 17.P1f(1) K2b(1) 18.P2f(2) P9d(3) 19.P1e S7c(1) 20.S4f(1) P7e(1) 21.Px7e P4e 22.S3g(1) Bx7e 23.P'7f(1) B6d(3) 24.P2e(9) P9e(6) 25.P4f(6) Px4f(2) 26.Bx4f P'4d(1) 27.R4h(4) S7d(12) 28.P3e(5) Px3e(1) 29.Bx6d(5) Px6d(10) 30.P'4e Px4e(1) 31.B'7a R8c(1) 32.P2d(1) Px2d(18) 33.Bx3e+(3) P8f 34.Sx8f(1) P6e 35.P'2c(23) Gx2c(3) 36.+Bx4e Px6f(36) 37.Gx6f(48) B'5g(1) 38.G6f-6g Bx4h+(1) 39.Sx4h P'6f(6) 40.G6g-6h S6e(13) 41.B'7b(22) R8b(6) 42.B6a+(1) R4b(7) 43.+B5a(2) Sx7f(14) 44.P'4d(74) P6g+(1) 45.G6hx6g Sx6g+(8) 46.Gx6g R'5h 47.P'6h(2) Rx4h+(1) 48.Px4c+(2) Rx4c 49.P'4d(14) R6c(15) 50.G'3b(16) K1b 51.+Bx2c(1) Kx2c 52.Gx3c Nx3c(7) 53.+B4a(7) S'3b(19) 54.+Bx3b(10) Kx3b(4) 55.S'4c Rx4c 56.Px4c+ Kx4c(2) 57.S'3e(8) B'6f(42) 58.S'7g(2) S'7i(1) 59.Kx7i +R3i 60.G'6i(10) G'5h 61.S'7h(1) Gx6i(2) 62.Sx6i G'5h(2) 63.R'6c(1) K3b(1) 64.G'4c K2a 65.P'2b K1b 66.Resigns # Time used black: 4.59; white: 4.27 # # --------------------------------------------------------------------------- # # 40-th Oza Title Match, 3-rd game, 22-nd September 1992. # # Black: Habu Yoshiharu, challenger; White: Fukuzaki Bungo, Oza 1.P2f P8d(1) 2.P2e(1) P8e 3.G7h(2) G3b 4.P2d Px2d 5.Rx2d P'2c 6.R2f S7b 7.P9f(1) P1d(1) 8.P7f P8f(5) 9.Px8f Rx8f 10.N7g S4b(1) 11.K4h(1) P9d(3) 12.S3h(1) K4a(2) 13.B9g(13) R8b(6) 14.P7e P3d(2) 15.R8f(5) P'8e(13) 16.R7f(6) G6b(2) 17.S6h(2) P6d 18.P6f(6) S6c(17) 19.S6g K3a(16) 20.S5f(1) R8d 21.S4e(13) P3e(1) 22.K3i(1) P1e(10) 23.G6h(29) G7b(17) 24.G6h-5h(30) P7d(9) 25.Px7d(41) Sx7d 26.P'8f(2) P'7e(25) 27.Px8e R8b 28.Bx7e(4) Sx7e 29.Rx7e Bx6f(3) 30.R7f B5e(2) 31.S'8c(4) Gx8c(7) 32.R7a+(3) K2b 33.P8d B'6c(15) 34.S3d(5) S'3c(1) 35.Sx3c+(1) Sx3c 36.Px8c+(14) Rx8c 37.P'2d S'3d(7) 38.P'8d(14) R7c 39.+Rx7c Nx7c 40.R'6b B5d(14) 41.S'4a(1) G4b(10) 42.G'3b(6) K1c 43.Gx4b(1) Bx7g+(3) 44.G3b(19) N'2f(17) 45.Gx2a(17) R'8i(15) 46.N'5i(6) Nx3h+(10) 47.Kx3h S'2f 48.Gx1a(8) B2g+(6) 49.K3i(1) P3f(9) 50.R1b+(4) Kx2d 51.L'2h +Bx2h(36) 52.Kx2h +B5e(4) 53.P4f(18) L'2g(3) 54.K3h(1) Lx2i+(3) 55.Px3f S2b(2) 56.B'4b(2) S3c 57.Bx5c+(5) +L2h(1) 58.Kx2h(3) +Bx4f 59.K2i +Bx3f 60.G'1d(3) +Bx1d 61.+Bx2f G'2e 62.N'3f Gx3f 63.+Rx1d Kx1d 64.+Bx3f N'2e 65.P1f(1) N'3g 66.K3h Nx4i+ 67.Px1e Resigns # Time used black: 4.56; white: 4.59 # # Black: Tanigawa Koji; White: Morishita Taku. 1.P7f P8d 2.P2f(1) P8e(1) 3.B7g P3d(1) 4.S8h G3b(3) 5.G7h Bx7g+ 6.Sx7g S4b 7.S3h(1) S7b(2) 8.P4f(1) P6d(1) 9.S4g S6c 10.P6f(3) P4d(2) 11.G5h(3) G5b(3) 12.K6h(1) K4a(3) 13.K7i(1) K3a(2) 14.P3f(1) P7d(5) 15.S5f(4) S5d(1) 16.P9f P1d(16) 17.P1f(7) P9d(10) 18.N3g(6) N7c(30) 19.P2e(21) S3c(9) 20.P4e(95) Px4e(30) 21.P3e S4d(22) 22.P7e(17) Px7e(10) 23.P2d(1) Px2d 24.Rx2d P'2c(1) 25.R2h G6c(34) 26.B'6a(17) Px3e(12) 27.B3d+(25) S4c(5) 28.+B2e(4) B'5d(40) 29.G5h-6g(5) N3c(4) 30.+B5h(31) S3d(21) 31.R2i(5) P9e(45) 32.Px9e(54) P7f(7) 33.Gx7f(2) P'7e 34.Gx7e P8f 35.Px8f(25) P'9h(1) 36.Lx9h Bx9h+ 37.P'7d P3f(18) 38.Px7c+(3) Gx7c 39.P'7d G6c 40.N'2f S3d-3e(13) 41.P'3d(2) Px3g+ 42.Px3c+ Gx3c(1) 43.P'3d(18) G3b(1) 44.N'5e G5d(40) 45.G8h +B9i(3) 46.K7h R9b(3) 47.P7c+(10) +P3h(26) 48.R6i(1) P'8g(6) 49.Gx8g(16) Rx9e(5) 50.+B7f(1) N'8d(15) 51.P'9f(8) Nx7f 52.Px9e B'2e 53.P'4g(2) Sx2f 54.K6g P'8h 55.Kx7f(3) Px8i+ 56.R'8b(2) Bx3d(2) 57.+P6c(3) P'7d(10) 58.Gx7d P'7c 59.+Px7c(8) K2b 60.N6c+(1) K3c(4) 61.K7e P'3f(3) 62.+Nx6d(1) Gx6d 63.Gx6d N'5b 64.G7d(2) K2d 65.R8a+ P3g+(3) 66.+Rx9a K3e 67.K8d(6) L'5d 68.+R4a G4c(1) 69.+Rx5b(2) Lx5f 70.Px5f S'7h 71.S8h(1) +B9h 72.L'9i +Bx8g 73.Sx8g Sx6i+ 74.P9d +Px9i 75.K8c K3f 76.P9c+ Kx4g Jishogi. # Black: Morishita Taku; White: Tanigawa Koji. # 1.P7f P8d(1) 2.S6h(1) P3d 3.S7g S6b 4.P5f(1) P5d 5.S4h S4b 6.G4i-5h(2) G3b 7.P6f K4a 8.G6g P7d(5) 9.G7h(10) G5b 10.K6i(1) S3c(3) 11.B7i(6) B3a(1) 12.P3f(1) P4d(1) 13.B6h(26) G5b-4c(13) 14.K7i(3) B6d(8) 15.N3g(2) K3a 16.K8h(7) K2b(7) 17.P2f(9) P8e(10) 18.R3h(5) S5c(10) 19.P1f(14) P1d(21) 20.P4f(20) P5e(16) 21.Px5e(30) Bx5e 22.G5f B7c(5) 23.G6e R8d(1) 24.S4g(1) S6d(46) 25.Gx6d(17) Bx6d(2) 26.R5h(4) P'5d(10) 27.S5f(5) P7e(23) 28.Px7e(11) Bx7e(6) 29.P'7f(12) B3a(23) 30.N2e(45) S2d(1) 31.P4e(10) Px4e(32) 32.Sx4e(44) P'4d(10) 33.S5f P8f 34.Sx8f(22) B6d(1) 35.P'4f(1) R8b(27) 36.S'6g(4) N7c(10) 37.S7e(11) B5c(23) 38.B9e(11) B6b(1) 39.S7d(6) P'7g(13) 40.Bx7g(16) G'6d(2) 41.S7d-6e(2) Gx6e(21) 42.Px6e N8e 43.B6f(7) S'6i 44.R5i(6) Sx7h+ 45.Kx7h B7c(7) 46.S'5g(27) P6d(24) 47.Px6d(2) Bx6d(2) 48.G'6e(18) P'7g(9) 49.Nx7g(1) Nx9g+ 50.Gx6d Rx8g+ 51.K6i +R8h 52.S6h +N8g(1) 53.K5h(6) G'7h(1) 54.Sx7h(1) +Nx7h 55.G'6g S'6i(15) 56.Rx6i +Nx6i 57.Kx6i +Rx9i 58.K5h(1) L'5e(4) 59.Sx5e(4) Px5e 60.L'7i(1) Sx2e(1) 61.Px2e(2) N'5f 62.Gx5f(2) Px5f 63.S'4h(1) R'2g(3) 64.N'4g(6) S'5g(1) 65.S4hx5g(5) Px5g+ 66.Kx5g P'5e 67.B'7d(5) P'7c(1) 68.Gx7c(4) G'6d 69.N'4h(3) Gx7d(2) 70.Gx7d B'2i(3) 71.S'5h S'3h 72.Resigns. # Black: Tanigawa Koji; White: Morishita Taku. # 1.P7f P8d(1) 2.S6h(2) P3d(1) 3.S7g S6b(1) 4.S4h P5d(1) 5.P5f S4b 6.G4i-5h(6) G3b(2) 7.P6f(2) K4a(3) 8.G6g P7d(2) 9.G7h(5) G5b(2) 10.K6i S3c 11.B7i(2) B3a(7) 12.P3f(10) P4d(4) 13.S3g(9) B6d(17) 14.B6h(10) G5b-4c(8) 15.K7i(4) K3a(1) 16.K8h P8e(11) 17.P1f(10) K2b(14) 18.P2f(7) S7c(25) 19.S4f(6) P7e 20.Px7e(23) P4e(56) 21.S3g Bx7e 22.P'7f(15) B5c(30) 23.P4f(20) Px4f(1) 24.Sx4f P'4e 25.S3g S7d(1) 26.R4h(23) P6d(44) 27.Rx4e(59) P6e(8) 28.R4g(30) P8f(26) 29.Px8f(6) N7c(16) 30.B4f(12) R8c(1) 31.S4h P'4e(12) 32.B2h(1) Px6f(15) 33.Gx6f(14) S6e(33) 34.S5g(43) P'8e(3) 35.G6f-6g(3) P5e(2) 36.Bx5e Bx2f(27) 37.P'4h(31) S5d(11) 38.B2h N6e(1) 39.S5g-6f(13) Nx7g+(5) 40.G6gx7g S'4f(2) 41.B1g(8) Sx4g=(5) 42.Bx2f Sx5f+(13) 43.B'7d(9) +Sx6f 44.Bx8c+ +Sx7g 45.Kx7g R'6i(3) 46.P'2d(2) S'6f(16) 47.K8h P'7g 48.Px2c+ Kx2c 49.N'1e(12) K1b 50.+B5f Px8f(6) 51.R'8b(1) Px7h+(2) 52.+Bx7h G'8g 53.Resigns. # Time black: 6.38; time white: 7.19. # # --------------------------------------------------------------------------- # # 4-th Ryu O Tournament, 4-th game, 26-th & 27-th November 1991. # # Black: Morishita Taku; White: Tanigawa Koji. # 1.P7f P8d 2.S6h(2) P3d(1) 3.S7g S6b 4.P5f(1) P5d 5.S4h(1) S4b 6.G4i-5h(1) G3b(2) 7.P6f(1) K4a 8.G6g P7d(5) 9.G7h(5) G5b 10.K6i(2) S3c(3) 11.B7i(3) B3a 12.P3f(1) P4d(6) 13.B6h(5) G5b-4c(14) 14.K7i(1) S7c(7) 15.K8h(22) P9d(8) 16.P3e(27) Px3e(22) 17.Bx3e P7e 18.Px7e(9) Bx7e(1) 19.P6e(3) K3a(9) 20.R3h(24) K2b(5) 21.B4f(4) R9b(10) 22.S5g(2) B4b(4) 23.S5g-6f(1) P9e(33) 24.P1f(36) P1d(70) 25.P'7e(40) P8e(17) 26.P2f(39) S8d(14) 27.N1g(6) P4e(13) 28.B5g(9) S4d(5) 29.P4f(34) Px4f(3) 30.Bx4f P'4e 31.B6h P'3e(8) 32.S7f(4) P2d(17) 33.P2e(12) Px2e(13) 34.P5e(11) Px5e(47) 35.B7g(5) P'7d(1) 36.Sx5e(2) Sx5e(2) 37.Bx5e S'4d 38.B6f(3) Px7e(3) 39.P'5c(13) Bx5c(19) 40.P'5d(19) Gx5d(1) 41.P'2d(23) K3c(22) 42.Rx3e(11) P'3d(1) 43.Rx2e P'2b(2) 44.P6d(10) Px6d(9) 45.S'6c(3) G4c 46.Sx5d+(10) Gx5d 47.G'6c(1) B3a(5) 48.P'4b(1) Bx4b(6) 49.P'5c(5) N1c(13) 50.R2i(5) P6e(6) 51.Sx6e(14) Gx6e 52.P5b+ Gx6f(1) 53.+Px4b(11) S'2h(7) 54.Rx2h(12) Gx6g 55.B'6d(3) B'3i(7) 56.P2c+(2) Px2c 57.+P4c Kx4c 58.Rx2c+ G'3c 59.G5c Sx5c 60.Bx5c+ Kx5c 61.+Rx3c G'4c(3) 62.S'4d(2) K6b 63.G'6c(3) K7a 64.+R3a(2) P'6a 65.Gx6g(1) P8f 66.S'7d(1) Px8g+(26) 67.Kx8g S'8c 68.Sx8c+(2) B'6e 69.K7h Bx8c 70.P'8e S'7f 71.Px8d(4) Sx6g+ 72.Kx6g B9d 73.K5f(1) G'7b(2) 74.Gx7b(3) Rx7b 75.S'6c(1) Gx4d(3) 76.Sx7b+ Bx7b 77.S'8b(1) Resigns. # Time black: 7.58; time white: 7.56. # # --------------------------------------------------------------------------- # # 4-th Ryu O Tournament, 5-th game, 4-th & 5-th December 1991. # # Black: Tanigawa Koji; White: Morishita Taku. # 1.P7f P8d(1) 2.P2f P8e(1) 3.B7g P3d(1) 4.S8h G3b 5.G7h Bx7g+(4) 6.Sx7g S4b 7.S3h S7b(2) 8.P4f P6d(1) 9.S4g S6c 10.P6f P4d(2) 11.G5h(1) G5b 12.K6h K4a 13.K7i K3a(1) 14.P3f(3) P7d(2) 15.S5f(1) S5d(1) 16.P9f(14) P1d(7) 17.P1f(11) P9d(6) 18.N3g(66) N7c(23) 19.P2e(33) S3c(13) 20.P4e(51) Px4e(11) 21.P3e S4d(48) 22.P2d(3) Px2d 23.Rx2d P'2c(3) 24.R2h P6e(83) 25.Px6e(26) Nx6e(1) 26.S6f(35) B'6d(3) 27.B'5i(14) G5b-4c(10) 28.S5fx6e(13) Sx6e 29.Sx6e B5e 30.S'7g P8f(13) 31.Px8f S'3f(2) 32.G4h(5) P4f(5) 33.S5f(4) B7c 34.P'4e(13) Sx3e(32) 35.P'6d(26) P'8g(31) 36.N'4d(9) B8d(21) 37.N2e(21) P2d(17) 38.P8e(8) B5a(1) 39.S8f(5) Px2e(6) 40.B7g B3c(10) 41.P6c+ P2f(23) 42.Gx8g(1) P'6g(14) 43.P'2d(2) P2g+(3) 44.Nx3b+(19) Rx3b 45.P2c+ +Px2h 46.+Px3b(6) Kx3b 47.P'2d Sx2d(1) 48.R'6b Resigns(2). # Time black: 6.30; time white: 6.45. # # --------------------------------------------------------------------------- # # 4-th Ryu O Tournament, 6-th game, 17-th & 18-th December 1991. # # Black: Morishita Taku; White: Tanigawa Koji. # 1.P7f P8d 2.S6h(2) P3d(1) 3.S7g S6b(1) 4.P5f(1) P5d 5.S4h S4b(1) 6.G4i-5h G3b 7.P6f K4a 8.G6g P7d(2) 9.G7h(6) G5b(6) 10.K6i(2) S3c(6) 11.B7i(3) B3a(1) 12.P3f(7) P4d(1) 13.B6h(11) P9d(13) 14.K7i(49) P9e(11) 15.K8h(11) L9c(21) 16.P3e(15) Px3e(40) 17.Bx3e N7c 18.R3h(68) B6d(33) 19.B4f(3) Bx4f(27) 20.Px4f B'4i 21.R2h(1) B5h+ 22.G5g(1) +B2e(9) 23.S4g(2) P6d(1) 24.P2f(4) +B4c(2) 25.G5g-6g(1) +B4b(45) 26.N3g(42) G5b-4c(2) 27.P1f(2) P8e(14) 28.R2i(18) K3a(17) 29.P2e(17) P6e(18) 30.Px6e(7) P8f(1) 31.Sx8f(3) Nx6e 32.B'6f(7) R8c(3) 33.P2d(10) Px2d(12) 34.P'2e(5) P5e(24) 35.Px2d(16) Sx2d 36.P4e P'2g(15) 37.Rx2g(38) P'8e(19) 38.Sx8e Rx8e 39.Bx9c+ P'8f(19) 40.Px8f(7) P'8g(1) 41.Gx8g(3) +Bx8f(1) 42.Gx8f(1) Rx8f 43.P'8g S'7i(1) 44.Kx7i(14) Rx8g+ 45.K6h +R8h(17) 46.L'7h(2) +Rx8i 47.Px4d(1) G5c(59) 48.Rx2d(27) P'2c 49.S'4c(11) Px2d(7) 50.Sx3b+ Kx3b 51.S'4c Gx4c 52.Px4c+ Kx4c 53.P'4d Kx4d(1) 54.P'4e K5c(2) 55.G'4d(1) K4b 56.G'4c K5a(1) 57.G5b Kx5b 58.B'4c K5a 59.Bx6e+ P'6f(1) 60.Resigns. # Time black: 7.07; time white: 7.37. # # --------------------------------------------------------------------------- # # 4-th Ryu O Tournament, 7-th game, 26-th & 27-th December 1991. # # Black: Tanigawa Koji; White: Morishita Taku. # 1.P7f P8d 2.S6h(1) P3d 3.S7g S6b(1) 4.S4h P5d 5.P5f S4b(1) 6.G4i-5h G3b(1) 7.P6f K4a(1) 8.G6g P7d(4) 9.G7h(20) G5b(8) 10.K6i S3c 11.B7i B3a(2) 12.P3f P4d(3) 13.B6h(4) G5b-4c(20) 14.K7i(2) B6d(4) 15.N3g(2) K3a(4) 16.K8h(9) K2b(2) 17.R3h(7) P8e(16) 18.P1f(14) S7c(39) 19.S5g(39) S8d(3) 20.P6e(14) B4b(4) 21.S5g-6f N7c(17) 22.N2e(17) S2d 23.P2f P6d(30) 24.B4f(93) R6b(4) 25.Bx6d(10) Bx6d(25) 26.Px6d Rx6d 27.P9f(2) P'6e(38) 28.S5g P7e(1) 29.Px7e(1) Sx7e 30.P'7f S8d(1) 31.B'7b(23) P8f(59) 32.Px8f(4) P'8e 33.B8c+(12) P4e(43) 34.P7e(72) Px8f(37) 35.P7d S7e(1) 36.+Bx7c Sx2e(43) 37.Sx8f(43) Sx8f(21) 38.+Bx6d S'7e 39.+Bx6e(1) P'8g(7) 40.K7i(7) Sx2f(20) 41.R'8b(2) P4f(10) 42.N'5e(13) G4c-4b(3) 43.+Bx5d P'5b 44.+Bx3b Kx3b(1) 45.G'4c K2b 46.Gx4b P1d(2) 47.G3b(1) K1c 48.P1e Px4g+(1) 49.Px1d Resigns. # # 1.P7f P8d 2.S6h P3d 3.S7g S6b 4.S4h P5d 5.P5f S4b 6.G4i-5h G3b 7.P6f K4a 8.G6g P7d 9.G7h [ 9.K6h now is dangerous because white can build a formation with P6d, S6c, N7c,S4d, P8e, G5b and attack with P5e and P6e. ] 9... S3c 10.K6i G5b 11.B7i B3a 12.P3f P4d 13.S3g B6d [ 13... G5b-4c is playable for white but dangerous because of 14.P3e ] 14.P6e B4b [ 14.B6h is more common than 14.P6e. If 14... B7c? instead of 14... B4b then 15.P7e Px7e 16.S6f R7b 17.Sx7e! Bx3g+ 18.Nx3g Rx7e 19.B'8b is better for black.] 15.P5e [ This position but with a black pawn on 2f and a white one on 8e is old- fashioned and was played some 20 years ago. Black gained nothing from this opening, but without the exchange of P2f and P8e it is better for black of course. ] 15... S5c [ 15... Px5e? 16.S4f G5b-4c 17.Sx5e P'5d 18.S5e-6f gives black a clear positional advantage. ] 16.R5h G3b-4c!? [ 16... G5b-4c and 16... Px5e are found in professional games. Two weeks before this game Morishita played 16... G3b-4c against Yonenaga. The game continued 17.S4f P8e 18.N3g N7g 19.P7e R8d 20.S7f P6d 21.B5g Nx6e, resulting in an equal position. ] 17.Px5d Sx5d 18.S6f G4c-5c 19.S4f K3b [ 19... S4c is a typical positional mistake: 20.S4f-5g K3b 21.S5f and 22.B4f follow with a better position for black. ] 20.P'5e S4c 21.S4f-5g P6d 22.Px6d N7c! 23.N7g Gx6d 24.P'6e G6d-6c (equal) 25.S5f P8e 26.N3g P9d 27.P2f P9e 28.G8h P8f 29.Px8f Rx8f 30.P'8g R8c 31.K7h L9d 32.B4f R9c 33.P5d Gx5d 34.S5f-5e Gx5e 35.Sx5e P9f 36.Px9f Lx9f 37.P'5c Bx5c 38.Lx9f Rx9f 39.L'5d R9i+ 40.G8i S'6i 41.Kx6i +Rx8i 42.G'7i +R9i 43.Lx5c+ Gx5c 44.S6d Gx6d 45.Bx6d L'5d 46.S'5e [ 46.Rx5d? Sx5d 47.G'3a K2b 48.B'3b G'7h 49.Kx7h R'8h and 46.N2e? G'5i! 47.K7h S'6i 48.Gx6i +Rx6i 49.K8h +Rx5h 50.S'6h G'7h both lead to mate. ] 46... P'5g 47.Rx5g S'8h?? [ 46... S'4i is another winning possibility. 47... L'7h instead of S'8h leads to a certain win for white: 48.Kx7h S'8h and now a) 49.L'8i Sx7i+ 50.Kx7i G'8h, b) 49.B'6h Lx5e 50.Rx5e P'5d or c) 49.G6i +R9h. ] 48.N2e +Rx7i 49.K5h G'4a 50.B'6c G'5b? [ According to "Shukan Shogi" Habu still had chances to keep fighting after 47... S'8h??, but 50.G'5b seems the same as resigning. After 50... L'5b 51.Sx5d Sx5d 52.Rx5d S'4c! the situation is still unclear. Moreover, Tanigawa's king is in a very bad position. ] 51.Sx5d Gx6c 52.Sx4c+ Kx4c 53.Nx3c+ Kx3c 54.S'4b Gx4b 55.Bx4b+ Kx4b 56.G'3b Resigns. # Time used: Black 7:31, White 7:58. # # ----------------------------------------------------------------------- # # Ryu O Title Match 1990, Game 2: Habu Yoshiharu - Tanigawa Koji. # 31 October & 1 November 1990. Comment by Katsuhiko Murooka. # 1.P7f P8d 2.S6h P3d 3.S7g S6b 4.P5f G3b 5.S4h K4a 6.G4i-5h G5b 7.P6f P6d 8.P2f S4b 9.G6g P7d 10.G7h S6c 11.K6i N7c 12.P2e S3c 13.B7i P8e 14.P3f P5d 15.S3g [ Alternatives are 15.P4f or 15.P3e Px3e 16.Bx3e S4d and now e.g. a) 17.P2d? Sx3e! 18.Px2c+ B4d 19.+Px3b Kx3b 20.P'3c Nx3c 21.G'2b K4a!, which is very good for white, Takahashi - Y. Sato 0-1, 1988 or b) 17.B6h P5e 18.Px5e P6e 19.P2d Px2d 20.P'2c Gx2c 21.Bx2d K3b, unclear, Y. Sato - H. Nakada 1-0, 1988. ] 15... S4d 16.P2d Px2d 17.Bx2d P'2c 18.B1e P6e [ 18... P5e? 19.Px5e P6e and a) 20.B2f P3e 21.S4f Sx5e 22.Sx5e Bx5e 23.S'4f B2b 24.Bx3e or b) 20.S4f Sx5e 21.Sx5e Bx5e 22.B3g Bx3g+ 23.Nx3g. Both variations favour black. ] 19.Px6e Nx6e 20.S6f P'6d [ 20... S5c 21.P'2d Px2d 22.P'2c B4d 23.Bx2d P8f 24.B4f P'6d 25.Px8f P7e gives black a small edge, Morishita - Moriuchi 1-0, 1988. ] 21.S4f P8f 22.Px8f Rx8f 23.P'8g R8a 24.B2f P1d 25.P1f [ 25.N3g P3e 26.Sx3e Sx3e 27.Bx3e B4d 28.Bx4d Px4d 29.Sx6e Px6e 30.P'6d is good for black, Takahashi - Tanigawa 1-0, 1988 or 25.K7i P2d?! 26.P1f G2c 27.B5i P9d 28.P9f K3b 29.B6h gives black a slightly better position, Y. Sato - Murayama 1-0, 1990. ] 25... P9d 26.P9f (adjourned) [ My opinion of the adjourned position is that black stands a bit better. ] 26... P2d 27.K7i G2c 28.B5i K3b 29.B6h B3c 30.K8h B5a 31.P3e Px3e 32.Sx3e Sx3e 33.Bx3e P'8f [ After 33... P'3d 36.B6h B3c 35.P5e P7e 36.P'2e Px2e 37.N3g black stands slightly better, Y. Sato - Murayama 1-0, 1990. ] 34.Px8f P'8e 35.R3h [ 35.Px8e?? Rx8e 36.P'8f N7g+ followed by 37... Rx3e and white wins. ] 35... B3c 36.Px8e S'2g 37.R3g S2h= 38.R3f Sx1i+ 39.B6h +Sx2i 40.P'2e N'5g! 41.S'3e?! [ After 40.N'5g the position is unclear, although black still has a slight edge. 41.S'3e is inaccurate, however, and should have been 41.P5e.] 41... N6i+ 42.B8f L'8c 43.Px2d G2b 44.N9g P9e 45.Px9e P7e 46.S3d Bx2d 47.P'2c?! [ 42.R2f P'2d 43.Rx2i is better. ] 47... G3c 48.P2b+ K2b 49.Sx3c Bx3c 50.P'2d P'9f 51.G'2c? [ I think 51.R2f Bx2d 52.Rx2d P'2c 53.Rx2i is better than what happened in the game. ] 51... K3a 52.Gx3c Px9g+ 53.Lx9g [ According to "Shukan Shogi" and the TV program "Go & Shogi weekly" Habu's 53.Lx9g was the losing move. Habu should have played 53.Kx9g followed by 53... Nx3c 54.Rx3c+ P'3b 55.N'2c K4a 56.+R2b with chances for both players. ] 53... Nx3c 54.P2c+ P'3b 55.B'2d G4b! 56.+Px3b Kx3b 57.P'3d P'3e 58.Rx3e S'4d 59.Px3c+ Sx3c 60.Bx3c+ Gx3c 61.P'3d G2c 62.P'2d P'8g 63.Kx8g Lx8e 64.Px2c+ K4a 65.Sx7e Lx8f 66.Sx8f Rx8f 67.Kx8f N'7d 68.Resigns. # Time used, black: 7:38, white 7:35. # # ----------------------------------------------------------------------- # # Ryu O Title Match 1990, Game 3: Tanigawa Koji - Habu Yoshiharu. # 8 and 9 November 1990. Comment by Katsuhiko Murooka. # 1.P7f P8d 2.P2f P8e 3.B7g P3d 4.S8h G3b 5.G7h Bx7g+ 6.Sx7g S4b 7.S3h S7b 8.P4f P6d 9.S4g S6c 10.G5h G5b 11.K6h K4a 12.S5f S5d 13.P6f P4d 14.P3f P7d 15.K7i K3a 16.N3g P1d 17.P1f G5b-4c 18.K8h P9d 19.P9f S3c 20.R4h K2b 21.P4e [ Alternatives: --21.B'2h!? S4b 22.P6e Sx6e 23.Sx6e Px6e 24.P4e S'2g 25.Px4d G4c-3c 26.N2e Sx2h= 27.Nx3c+ Nx3c 28.S'4c P'4e 29.Sx3b+ Kx3b 30.P3e S3g+ 31.R4i N'8f (slight advantage white), Maruta - Nakahara 0-1, 1986. --21.L1h!? G4c-4b 22.B'1i!? B'2g 23.G4g P1e 24.N2e Px1f 25.P4e P1g+ 26.Bx6d R9b 27.Nx3c+ Kx3c 28.Px4d Bx1h+ 29.P'1b Lx1b 30.Rx1h+ +Px1h 31.B'1a (slight advantage black, but what if 21... K3a!), Tanigawa - Nakahara 1-0, 1986. ] 21... Px4e 22.B'4a S4d [ 22... B'9b? 23.Sx4e Sx4e 24.Nx4e S4d 25.B6c+ and black stands better, after 22... R7b black would have the better position, too. 22... P1e!? 23.Px7e P6e 24.Px6e P4f 25.B1d+ R6b is unclear. Maybe white stands a bit better, Tanigawa - T. Tanaka 1-0, exhibition game 1986. 22... P7e!? 23.B7d+ Px7f 24.Sx7f P6e 25.P1e Px1e 26.+B6d P'7c 27.P'1c and black stands slightly better, Morishita - Oshima 1-0, 1990. ] 23.Bx7d+ P3e 24.+Bx6d B'7c 25.+Bx7c Nx7c 26.B'6d R8c (26... R7b?!) 27.Sx4e [ If 27.Nx4e then 27... P'4f 28.Bx4f P4e 29.Px9e S5dx4e 30.Sx4e. White stands slightly better, Maruyama - Senzaki 0-1, 1990. ] 27... S5dx4e 28.Nx4e P8f 29.Px8f (adjourned) [ My opinion of the adjourned position is that black stands a bit better, but probably Habu has prepared something new for this game, because if he picked out this system for white, the adjourned position could hardly be avoided.] 29... P'4g 30.Rx4g B'3h 31.R4h B7d+ 32.S'5e! S'5d! 33.Sx4d +Bx6d 34.Nx5c+ Gx4d 35.Rx4d +Bx5c 36.R4a+ S'6i 37.G5h-6h Sx7h+ 38.Gx7h N'8e 39.G'8g?! [ With 39.G'8g black loses his advantage. 39.S'8g would have been better. According to Kato Hifumi on the television program "Go & Shogi Weekly" after 32.G'8g white stands a bit better.] 39...G'3a 40.+Rx9a Nx7g+ 41.G8gx7g S'6i 42.S'8g N6e! 43.Px6e Sx7h+ 44.Kx7h [ If 44.Sx7h then 44...G'6h which is good for white, or if 44.Gx7h?? then 44... B'5e and white will win.] 44... +B4d (Sx6e!? is possible, too) 45.L'4i [ Allowing 45... R4c would be decisive. ] 45... +B5e 46.+Rx9d R6c 47.S'5f Rx6e 48.P'6g! P'6f 49.Px6f Rx6f 50.Sx5e G'6h 51.K8h B'7i 52.K9h P'9g 53.Nx9g Sx5e 54.S'8i R6g+?? [ 54... G6g 55.Gx6f Sx6f 56.B'4d S'3c 57.Bx6f Gx6f. This position is unclear, but I would prefer to play the white side after 54... G6g.] 55.Gx6g Gx6g 56.R'6a S'7h 57.Rx3a+ Kx3a [ 57... Gx3a 58.N'3d and now 58... K1c 59.N'2e K2d 60.N4b+ G'4d 61.+Rx4d Sx4d 62.G'3d leads to mate, or 58... K1b 59.G'2b K1c 60.N'2e K2d 61.B'5a G'3c 62.Gx2c Kx2c 63.Nx3c+ Nx3c 64.Bx3c+ Kx3c 65.+R8c and mate follows soon, too. ] 58.B'5c K2b 59.N'3d Resigns. [ 59... K1c 60.N'2e K1b 61.G'2b Gx2b 62.Nx2b+ Kx2b 63.+R9b and black wins. ] # # ----------------------------------------------------------------------- # # Ryu O Title Match 1990, Game 4: Habu Yoshiharu - Tanigawa Koji. # 15 and 16 November 1990. Comment by Katsuhiko Murooka. # 1.P7f P8d 2.P2f P8e 3.B7g P3d 4.S8h G3b 5.G7h Bx7g+ 6.Sx7g S4b 7.S3h S7b 8.P4f S3c 9.S4g K4b 10.G5h S8c 11.P6f S8d 12.P9f (black must not allow 12... S9e) P7d [ In professional play 12... P9d 13.P3f P7d occurred many times. Instead of 13... P7d has also been played: 13... P9e 14.Px9e Sx9e 15.Lx9e Lx9e 16.P'9g P'9h 17.S8h L'9a 18.N3g P8f 19.Px8f Rx8f 20.N7g (slightly better for black), Yonenaga - Minami 1-0, 1990 or 13... K3a 14.N3g G5b 15.K4h P6d!?/?!, Tanigawa - Nakahara 0-1, Meijin title game 6, 1990. ] 13.S5f P7e 14.P4e [ 14.S6e or 14.S6g are solid and give black the better position, but Habu wanted more. ] 14... Px7f 15.Sx7f K3a 16.P'7e S7c 17.B'4f B'6d [ The only move: 17... S6d?? 18.P6e S7c 19.P7d or 17... P6d 18.P7d Sx7d 19.Bx6d. ] 18.S5e Bx5e 19.Bx5e S6d 20.B4f [ 20.Bx3c+?! Nx3c allows white to seize the initiative. ] 20... S'5e (adjourned) [ Time used: black 4:27, white 3:09. I think Habu made a wise decision to seal here and not to play the obvious move 21.Bx5e. In the second session Tanigawa must take the bishop anyway, so Habu has some extra thinking time until the next morning. This decision cost him 36 minutes, however, since he had to wait so long before he could seal. My opinion of the adjourned position is that black stands a bit better. ] 21.Bx5e Sx5e 22.S'7g P4d 23.Px4d S5ex4d 24.K6h P'7c [ Why not 24.P7d? After 24... P'7c the position is balanced. On 20-th November, I met Mr. Habu and asked him: "Why didn't you play 24.P7d?". He replied: "I wanted to play 25.P7d after 24.K6h and didn't think that Mr. Tanigawa would play P'7c so soon". ] 25.G7h-6g K2b 26.K7h G5a 27.P2e S3e 28.G5f R4b 29.P'4e P'4d 30.Px4d S3ex4d 31.B'6e B'6a [ 31... S4e?? 32.P'4c. 31... R8b? 32.P'4e S3e 33.G4g favours black. ] 32.S6g S4e 33.Gx4e Rx4e 34.B3h R4b 35.P9e P3e 36.P'4g P1d 37.P1f B3d 38.P5f P5d 39.B2g P'4f 40.Px4f Rx4f 41.P3f [ 41.P'4g? R2f strongly favours white. ] 41... Bx2e 42.Px3e B3f! [ now white stands slightly better ] 43.P3d S4d 44.P3c+ Sx3c 45.Bx3f Rx3f 46.P'3g R4f 47.P'4g R4b 48.B'5c R4a 49.B3e+ (49.B7a+? G5b) P'3h 50.Rx3h B'2g 51.R2h B4i+ 52.N1g +B3i 53.R2f P'3d 54.+B5c G'3e 55.R2g +B3h 56.P'2h P'4f 57.Px4f Rx4f [ White stands clearly better now.] 58.P'4g +Bx4g 59.+Bx6c G5a-4b (time 7:07 - 7:21) 60.+Bx8a +B3h?!/!? [ Tanigawa wants to play 62.P'5g. 60... +B3h induces black to play 62.+Bx5d, after which white can play 62... P'5g. ] 61.P'4g +Bx4g 62.+Bx5d [ 62.+Bx9a would meet 62... +B3h again, but now black does not have a pawn in hand ! ] 62... P'5g 63.Gx4g Rx4g+ 64.B'7f +R4h 65.S'6h G'5c (7:19 - 7:40) 66.+B8a P'4f 67.P3f P4g+ 68.P'4i +R3h 69.Rx4g? [ Black should have fought for a draw and played the following line: 69.Px3e P5h+ 70.N2e +Px6h 71.Sx6h S'5g 72.Nx3c+ Nx3c 73.S'7i ] 69... +Rx4g 70.Px3e +Rx4i 71.+B2g +Rx1i 72.N'4e R'3i 73.P'4i L'2d 74.Px3d Sx3d 75.Nx5c+ Lx2g+ (7:37 - 7:46) 76.+Nx4b Gx4b 77.Px2g Rx4i+ 78.L'5i B'3g? [ After 78... +R2h white would have a won position. ] 79.P'3e S4c 80.G'6i N'8d? 81.B6e P'6d? 82.B8c+ P'4g 83.G'3f Bx5i+ 84.Gx5i +Rx5i 85.Sx5i +Rx5i (7:46 - 7:56) 86.G'6i +R4h 87.R'6h L'8a 88.+Bx8d! Lx8d [ the position is equal now ] 89.B'5e P'3c 90.Rx4h Px4h+ 91.N'3d Sx3d 92.Px3d B'5d (7:51 - 7:59) 93.Px3c+ Nx3c 94.S'3a Kx3a 95.R'5a P'4a 96.Rx5d+ +P5h 97.B'2b!! [ 97.P'3d?? +Px6i 98.B'2b K2a or 97.P'4c? G3b 98.Bx3c+ Gx3c 99.N2e R'4h and in both cases white will win. ] 97... Kx2b (7:58 - 7:59) 98.P'3d R'4h [ 98... +Px6i?? 99.Px3c+ Gx3c 100.Bx3c+ Kx3c 101.N2e K3b 102.+R5b G'4b 103.G'3c K2a 104.N'1c Lx1c 105.Nx1c= K1a 106.L'1b Kx1b 107.+Rx4b Px4b 108.G'2b Kx1c 109.G2bx2c mate. ] 99.Px3c+ Gx3c 100.Bx3c+ Kx3c 101.N2e K3b 102.Sx5h! Resigns [ 102... Px5h+ 103.P'3c K2a 104.G'3b K1b 105.+Rx1d mate. ] # (7:59 - 7:59) # What a tough game ! # # ----------------------------------------------------------------------- # # Ryu O Title Match 1990, Game 5: Tanigawa Koji - Habu Yoshiharu. # 26 and 27 November 1990. Comment by Katsuhiko Murooka. # 1.P7f P3d 2.P2f P4d 3.P2e B3c 4.S4h S3b 5.P5f R4b [ A surprising opening. Four days before this game Habu played this opening against Katsuura and he won. On the other hand, one might suppose that Habu could not find a good way against the bishop exchange opening. ] 6.K6h K6b 7.K7h K7b 8.G4i-5h G4a-5b 9.P9f P9d 10.S5g K8b 11.P8f S4c 12.K8g S7b 13.S7h P6d 14.S6f G6c [ This seems rather old-fashioned. 14... S5d is fashionable nowadays. ] 15.S6f-7g P6e 16.B7i R2b 17.P6f Px6f 18.G5g P7d 19.Gx6f N7c 20.P3f P'6e 21.G6g P5d [ For the variations 21... P4e and 21... P8d, refer to my book "4-th file rook opening II" (pages 74-79; both his books on the 4-th file rook are really good/PS). 21... P5d is the latest move and I think it is better than both 21... P4e and 21... P8d. ] 22.B4f B4b 23.P'6f P4e [ 23... Px6f 24.Sx6f P'6d 25.N7g P8d? 26.P7e! S8c 27.Px7d Sx7d 28.P'7e favours black, Murooka - Kikuchi 1-0, 1990. ] 24.B3g P3e!? 25.Px3e Px6f 26.Sx6f P'3f 27.B5i [ Adjourned. My opinion of the adjourned position is that it is slightly better for black. ] 27... R3b 28.P2d Px2d 29.N7g P8d 30.P'6e S5b 31.P5e Rx3e 32.Px5d P3g+ 33.Bx3g P4f 34.Px4f N3c 35.P'3f [ 35.Rx2d R2e 36.Rx2e Nx2e 37.R'2b Nx3g= 38.Rx4b+ P'4a favours white. ] 35... Rx3f 36.Rx2d P'6h! 37.G6gx6h [ The position is equal now. 37.G7i and 37.G6ix6h will meet 37... N4e 38.R2b+ B3c 39.+Rx3c Rx3c 40.Px4e R'4i, which favours white. ] 37... N4e 38.R2b+ P'4a [ 38... B3c? 39.+Rx3c Rx3c 40.Px4e strongly favours black. ] 39.Px4e Rx6f 40.G6g Rx6g+ [ 40... R3f 41.N'6d would favour black. ] 41.Sx6g P'5f 42.Sx5f P7e 43.N'6d [ If 42... G'6f?? instead of 42... P7e then 43.S5e and black will win. If 43.Px7e? instead of 43.N'6d then 43... Bx7e favours white. ] 43... G'6f 44.Nx7b+ Gx7b 45.S'6g S'5g 46.P6d!! [ A very strong, but double-edged move. Who dares to play this move in such a big title match game ! I suppose Habu may have been surprised. ] 46... Px7f 47.Sx7f Gx6d 48.Bx6d [ 48.+Rx4b?? Px4b 49.Bx6d Gx7f 50.Kx7f R'6f and white will win. Tanigawa played 48.Bx6d instantly. ] 48... Bx6d 49.+Rx5b B'2e? [ After 49.+Rx5b, Habu spent all his remaining time on his next move, but he had only 18 minutes. 49.B'7d would have given him some chances: 50.+R6a? Gx7f 51.Kx7f S'7e 52.K6g S5g-6f+ 53.K5h P'7a is good for white, but 50.S'7a Kx7a 51.R'6a K8b 52.+Rx7b (52.Rx6d+?? Bx5b and white will win) Kx7b 53.Rx6d+ and now: A) 53... Gx7g 54.Kx7g N'6e 55.K8h S'7g 56.K9g and there is no mate or B) 53... N'9e 54.Px9e Gx7g 55.Kx7g N'6e 56.K8g R'7g 57.K8h and black will win, too. ] 50.S'7a K9c [ 50... Kx7a 51.R'6a K8b 52.Rx9a+ Kx9a 53.G'9b and mate follows. ] 51.+Rx7b Gx7f 52.Kx7f S'7e 53.K6g S7e-6f 54.K7h Bx6i+ 55.K8i Resigns # Black: Habu Yoshiharu, challenger; White: Tanigawa Koji, Ryu-O 1.P2f(1) P8d 2.P2e(1) P8e 3.G7h G3b 4.P2d(1) Px2d 5.Rx2d P'2c 6.R2f S7b(3) 7.S3h(2) P6d(12) 8.P1f(8) P1d(17) 9.P7f(3) P8f(7) 10.Px8f(2) Rx8f 11.P'8g(15) R8b(20) 12.P4f(5) S6c(3) 13.S4g(2) S5d(4) 14.S5f(3) P3d 15.G4h(21) G5b(2) 16.P3f(6) P4d(14) 17.S6h(11) S4b(4) 18.K5h(9) S6e(12) 19.Sx6e(30) Px6e(2) 20.N3g(1) S4c(20) 21.P5f(7) P'8f(18) 22.Px8f(7) Rx8f(3) 23.S7g(11) R8b 24.P'8g B1c(10) 25.P1e(32) Bx4f(18) 26.S'5g(2) B2d(28) 27.Px1d P'1e 28.P7e(12) Lx1d(20) 29.P7d(2) Px7d(28) 30.S7f S5d(2) 31.P'7b(18) Rx7b(11) 32.P5e(6) S6c(1) 33.Sx6e N3c(52) 34.P5d(27) Px5d(3) 35.Bx4d(2) S'5e(39) 36.P'5c(28) Sx4d(21) 37.Px5b+ Kx5b 38.S6e-5f(34) P'4f(3) 39.P6f(11) P5e(2) 40.S6g(1) G4c(1) 41.N7g(3) P'6d(11) 42.P6e(2) G5d(7) 43.Px6d(33) Sx6d 44.P'6c(1) K5c(8) 45.K6i(27) P7e(4) 46.P'4e(2) Nx4e(10) 47.Nx4e(4) Sx4e 48.N'3g S5f 49.S5gx5f(11) Px5f 50.S'4e(1) P4g+(1) 51.Gx4g(5) N'5g(9) 52.K7i(24) P7f 53.Sx7f(1) Rx7f 54.Sx5d(2) Kx5d 55.P'5e Sx5e(8) 56.Rx2d(1) Px2d 57.B'6e K6d(2) 58.Bx7f(7) S'6h 59.K8i(11) P'8h(1) 60.Gx8h R'7i 61.K9h S'8i 62.Gx8i Rx8i+ 63.Kx8i S'8h 64.Resigns # Time used black: 7.32; white: 7.22 # # --------------------------------------------------------------------------- # # 5-th Ryu-O Title Match, 2-nd game, 29-th and 30-th October 1992 # # Black: Tanigawa Koji, Ryu-O; White: Habu Yoshiharu, challenger # 1.P7f P8d(1) 2.S6h(1) P3d 3.S7g S6b 4.P5f(1) P5d(1) 5.S4h S4b(1) 6.G4i-5h(1) G3b(2) 7.P6f(1) K4a(1) 8.G6g P7d(7) 9.G7h(10) S6b-5c(28) 10.P2f(13) P5e(3) 11.Px5e(11) Bx5e(1) 12.P2e S5d(1) 13.P2d(7) Px2d(4) 14.Rx2d P'2c(1) 15.R2h R5b(3) 16.K6i(10) B8b(84) 17.S6h(13) S3c(22) 18.S6h-5g(17) G5a(7) 19.P4f(33) K3a(4) 20.S4g(3) G5a-4b(3) 21.P9f(3) P9d(3) 22.S4g-5f(59) K2b(64) 23.P1f(43) P4d(7) 24.P'5e(15) Sx5e(10) 25.Sx5e(1) Bx5e 26.P'5f B7c 27.S'8c(3) P9e(6) 28.Sx7d+(10) Px9f(2) 29.P'9h(17) B8b(23) 30.+Sx6c(5) R5a(1) 31.P6e(33) P8e(7) 32.P6d(11) B9c(38) 33.+S6b(11) R5d 34.P6c+ P4e 35.P5e(17) R9d(9) 36.P'6f(4) R4d(14) 37.Px4e(21) Rx4e 38.P'4f Rx5e 39.S5f R5d(1) 40.S4e S'5h(6) 41.K6h(9) Sx6g+(2) 42.Gx6g R8d 43.B7g(10) P'4d(24) 44.S5f P8f 45.Px8f(5) P'8h 46.P'5c G3a(6) 47.P5b+ G4b-3b 48.+P6c-5c(1) Px8i+(5) 49.S'4c B8b(3) 50.Sx3b+(19) Gx3b 51.G'4c G'3a 52.Gx3b(1) Gx3b 53.G'4c G'3a 54.Gx3b Gx3b 55.G'4c G'3a 56.Gx3b Gx3b Sennichite # Time used black: 6.59; white: 6.45 # # --------------------------------------------------------------------------- # # 5-th Ryu-O Title Match, 2-nd game replay, 10-th and 11-th November 1992 # # Black: Habu Yoshiharu, challenger; White: Tanigawa Koji, Ryu-O # 1.P7f P8d(1) 2.S6h P3d 3.P6f(1) S6b(1) 4.P5f(2) P5d(1) 5.S4h(1) S4b(1) 6.G4i-5h(2) G3b(5) 7.G6g(1) K4a(1) 8.G7h(5) G5b(15) 9.K6i(1) S3c 10.S7g(1) B3a 11.B7i(1) P4d 12.P3f(2) P7d(5) 13.B6h(29) G5b-4c(12) 14.K7i(8) B6d(3) 15.N3g(3) K3a 16.R3h(7) P8e(9) 17.P2f(17) K2b(3) 18.P1f(3) S5c(31) 19.S5g(13) P1d(76) 20.P6e(9) B7c 21.S5g-6f(1) B8d(9) 22.B4f(13) B7c(5) 23.B5g(96) R6b(37) 24.P7e Bx3g+(18) 25.Rx3g(66) N'4e 26.R3h(2) Nx5g+ 27.Gx5g(6) P6d(13) 28.Px7d Px6e(5) 29.S7e S6d(8) 30.Sx6d(12) Rx6d 31.B'8b(8) Rx7d(1) 32.Bx9a+ P'7f(32) 33.S6h(1) S'7g(45) 34.Nx7g(14) Px7g+ 35.Sx7g N'6f(1) 36.P'7e(36) Nx7h+(31) 37.Rx7h(27) R7a(10) 38.S'7f(1) G'6f(4) 39.Gx6f(5) Px6f 40.Sx6f(4) N7c(7) 41.+B8b(4) R6a 42.S'7g(6) Rx6f(17) 43.Sx6f S'6e 44.S7fx6e(20) Nx6e 45.L'6i P'7g(10) 46.Sx7g Nx7g+ 47.Rx7g B'9e 48.S'7h(2) Bx7g+(5) 49.Sx7g P8f 50.Sx8f(10) R'4h 51.G'7h(1) Rx4g+(12) 52.B'7f(11) P'6h(5) 53.Lx6h(1) +Rx5f 54.S7g(2) +R5i 55.P'6i(1) S'5h 56.Bx5h +Rx5h 57.S'6g(5) +R4i 58.P1e(1) B'4g(7) 59.P'5h S'5f(4) 60.Px1d(11) Sx6g+ 61.Lx6g Bx5h+ 62.G6h G'8i(8) 63.K7h(1) P'7f(1) 64.S'1c(1) Lx1c(2) 65.Px1c+ K3a(3) 66.R'6a(2) S'4a 67.Kx8i(1) +Bx6h(2) 68.+B6d(1) G3b-4b(2) 69.+Bx4b(2) Kx4b 70.Rx4a= Kx4a 71.G'5b Kx5b 72.N'6d K4b 73.Resigns # Time used black: 7.59; white: 7.48 # # --------------------------------------------------------------------------- # # 5-th Ryu-O Title Match, 3-rd game, 19-th and 20-th November 1992 # # Black: Tanigawa Koji, Ryu-O; White: Habu Yoshiharu, challenger # 1.P7f P8d 2.S6h(1) P3d 3.P6f S6b(3) 4.P5f P5d(1) 5.S4h(1) S4b(1) 6.G4i-5h(2) G3b 7.G6g(1) K4a(1) 8.G7h G5b(4) 9.K6i(1) S3c(3) 10.S7g(1) B3a(1) 11.B7i(1) P4d(5) 12.P3f G5b-4c(3) 13.S3g(39) P8e(28) 14.P3e(97) Px3e(7) 15.Bx3e P4e(1) 16.K7i S5c(7) 17.K8h S5c-4d(2) 18.B6h B5c(46) 19.R4h(7) S3d(2) 20.P'3f(2) K3a(3) 21.P4f(18) Px4f(4) 22.Sx4f P'4e 23.S3g K2b(23) 24.P1f(22) P9d(18) 25.P1e(9) P9e(7) 26.S2f(13) P7d(63) 27.N3g(18) B6d 28.R1h(9) G4c-3c(4) 29.P5e(86) Bx5e(6) 30.G5f B7c 31.P3e(1) S4c(1) 32.Nx4e G2d(1) 33.P'4f(1) P6d(26) 34.R3h(18) B8d(5) 35.S3g(7) Gx3e(1) 36.S3f(7) Gx3f(6) 37.Rx3f P'3c(13) 38.R3g(5) S'6i(13) 39.G'6c(3) Sx7h+(24) 40.Kx7h P5e(17) 41.G5g P6e 42.N5c+(1) Sx5c(5) 43.Gx5c P5f(2) 44.Gx5f(28) Px6f 45.P'6g N'6d(8) 46.G6e(15) P'5g(10) 47.Gx6d(24) P5h+ 48.S'4a +Px6h(32) 49.Sx6h Px6g+ 50.Rx6g P'6f(12) 51.R3g B'5f(2) 52.P'6g G'5g(2) 53.Sx5g(10) Px6g+ 54.K8h Bx5g+ 55.Gx4c +B7i 56.Resigns # Time used black: 7.30; white: 7.03 # # --------------------------------------------------------------------------- # # 5-th Ryu-O Title Match, 4-th game, 2-nd and 3-rd December 1992 # # Black: Habu Yoshiharu, challenger; White: Tanigawa Koji, Ryu-O # 1.P7f(1) P8d(1) 2.S6h(3) P3d 3.P6f(1) S6b 4.P5f P5d 5.S4h(2) S4b 6.G4i-5h(2) G3b 7.G6g(3) K4a 8.G7h(4) G5b(3) 9.K6i(4) S3c(1) 10.S7g(1) B3a(2) 11.B7i(2) P4d 12.P3f(2) G5b-4c(9) 13.B6h(3) P7d(19) 14.K7i(2) B6d(6) 15.S3g(25) K3a(36) 16.K8h(3) P8e 17.P2f(5) K2b(1) 18.P1f(2) S5c(32) 19.P1e(16) P9d(4) 20.L1h(29) P9e(40) 21.R3h(38) S5c-4b(26) 22.S4f(13) N7c(65) 23.N3g(4) S2d(13) 24.N2e(42) P4e 25.S3g(36) N3c(11) 26.P4f(19) Nx2e(34) 27.Px2e(1) Sx2e 28.R2h(23) Px4f(23) 29.P6e(5) Nx6e(14) 30.Rx2e Nx7g+ 31.Bx7g N'3c 32.R6e(27) P4g+ 33.S2f(2) P'4d(10) 34.P3e(1) P9f 35.Px9f(12) P'9h 36.Lx9h(5) P'9g 37.Lx9g(1) Bx9g+(1) 38.Nx9g(10) L'6d 39.Rx6d(2) Px6d 40.B'7c(36) R9b(1) 41.L'9e(2) R7b 42.Bx9a+(1) +P5g(32) 43.Gx5g P7e 44.Px7e(1) R'2h(9) 45.S'7f(30) Rx1h+(4) 46.+Bx6d(5) L'6a(2) 47.P'6c S5c 48.+B4f Lx6c 49.P'6e +R2i(12) 50.Px3d(7) N4e(14) 51.+Bx4e(2) Rx7e(2) 52.Sx7e(2) P'7f 53.N'2d(7) S'9i(8) 54.K9h Px7g+ 55.Nx3b+ Kx3b 56.R'3c(1) Gx3c 57.Px3c+ Kx3c 58.L'3g Resigns # Time used black: 7.25; white: 7.22 # # --------------------------------------------------------------------------- # # 5-th Ryu-O Title Match, 5-th game, 14-th and 15-th December 1992 # # Black: Tanigawa Koji, Ryu-O; White: Habu Yoshiharu, challenger # 1.P7f P8d(2) 2.P2f G3b(2) 3.G7h(2) P8e(5) 4.B7g(2) P3d 5.S8h Bx7g+(3) 6.Sx7g S4b(1) 7.S3h S7b(2) 8.P4f(2) P6d(15) 9.S4g(8) S6c 10.P6f(9) P1d(26) 11.P1f(11) P9d(3) 12.P9f(5) S5d 13.S5f(1) P4d(4) 14.G5h(35) G5b(8) 15.K6h(10) K4a(2) 16.K7i(1) P7d(2) 17.P3f K3a(2) 18.N3g(22) N7c(19) 19.P2e(7) S3c(23) 20.P4e(28) Px4e(19) 21.P3e S4d(5) 22.P7e(16) Px7e(5) 23.P2d Px2d(1) 24.Rx2d P'2c(2) 25.R2h G6c(16) 26.B'6a(54) B'4c(7) 27.Bx4c+(64) Sx4c(1) 28.P'7d Gx7d(2) 29.Nx4e P6e(45) 30.Px3d(2) P8f(39) 31.Px8f(13) B'3g(3) 32.R2i B6d+(1) 33.B'3c(59) P7f(5) 34.Sx7f(2) P'8h(35) 35.Bx1a+(8) Px8i+(1) 36.K6i +Bx8f(12) 37.P'8c(2) P'7g(40) 38.G7h-6h(22) +P7i(17) 39.K5i(14) P7h+(7) 40.Px8b+(4) +Px6h 41.Gx6h N'3f(2) 42.R'6a P'4a(3) 43.K5h(25) +Bx7f(4) 44.K4g S3e(2) 45.+B5e(4) G'4h(1) 46.K3g +B4i 47.Resigns # Time used black: 7.12; white: 6.34 # # --------------------------------------------------------------------------- # # 5-th Ryu-O Title Match, 6-th game, 24-th and 25-th December 1992 # # Black: Habu Yoshiharu, challenger; White: Tanigawa Koji, Ryu-O # 1.P7f(1) P8d 2.S6h(2) P3d 3.P6f S6b(1) 4.P5f(1) P5d 5.S4h(2) S4b 6.G4i-5h(4) G3b 7.G6g(1) K4a(1) 8.G7h(3) G5b(1) 9.K6i(1) S3c(2) 10.S7g(2) B3a(2) 11.B7i(1) P4d 12.P3f(2) G5b-4c(9) 13.B6h(3) B6d(26) 14.S3g(11) P7d(3) 15.K7i(5) K3a(1) 16.K8h(1) P8e(20) 17.P1f(28) K2b(2) 18.P2f(55) P7e(27) 19.Px7e(10) Bx7e(2) 20.S4f(14) P4e(53) 21.S3g B6d 22.P4f(83) Px4f(3) 23.Sx4f(1) P'4e(38) 24.S3g S5c 25.P1e(3) S5c-4d(25) 26.R1h(1) R7b(3) 27.S4h(10) P4f(26) 28.P6e(55) B8b(4) 29.N1g(1) S2d(37) 30.N2e(9) P8f(2) 31.Px8f(16) P4g+(16) 32.Sx4g(16) B3g+ 33.B4f P'8g(18) 34.K9h(2) +Bx4g(37) 35.Bx9a+ Sx2e 36.+Bx8a R7e(1) 37.P'4e(32) +B6i(20) 38.Px4d(17) S'5h 39.Rx5h(32) +Bx5h 40.Px4c+(2) +Bx6g(3) 41.G'7i(7) Rx7g+(4) 42.Nx7g(1) R'8h 43.G7ix8h Px8h+ 44.Kx8h G'8g 45.Resigns # Time used black: 7.32; white: 6.27 # # --------------------------------------------------------------------------- # # 5-th Ryu-O Title Match, 7-th game, 5-th and 6-th January 1993 # # Black: Habu Yoshiharu, challenger; White: Tanigawa Koji, Ryu-O # 1.P7f(2) P8d(1) 2.G7h(5) G3b(11) 3.B7g(15) P3d(5) 4.S6h(3) S6b(2) 5.S4h(4) P6d(4) 6.P4f(1) S6c(7) 7.S4g(1) S5d(10) 8.S5f(4) G5b(9) 9.G5h(9) K4a(2) 10.K6i(5) Bx7g+(18) 11.Sx7g(1) S4b 12.P6f(10) P4d(4) 13.K7i(1) K3a(3) 14.P3f(8) P1d(8) 15.P1f(4) P9d(2) 16.P9f(1) P7d 17.N3g(35) N7c(70) 18.B'2f(11) G5b-4c 19.R4h P3e(39) 20.Bx3e(21) G3d(1) 21.B2f(3) P2d(2) 22.P4e(4) Px4e(32) 23.Sx4e(36) Sx4e(4) 24.Nx4e P'4d 25.B3g(7) R6b(35) 26.P7e(72) N8e(2) 27.Px7d Nx7g+(6) 28.Nx7g(1) Px4e(4) 29.P7c+ R9b(2) 30.S'8c(37) S'4f(46) 31.Bx4f(10) Px4f 32.Sx9b+ S'4g(32) 33.Gx4g(12) Px4g+ 34.Rx4g B'5h(2) 35.R'7a(52) K2b(1) 36.R4h(1) G'6g(4) 37.Rx5h(8) Gx5h 38.B'7f R'5i(6) 39.K8h N'5d 40.N'3e(4) G3d-3c(30) 41.B6g(3) Nx6f(12) 42.S'2c(1) G3cx2c 43.Nx2c+ Gx2c 44.Bx2c+ Kx2c 45.Rx2a+ Resigns # Time used black: 6.40; white: 7.37 # # KAKUGAWARI BOUGIN P7f P8d P2f G3b G7h P8e B7g P3d S8h B7g+ S7g S4b S3h S7b P2e S3c S2g P6d? # P7f P8d P2f G3b G7h P8e B7g P3d S8h B7g+ S7g S4b S3h S7b P2e S3c S2g P7d S2f S7c S1e? B*5d! P2d?? P2d S2d P*2g! # P7f P8d P2f G3b G7h P8e B7g P3d S8h B7g+ S7g S4b S3h S7b P2e S3c S2g P7d S2f S7c S1e? B*5d! B*3h! P4d! P2d P2d S2d P*2g? B2g S2d B5d P5d R2d # P7f P8d P2f G3b G7h P8e B7g P3d S8h B7g+ S7g S4b S3h S7b P2e S3c S2g P7d S2f S7c S1e? B*5d! B*3h! P4d! P2d P2d S2d P*2g? B2g B2g R2g # P7f P8d P2f G3b G7h P8e B7g P3d S8h B7g+ S7g S4b S3h S7b P2e S3c S2g P7d S2f S7c S1e? B*5d! B*3h! P4d! P2d P2d S2d P*2g? B2g # P7f P8d P2f G3b G7h P8e B7g P3d S8h B7g+ S7g S4b S3h S7b P2e S3c S2g P7d S2f S7c S1e? B*5d! B*3h! P4d! P4f # P7f P8d P2f G3b G7h P8e B7g P3d S8h B7g+ S7g S4b S3h S7b P2e S3c S2g P7d S2f S7c S1e? B*5d! B*3h! P4d! # P7f P8d P2f G3b G7h P8e B7g P3d S8h B7g+ S7g S4b S3h S7b P2e S3c S2g P7d S2f # KAKUGAWARI KOSHIKAKE-GIN # NAKAHARA's KYUSEN SHOGI # HINERI-BISHA # 1. 3-4FU GATA P2f P8d P2e P8e P2d?? P2d R2d P8f P8f P*8g P*2c P8h+ S8h B*3e # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f R8d S3h S4b K4h K4a K3i K3a # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P6d B7g # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e! R3f? P3f R*2g S3h R2h+ R*8f G7a?? P*8b # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e! R3f? P3f R*2g S3h R2h+ R*8f +R1i R8a+ L*2d P7d L2h+? P7c+ S7c B5e # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e! R3f? P3f R*2g S3h R2h+ R*8f +R1i R8a+ L*2d P7d P7d P*7c S7c?? B5e # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e! R3f? P3f R*2g S3h R2h+ R*8f +R1i R8a+ L*2d P7d P7d P*7c G7a +R9a # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e! R3f? P3f G7b S3h K5b P9e P1d K5h # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e! R3f? P3f # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e! R8b N7g P*8g B9g # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e! R8b N7g P6d K4h S6c S3h P*8f? P*8e # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e! R8b N7g P6d K4h S6c S3h K4a P*8e? K3b R8f G7b S6h S4b # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e! R8b N7g P6d K4h S6c S3h K4a B9g! R8i+? R8f +R9i B8h +R9h R8a+ S7b +R9a P*8g N*8d P8h N7b+ # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e! R8b N7g P6d K4h S6c S3h K4a B9g! R8i+? B8h G7b R8f P*8c G5i P7d G7h6h P7e S7h +R8h R8h P7f R*6a # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e! R8b N7g P6d K4h S6c S3h K4a B9g! R8i+? # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e! R8b N7g P6d K4h S6c S3h K4a B9g! G7b R8f R8f? B8f R*8i R*6a K5b R8a+ # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e! R8b N7g P6d K4h S6c S3h K4a B9g! G7b R8f G8c? P6f G8d P6e P6e P7d P7d N6e S4b N5c+ S5c R8d R8d B5c+ # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e! R8b N7g P6d K4h S6c S3h K4a B9g! G7b R8f G8c? P6f G8d P6e P6e P7d P7d N6e S6d R8d R8d B6d # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e! R8b N7g P6d K4h S6c S3h K4a B9g! G7b R8f G8c? P6f G8d P6e P6e P7d P7d N6e # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e! R8b N7g P6d K4h S6c S3h K4a B9g! G7b R8f P*8d P6f S4b S6h K3b K3i P4d P4f G4c G6g P5d G5f S5c S6g P1d S5h P1e R7f P9d P6e B3a # 2. 1-4 FU 6-4 FU TYPE HINERI-BISHA P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P1d S3h P6d P7f P8f P8f R8f N7g S6c B9g R8b P7e S4b R8f P*8d P6f # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P1d S3h P6d P7f P8f P8f R8f N7g P7d R6f S6c P7e R6f P6f G7b P7d P*7f N8e S7d P*7c G7a P*8b G8b R*7a R*6a R7b+ G7b P7b+ R6c G*7c N7c N7c+ # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P1d S3h P6d P7f P8f P8f R8f N7g P7d R6f G7b R6d S6c R6f S4b K4h P9d P7e R8b B9g P3d R8f P*8d P7d S7d R7f G7c P*7e S6c P6f # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P1d S3h P6d P7f P8f P8f R8f N7g P7d R6f # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P1d S3h P6d P7f P8f P8f R8f N7g # KUUCHU SENPOU # AI YOKOFU P7f P3d P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c? R3d B8h+ S8h B*2e R3b+ S3b S3h S3c B*4e? K6b B2c+ P8f P8f R8f P*8g R7f S7g R2f P*2g B4g+ S4g R2c # P7f P3d P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c? R3d B8h+ S8h B*2e R3b+ S3b S3h S3c S7g # P7f P3d P2f P8d P2e P8e G7h G3b P2d P2d R2d P8f P8f R8f R3d B8h+ S8h R7f S7g R7d R3f N3c R2f P*2e R8f P*8b P*8c G7b P8b+ S8b P*8c S7a B*8b P*8e R6f S8b P8b+ G8b R6c+ # NAITO 3-3 KAKU P7f P3d P2f P8d P2e P8e G7h G3b P2d P2d R2d P8f P8f R8f R3d B3c R3f R8d R2f S2b P*8g K5b S4h P1d P4f P1e S4g B8h+ S8h N3c P3f P*2e R2h R2d P*2g G7b G3h S6b N3g S2c K6h P7d S7g P6d P9f P9d R2i S6c # P7f P3d P2f P8d P2e P8e G7h G3b P2d P2d R2d P8f P8f R8f R3d B3c R3f R8d R2f S2b P*8g K5b K6h P1d S3h P1e P9f P9d P3f P*8f P8f R8f P3e R8e P7e P*2e R2e R7e B7g P7d S8h N7c P*7f R8e P*8f R5e B5e B5e P4f P*3f R*5f B*6d # # SOME OPENINGS # OPENING 11 MISC # OPENING 12 FURI-BISHA, HINERI-BISHA # OPENING 13 AI-YAGURA # OPENING 14 YOKOFU-DORI # OPENING 15 AI-GAKARI # TUKADA.KIF TSUKADA SPECIAL # KAKUGAWARI.KIF KAKU-GAWARI (HABU'S ZUNOO) ###### MY OPENINGS # SOURCE: GUIDE TO SHOGI OPENINGS # 5. KIMURA JOUSEKI (NAKAHARA'S SHOGI JOUSEKI) P7f P8d P2f P8e P2e G3b B7g P3d S8h B7g+ S7g S2b G7h S3c S4h S6b P4f P6d S4g S6c P3f P7d K6h K4b G5h G5b P1f P1d P9f P9d S5f S5d P6f P4d K7i K3a K8h K2b N3g N7c P4e P4e P3e S4d P7e P7e P2d P2d R2d P*2c R2h B*6c P1e P1e P*1c L1c N2e L1d P3d P2d N3c+ N3c R2d G2c B*1a K3b P3c+ S3c N*4d S4d R2c+ K2c B4d+ G4c S4e G4d S4d # #6.KAKUKAWARI BOUGIN P7f P8d P2f P8e P2e G3b B7g P3d S8h B7g+ S7g S2b G7h S3c S3h S6b S2g P7d S2f S7c S1e B*5d B*3h P4d P2d P2d S2d S2d R2d G3c R2h P*2g R2g B2g+ B2g R2b P*2h G6b G3i K4b S6f G4c S5e S*5d S6f N3c P5f R2a # #GACCHAN-GIN (SUCCESS) P7f P8d P2f P8e P2e G3b P2d P2d R2d P*2c R2f P8f P8f R8f G7h R8d P*8g P3d S4h S6b P4f P6d S4g S6c S5f S5d P1f P1d G5h P9d P9f G5b K6h K4b P3f P7d N3g P6e G4h N7c? P3e P3e S4e S4e N4e P4d P*3c N3c S*6d G6b S7c G7c N*3d K5b N2b+ S2b B4d # #GACCHAN-GIN (FAILURE) P7f P8d P2f P8e P2e G3b P2d P2d R2d P*2c R2f P8f P8f R8f G7h R8d P*8g P3d S4h S6b P4f P6d S4g S6c S5f S5d P1f P1d G4h P9d P9f G5b K6h K4b P3f P7d N3g P6e P3e? P3e S4e S4e N4e P7e P*3c N3c N3c+ B3c B3c+ G3c N*4e G3b S*3c G3c N3c+ K3c B*4a K4b B2c+ S*3b P*3c S2c R2c+ P*2b P3b+ S3b +R2cx2b B*5e # #GACCHAN-GIN (YOKOFU) P7f P8d P2f P8e P2e G3b P2d P2d R2d P*2c R2f P8f P8f R8f G7h R8d P*8g P3d S4h S6b P4f P6d S4g S6c S5f S5d P1f P1d G4h P9d P9f G5b K6h K4b P3f P7d N3g P6e K5h G6b P*2d P2d R2d P*2c R3d B8h+ S8h G3c R3e B*2h N2e G3b P*2b # P7f P8d P2f P8e P2e G3b P2d P2d R2d P*2c R2f P8f P8f R8f G7h R8d P*8g P3d S4h S6b P4f P6d S4g S6c S5f S5d P1f P1d G4h P9d P9f G5b K6h K4b P3f P7d N3g P6e K5h G6b P*2d P2d R2d P*2c R3d G5b B2b+ S2b N4e B*4d N5c+ G5c B*5a K5a R3b+ G5b S4e S4e P4e B9i+ S*5c # # F4dU KISHUU (KISHUU TAIZEN) P7f P4d? B4d? R4b B5c+ P3d S8h R4g+ S4h?? B8h+ # # ONI GOROSHI (GOTE SIPPAI) P7f P3d N7g P8d N6e S6b? P7e P6d B2b+ S2b B*5e S3c? B6d # ONI GOROSHI (SENTE SASIKIRI) P7f P3d N7g P8d N6e S6b? P7e P6d B2b+ S2b B*5e B*3c B6d B9i+ P7d R8c P7c+ N7c N5c+ P*5b # ONI GOROSHI (SENTE FURI) P7f P3d N7g P8d N6e G6b! P7e P6d B2b+ S2b B*5e G6c! # # GOTE NAKABISHA (HAMETE) P7f P5d P2f R5b P2e P3d P2d? P2d R2d B8h+ S8h B*3c R2h P*2f S7g? R2b S3h B7g+ N7g S*2g # GOTE F7dU (HAMETE) P7f P7d B8h5e? P3d B8b+ S8b S8h B*9e R*7g N7c P9f B8d # GOTE F7dU P7f P7d P2f R7b P2e P3d G7h G3b P2d P2d R2d P7e R3d P7f P*7c N7c B2b+ S2b P*7d N6e B*9e K4a P7c+ B*5a # KAMA-ITACHI (G4hIN) (GOTE F3dU) P7f P3d S4h P8d P5f P8e S5g P8f? P8f R8f B2b+ S2b B*7g R8b? P*8d N3c R8h # P7f P3d S4h P8d P5f P8e S5g P8f? P8f R8f B2b+ S2b B*7g R8i+ B2b+ B*3c 2b2a B9i+ P4f # KAMA-ITACHI (GOTE F8dU) P7f P8d S4h P8e P5f P8f? P8f R8f G7h R7f B6f R8f S8h R8b S5g P5d P5e P5e P*5d # OPENING MISC. # --> KAKU-GAWARI P7f P8d P2f P8e G7h G3b # --> YOKOFU-DORI # # FURI-BISHA, HINERI-BISHA OPENING # # NAKAHARA'S SHOGI BOOK # 1. 3-KEN BISHA P7f P3d P2f P4d S4h R3b P2e B3c P5f S4b K6h K6b K7h K7b 4i5h P5d P3f 4a5b P4f S5c N3g K8b P4e R4b P2d 2c2d 4e4d 5c4d P*4e S5c B3c+ N3c R2d N4e 3g4e 4b4e R2a+ S7b B*3c P*4g G4g P*4f G5g # # 2. 4-KEN BISHA P7f P3d P2f P4d S4h S3b P5f R4b P2e B3c K6h K6b K7h K7b 4i5h K8b P3f S7b S6h 4a5b 6h5g P5d 6i6h P6d P3e 3d3e S4f P3f S3e P4e B3c+ S3c P2d 2c2d S3ex2d S3cx2d R2d B*3c R2a+ R2b +R2ax2b B2b B*6f B6f P6f R*2h R*4a R2i+ B*4d S*6b # # 3. NAKA BISHA P7f P3d P2f P4d S4h S4b P5f P5d 4i5h S4c K6h R5b K7h K6b S6h K7b P2e B3c P3f K8b P4f S7b P4e # NAKAHARA'S KYUSEN SHOGI (1) HINERI-BISHA P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P3d R3f G3c P7f P8f P8f R8f P7e R8b N7g P6d K4h S6c S3h K4a B9g G7b R8f P*8d P6f S4b S6h K3b K3i P4d P4f G4c G6g P5d G5f S5c S6g P1d S5h P1e R7f P9d P6e B3a P4e P4e P6d S5cx6d G6e S6e N6e P*6d B8h G*3c P*4d G3cx4d B4d G4d P*2b P6e P2a+ B5c R2f N*2d P*2e G3e R2h # # NAKAHARA'S KYUSEN SHOGI (1) HINERI-BISHA -2 (G6cIN) P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P1d S3h P6d P7f P8f P8f R8f N7g S6c B9g R8b P7e S4b R8f P*8d P6f # # NAKAHARA'S KYUSEN SHOGI (1) HINERI-BISHA -2 (F7dU) P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P9f P1d S3h P6d P7f P8f P8f R8f N7g P7d R6f S6c P7e R6f P6f G7b P7d # ISHIDA-RYUU CHOU-KYUUSEN-1 P7f P3d P7e P8d R7h P8e K4h S6b P7d P7d? B2b+ S2b B*5e S7c R7d B*6d R7c+ B5e 7c8b B8b R*8c G7b R8e+ # # ISHIDA-RYUU CHOU-KYUUSEN-2 P7f P3d P7e P8d R7h P8e K4h S6b P7d G7b P7c+ S7c B2b+ S2b B*5e B*3c B7c+ G7c P*7d G8c S*7c R9b # # ISHIDA-RYUU CHOU-KYUUSEN-3 (GOTE SIPPAI) P7f P3d P7e P8d R7h P8e K4h P8f? P8f R8f P7d P7d B2b+ S2b B*9e # # MASUDA'S ISHIDA-RYUU-1 P7f P3d P7e P8d R7h P8e K4h S6b K3h P6d K2h S6c S3h P8f P8f R8f B2b S2b R8h P*8g R9h B*8h G7h B7i+ G7i S*8h B*5e S7i B2b+ P8h+ S*7g R8b +B2bx1a +P8hx9h L*8f # # MASUDA'S ISHIDA-RYUU-2 P7f P3d P7e P8d R7h P8e K4h S6b K3h P6d K2h S6c S3h K4b R7f B8h+ S8h S2b N7g K3b B*9f G7b B8e S3c R8f G4b B6c+ R8f +B6cx7b R8d S*9e # P7f.P8d.P7e P7f P8d P7e P8e # P7f P3d P2f P4d S4h S3b P2e B3c P7f P3d P2f P4d S4h S3b P2e B3c # # FURIBISHA OPENING P7f P8d B7g P3d P6f S6b R7h P5d K4h # P7f P8d B7g P3d P6f S6b R6h P5d K4h # P7f P8d B7g P3d P6f S6b S7h P5d R6h # P7f P8d B7g P3d P6f S6b # P7f P8d P6f P3d B7g ## ## HABU'S ZUNO NO.8 LATEST HINERI-BISHA P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S7b P9f? P3d R3f G3c P7f P8f P8f R8f N7g R8b P7e P9d K4h K4b S3h P6d B9g S6c R8f P*8d S6h K3b P6f S4b S6g G7b S5f G4d K3i G5d P4f ## K9gAKU->F9eU P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S7b P9f? P3d R3f G3c P7f P8f P8f R8f N7g R8b P7e P9d K4h K4b S3h P6d B9g P9e P7d R8i+ # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S7b P1f # # YAGURA JOUSEKI # # 4. AI YAGURA (NAKAHARA'S SHOGI JOSEKI) P7f P8d S6h P3d S7g S6b P2f S4b S4h G3b G7h P5d P5f K4a K6i G5b P3f P4d G5h S3c B7i B3a P6f P7d # # YAGURA (2) P7f P8d S6h P3d S7g S6b P5f S4b S4h G3b G7h P5d P2f K4a K6i G5b P3f P4d G5h S3c B7i B3a P6f P7d # # YAGURA (3) P7f P8d S6h P3d S7g S6b P5f S4b S4h G3b 4i5h P5d K6h K4a K7h G5b P6f P4d B7i S3c G6g 5b4c K8h B3a G7h # # HABU'S YAGURA 1 P7f P8d S6h P3d S7g S6b S4h?? P7d G7h S7c P6f S6d G5h P8e 5h6g P7e P7e S7e P*7f P8f P8f S8f # P7f P8d S6h P3d P6f S6b S4h?? P7d G7h S7c S7g S6d G5h P8e 5h6g P7e P7e S7e P*7f P8f P8f S8f # P7f P8d S6h P3d P6f S6b S4h?? P7d G7h S7c S7g S6d G5h P8e P5f P7e P7e S7e P*7f P8f P8f S8f # # HABU'S YAGURA 2 P7f P8d S6h P3d S7g S6b P5f! P5d S4h S4b 4i5h 6a5b? P6f P4d B7i G4c K6h S3c K7h B3a P3f K4b S3g K3b P3e P3e B3e S5c G6g S6d B6h P5e P6e S6e P5e # HABU'S YAGURA 3 P7f P8d S6h P3d S7g S6b P5f P5d S4h S4b 4i5h G3b P6f K4a G6g G5b? B7i S3c P3f P7d P3e P3e B3e S4d B4f P5e R3h # HABU'S YAGURA 4 P7f P8d S6h P3d S7g S6b P5f P5d S4h S4b 4i5h G3b P6f K4a G6g S6b-5c? P2f P5e P5e B5e P2e S5d P2d P2d R2d P*2c R2h P7d S5g R5b K6h B8b K7h # HABU'S YAGURA 5 P7f P8d S6h P3d S7g S6b P5f P5d S4h S4b 4i5h G3b P6f K4a G6g P7d G7h S6b-5c B7i P5e P5e B5e B4f B4f P4f S3c S4g G5b K6i P4d K7i # HABU'S YAGURA 6 P7f P8d S6h P3d S7g S6b P5f P5d S4h S4b 4i5h G3b P6f K4a G6g P7d G7h G5b K6i S6b-5c B7i P6d P2f R6b P2e N7c P3f P6e P6e N6e S6f S6d ## # YOKOFU-DORI # # YOKOFU-DORI (4-5-KAKU) P7f P3d P2f P8d P2e P8e G7h G3b P2d P2d R2d P8f P8f R8f R3d B8h+ S8h P*2h S2h B*4e R2d P*2c # # AI YOKOFU-DORI-1 (NAKAHARA'S SHOGI JOSEKI) P7f P3d P2f P8d P2e P8e G7h G3b P2d P2d R2d P8f P8f R8f R3d B8h+ S8h R7f S7g R7d R3f N3c R2f P*2e R8f P*8b P*8c G7b P8b+ S8b P*8c S7a B*8b P*8e R6f S8b P8b+ G8b R6c+ # # AI YOKOFU DORI -2 P7f P3d P2f P8d P2e P8e G7h G3b P2d 2c2d R2d P8f 8g8f R8f R3d B8h+ S8h R7f S7g R7d 3d7d 7c7d P*8b S8b B*5e R*8e R*8f R8f S8f P*2h # # K3cAKU SENPOU - 1 P7f P3d P2f P8d P2e P8e G7h G3b P2d P2d R2d P8f P8f R8f R3d B3c R3f R8d R2f S2b P*8g K5b B3c+? N3c B*2a G3a P*2c P*2e P2b+ G2a R3f G2b # K3cAKU SENPOU - 2 (SENTE G4hIN --> GOTE YAYA GOOD) P7f P3d P2f P8d P2e P8e G7h G3b P2d P2d R2d P8f P8f R8f R3d B3c R3f R8d R2f S2b P*8g K5b S4h P1d P4f P1e S4g B8h+ S8h N3c P3f P*2e R2h R2d P*2g G7b G3h S6b N3g S2c K6h P7d S7g P6d P9f P9d R2i S6c # K3cAKU SENPOU - 3 (SENTE G3hIN->SENTE FURI) P7f P3d P2f P8d P2e P8e G7h G3b P2d P2d R2d P8f P8f R8f R3d B3c R3f R8d R2f S2b P*8g K5b S3h B8h+ S8h B*3e R3f P*3d K6h P*2h # K3cAKU SENPOU - 4 (SENTE G6hYOKU->GOTE YAYA GOOD) P7f P3d P2f P8d P2e P8e G7h G3b P2d P2d R2d P8f P8f R8f R3d B3c R3f R8d R2f S2b P*8g K5b K6h P1d S3h P1e P9f P9d P3f P*8f P8f R8f P3e R8e P7e P*2e R2e R7e B7g P7d S8h N7c P*7f R8e P*8f R5e B5e B5e P4f P*3f R*5f B*6d ## # YOKOFU-DORI (F2cU) YOKOFUDORI GUIDE P7f P3d P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R3d B8h+ S8h B*4e? R3e B2g+ B*1e K4a P3f P8f G3h 2g3h S3h G*2d B2d P2d K5h # YOKOFU-DORI P2c-2 P7f P3d P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R3d B8h+ S8h B*2e R3b+ S3b S3h S3c # YOKOFU-DORI F2cU-3 P7f P3d P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R3d B8h+ S8h B*2e R3f B3f P3f R*2g S3h R2e+ S7g # YOKOFU-DORI F2cU-4 P7f P3d P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R3d B8h+ S8h B*2e R3f B3f P3f P8f P8f R8f K6h R8b S3h S2b P4f S7b P3e K4b B*4g P6d N3g # # AI GAKARI # AIGAKARI HAMETE P2f P8d P2e P8e P2d?? P2d R2d P8f P8f P*8g! P*2c 8g8h+ S8h B*3e R2h 3e5g+ 2c2b+ R2b P*2c R1b B*2b P*2d 2b1a+ R1a L*2g B*4e L2d P*2g # # (AIGAKARI: TSUKADA SPECIAL) # TUKADA-1 (GOTE H8bISHA -> SENTE LITTLE SUCCESS) #P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f #S6b P1f P1d S3h #P6d P7f P8f P8f R8f P*2d P2d R2d R8b #P1e P1e P*1d #P*2c R6d R8h+ R6b+ G6b G8h P3d R*8c B*7b #R8g+ P7d P*8c N7c # TUKADA-2 (GOTE G6cIN -> SENTE SUCCESS) #P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f #S6b P1f P1d S3h P6d P7f P8f P8f R8f P*2d P2d R2d #S6c? P1e P*2c R2e P1e P*1d R8b R1e P3d P*8g # TUKADA-3 (GOTE H8bISHA -> SENTE FURI) #P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f #S6b P1f P1d S3h P6d P7f P8f P8f R8f P*2d P2d R2d #R8b R6d? R8h+ R6b+ G6b S8h P*2g # TSUKADA SPECIAL MONOGATARI ## TSUKADA SPECIAL P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S7b P1f P1d S3h P6d P7f P8f P8f R8f P*2d P2d R2d # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S7b P1f P1d P9f P9d S3h P6d P7f P8f P8f R8f P*2d P2d R2d # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P1f K4a? P1e # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P1f P1d S3h P3d P7f P8f P8f R8f P*2d P2d R2d # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P1f P1d S3h P6d P7f S6c? B7g # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P1f P1d S3h P6d P7f P3d R3f G3c B7g # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P1f P1d S3h P6d P7f P3d R3f B8h+ S8h B*2h R3d N3c L1g # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P1f P1d S3h P6d P7f P8f P8f R8f P*2d P2d R2d P*2c? R6d # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P1f P1d S3h P6d P7f P8f P8f R8f P*2d P2d R2d S6c? P1e P*2c R2e P1e P*1d R8b R1e P3d P*8g # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P1f P1d S3h P6d P7f P8f P8f R8f P*2d P2d R2d R8b! R6d R8h+ R6b+ G6b S8h # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P1f P1d S3h P6d P7f P8f P8f R8f P*2d P2d R2d R8b! P1e P*8f P*8d P8g+ G8g R8d P*8f P1e P*1d P*2c R2e L1d # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P1f P1d S3h P6d P7f P8f P8f R8f P*2d P2d R2d R8b! P1e P1e P*1d P*8f P*2c P8g+ G8g # P2f P8d P2e P8e G7h G3b P2d P2d R2d P*2c R2f S6b P1f P1d S3h P6d P7f P8f P8f R8f P*2d P2d R2d R8b! P1e P1e P*1d P*2c R6d R8h+ R6b+ G6b S8h # gnushogi-1.5pre/misc/gnuminishogi.tbk0000644000175000017500000000000012363540324014757 00000000000000gnushogi-1.5pre/compile0000755000175000017500000001624512363550544012227 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: gnushogi-1.5pre/install-sh0000755000175000017500000003325512363550544012655 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: gnushogi-1.5pre/doc/0000755000175000017500000000000012364540720011462 500000000000000gnushogi-1.5pre/doc/tutorial2.gam0000644000175000017500000001337612363540323014025 000000000000001.P-7f [ This opens the bishop's diagonal. ] 1.... P-8d [ This prepares a path for the rook. It declares a Static Rook opening for White.] 2.S-6h [ As long as white has a closed bishop's diagonal, S-6h can be played. Black has the option to play Ranging Rook. In this case, the silver should be placed at 6g after pushing the pawn. If Black wants to play Static Rook, the bishop's diagonal can be blocked with S-7g.] 2.... P-3d [ Now, Black has something to decide. S-7g will lead to a Static Rook opening. P-6f normally would be followed by a Ranging Rook opening, although it is possible in Static Rook. Blocking the diagonal with tha pawn would prevent a bishop exchange opening. Bishop exchange openings are not easy for beginners. Bx2b+ is also possible, but it would lead to the bishop exchange opening with a free development move for White.] 3.P-6f S-6b [ Protect 5c and keep possible developments to 7c and 6c. Another possible move is S-7b aiming at S-8c and further development towards the weak head of Black's bishop.] 4.S-6g [ This would be very unusual for Static Rook openings. Therefore, it Black will most probably move into a Ranging Rook opening. The Gold Fortress is the castle, which is usually used in Static Rook vs. Static Rook openings, but S-6g would lead to the Silver Fortress if Black will play Static Rook. Nevertheless, White cannot be shure about Black's plans...] 4.... P-5d [ This is possible when playing against Rainging Rook or against Static Rook.] 5.P-9f [ The time when, when an edge pawn should or can be pushed, is critical. Pushing the edge pawn of a castle is more critical than pushing the edge pawn of the attackers side. ] 5.... G6a-5b [ The edge pawn is not pushed, because in Ranging Rook openings, attacks will be on files supported by the rook. It is very difficult to attack on the edge. Therefore, White doesn't fear P-9e, because this would give White an extra tempo. Normally, G6a-5b is the first move for building a Boat castle, the typical castle of the Static Rook side when playing against Ranging Rook. Even if Black decides to play Static Rook, it is still possible to move into the Gold Fortress. G6a-5b strengthen White's castle side. White keeps the bishop's diagonal open, because this keeps the threat of exchaning bishops in case Black plans to play Ranging Rook (which is most probably the case). Exchanging bishops is better for the Static Rook side when playing agaainst Ranging Rook. G4a-3b would declare to create a Fortess castle, which normally played in Static Rook vs. Static Rook games.] 6.R-5h [ Now, a center file Ranging Rook is declared.] 6.... K-4b [ White moves into the Boat castle. It would still be possible to build A Fortress.] 7.K-4h [ Now, Black definitely plays a Ranging Rook openings. It would make no sense to keep a Static Rook option for Black in mind. Most likely, Black will move into a Mino castle. The edge pawn has not been pushed to 1f, therefore also the Bear-in-the-hole castle is possible.] 7.... K-3b 8.K-3h P-1d [ White's Boat Castle is complete. Black still moves into the Mino Castle. Pushing an edge pawn is often answered by pushing the opposing edge pawn.] 9.P-1f [ In the Bear-in-the-Hole Castle, the edge pawn would normally not be pushed. Therefore, Black will adopt some version of the Mino Castle after building the basic pattern.] 9.... P-9d [ Preparing own attack possibilities. L-9c, R-9b would lead to an edge attack, which would be difficult for Black to defend. In this case, Black would aim at a counterattack. This moves prevents P9f-9e, an attack move of Black. Preventing attack moves normally lead to slow games.] 10.K-2h [ Moving into the Mono Castle.] 10.... S-4b [ Typical development against Ranging Rook. Now, S6b-5c or S4b-5c is possible. Normally, the Static Rook side waits some moves until the attack formation is decided. There is some time, because Black's first order castle is not created, yet.] 11.S-3h [ This completes the so-called Incomplete Mino Castle. The other Gold should be on 5h to create a Complete Mino. The best and most used castles use three generals to defend the king.] 11.... P-8e [ Increase preassure to the bishop's head. Black has to be aware of P8e-8f. Exchanging the pawns would be good for White, because it would open the Rook file for White. Furthermore, it would be impossible to defend the square 8g if White now could exchange the pawns...] 12.B-7g [ This is the only defense. If Black would play Static Rook, also a silver could defend on 7g, but in Ranging Rook openings, the bishop almost always is placed on 7g against a pawn advanced to 8e.] 12.... S-3c [ Decision towards a specific attack formation for White. This move aimes at Black's castle.] 13.P-4f [ Towards a second stage castle which is stronger at its head.] 13.... P-3e [ Vanguard pawn opening. The Vanguard pawn must be supported, i.e. S-3d is recommended.] 14.S-4g [ Strengthen the castle at the head. There is some need to protect the silver and to protect the kings side, i.e. G-3h is very recommended.] 14.... S-3d 15.P-5f [ This is another move towards a slow game. Black does not want to go into a skirmish at the center file.] 15.... S-5c [ Support attack of White either towards Black's king or supporting the White rook pawn. Normally, the Vanguard pawn will further be strengthen.] 16.R-8h [ It is common in Ranging Rook openings to switch the rook from file to file, testing the opponent's response. Opposing rooks is the most aggressive version.] 16.... P-4d [ This signals the start of the middle-game. The pawn will advance to 4e, which will lead to the first exchange.] 17.G-3h [ It's time to strengthen the castle, because the middle-game will soon start.] 17.... P-4e gnushogi-1.5pre/doc/BOOKFILES0000644000175000017500000000727312363540323012651 00000000000000Binary book files ----------------- In GNU Shogi the book file is a binary file. The binary book file is called "gnushogi.bbk". It is intended that book files in text form (hereafter referred to as "text book files") will only be used to generate the binary file (see remarks about the text book file syntax below). The Makefile will generate a file called "gnushogi.bbk" in the "src" directory from the text book file "gnushogi.tbk" in the "misc" directory if "make gnushogi.bbk" is entered (the "gnushogir" executable must be available in the "src" directory or it will be created). "make install" also copies the "gnushogi.bbk" to the installation directory for libraries. Adding new opening lines ------------------------ You can add entries to the binary file by providing a text book file "gnushogi.tbk" in the installation directory. After starting gnushogi, the new entries will be added. It is recommended to remove the text book file after adding the entries to the binary book file (or gnushogi will always check for new entries). You can also use the "bsave" command while running gnushogi. The current moves will be appended to the named file in a text book file style. Syntax of text book files ------------------------- Text book files are used to generate the binary book file. You must follow a special text book file syntax while adding an opening line. The book file parser (program that interpretes the text book moves) is able to accept several common Shogi notations. It also allows the writer to include comments. All characters in a line following a '#' character are comments. The moves of an opening line are always between two lines with a '#' as its first character. Therefore, you must not use 1st-column-'#'-comments to give comments to an opening line. "In-opening" comments are included in brackets ('[' ... ']'). After each ply, you can add a comment in parantheses ('(' ... ')'). This is normally used in Shogi notations to indicate the amount of time used by the player to enter that move. There are several possibilites for describing a move. Examples are 7g7f P7f P7g-7f P-7f 3c3d +B3cx3d +Bx3d +B3d 2d2c+ P2c+ P2dx2c+ Px2c+ When you use a character to indicate the piece type, you have to observe whether the piece is promoted or not, i.e for a promoted piece you have to indicate this using a '+'. In Shogi notations, the '+' for promoted pieces may be important in order to avoid ambiguities. For example # # Double Fortress P7f P8d [ this is an "in-opening" comment ] S6h P8e(1) # this is an "off-opening" comment defines an opening line with two moves (four plys). The first comment line above an opening line serves as the name of the opening line. This name is used in case of errors in the opening line. You can use move numbers given as a decimal number followed by a '.'. You can indicate good and bad moves using the character combinations ? ?? ?! ! !! !? !?/?! ?!/!? They have the same meaning as in chess. The characters must directly follow a move, i.e. there must be no spaces between the move and the bad/good indicator. P5e-5d? is correct, while P5e-5d ? is incorrect. The indicators can be seen as a comment with one exception: if the first character of the indicator is a '?', the move is marked as BAD_MOVE by the program and it is not used by the computer if the computer has the option to make this move. You can add some words which indicate the end of a game. These words are Resigns Sennichite Jishogi 1-0 0-1 "Sennichite" means "draw by repitition and "Jishogi" means "impasse". Request ------- If you add new opening lines, please make them available to the GNU Shogi community. Thank you. gnushogi-1.5pre/doc/PORTING0000644000175000017500000000414112363540323012445 00000000000000Porting GNU shogi ----------------- NOTE: this file may be seriously outdated. I haven't had time to go over it yet. Let me know if there are problems. -- Mike (mvanier@cs.caltech.edu) This describes how to port GNU shogi to machines with scarce memory. GNU shogi's minimal requirements are: - approximately 200 kBytes memory for the executable program. - at least 300 kBytes for data structures. You don't want to port GNU shogi to a machine with less memory than that. GNU shogi is optimized for speed and that means that memory has been used when there has been a tradeoff between memory usage and speed. If you intend to run GNU shogi on a machine with less than 4 Mbyte memory the size of some data structures have to be reduced. Here is a list of the largest data structures in GNU shogi, their sizes and a small comment on what can be done to reduce their size: ttable: 1.5 MByte (#define vttblsz ) etab: 1.4 MByte (can be removed) Tree: 42 kByte (change f,t to unsigned char) history: 131 kByte (can be removed, not recommended) nextpos: 98 kByte (nothing save rewiting all move generation) nextdir: 98 kByte (nothing save rewiting all move generation) distdata: 6 kByte (can be changed to a macro) ptype_distdata: 98 kByte (can be changed to a procedure) hashcode: 26 kByte (no reduction possible) First of all, start by reducing the transposition table size, this is done by setting vttblsz in (gnushogi.h). If the transopsition table does not fit entierly in memory it will have a detrimental effect on performance. You can remove the transposition table by defining compiler option NOTTABLE. You can remove the static evaluation cache by omitting the compiler option CACHE. You can remove the history table by omitting the compiler option HISTORY (NOT recommended). If this isn't enough, reconsider if you really want to do this port. There isn't really that much to gain by changing the other data structures. There are some switches in order to enable space reduction: #define SAVE_PTYPE_DISTDATA (replace ptype_distdata by a procedure) #define SAVE_DISTDATA (replace distdata by a macro) gnushogi-1.5pre/doc/gnushogi.60000644000175000017500000002560612363540323013323 00000000000000.TH gnushogi 6 .SH NAME gnushogi \- GNU Shogi (Japanese Chess) .SH SYNOPSIS .B gnushogi [ .B [[-]a] .B [-b bookfile] .B [-B binbookfile] .B [-C] .B [-h langfile] .B [-L langfile] .B [-r length] .B [-R] .B [-s pathname] [-l pathname] .B [-S binbooksize] .B [-t] [-c size] .B [-T size] .B [-v] .B [-x] .B [-X] .B arg1 arg2 ] .SH DESCRIPTION .I Gnushogi plays a game of japanese chess (shogi) against the user or it plays against itself. .PP At startup .I Gnushogi reads the .I binbook file if it is present. It then looks for a .I book file. If it is present it adds its contents to the .I binbook data. If the .I binbook file is writable a new combined .I binbook file is written. .PP .I Gnushogi is a modified version of the gnuchess program. It has a simple alphanumeric board display, or it can be compiled for use with the .B xshogi program under X windows. The program gets its opening moves from the file .B gnushogi.bbk which is located in a directory specified in the Makefile. To invoke the program type: .TP .B gnushogi -C - simple curses based version .TP .B gnushogi -X (or just gnushogi) - xshogi compatible version .TP .B gnushogi -R - raw test display version .SH TIME CONTROLS .PP If one argument is given, it is the search time per move in [minutes:]seconds. So .B gnushogi 30 will generate one move every 30 seconds, while .B gnushogi 5:00 will generate one move every 5 minutes. If two or more arguments are given, they will be used to set tournament time controls with the first argument of each pair being the number of moves and the second being the total clock time in minutes[:seconds]. Thus, entering .B gnushogi 60 5 will set the clocks for 5 minutes (300 seconds) for the first 60 moves, and .B gnushogi 30 3:30 will allow 3 minutes and 30 seconds for 30 moves. .B gnushogi 30 5 1 :30 will allow 5 minutes for the first 30 moves and 30 seconds for each move after that. Up to 4 pairs of controls may be specified. If no argument is given the program will prompt the user for level of play. For use with .B xshogi see the documentation on that program. .SH BOOK .PP The book .I gnushogi.tbk consists of a sequence of openings. An opening begins with a line starting with a .B # , the rest of the line is a comment. Following this is a series of moves in algebraic notation alternating black and white separated by white space. A move may have a .B ? after it indicating this move should never be made in this position. Moves are stored as position:move so transpositions between openings can take place. .SH HASHFILE .PP The hashfile if created should be on the order of 4 megabytes or .B gnushogi -c 22. This file contains positions and moves learned from previous games. If a hashfile is used the computer makes use of the experience it gained in past games. Tests run so far show that it plays no worse with the hashfile than without, but it is not clear yet whether it provides a real advantage. .SH LEGAL MOVES .PP .B Note: Piece letters are determined by the language file. What is specified here is the default (English). .PP Once .I gnushogi is invoked, the program will display the board and prompt the user for a move. To enter a move, use the notation .B 7g7f where the first letter-number pair indicates the origin square and the second letter-number pair indicates the destination square. An alternative is to use the notation .B P7f where the first letter indicates the piece type (P,L,N,S,G,B,R,K). To promote append a + the type of the new piece to the move, as in .B 2d2c+ or .B P2c+. Note that you must use capital letters for the pieces by default. .SH "COMMAND-LINE OPTIONS" .TP .B -a Do not search on opponent's time. .TP .B a Do search on opponent's time. .TP .B -b bookfile Use bookfile for opening book. .TP .B -B binbookfile Use binbookfile for binary opening book. .TP .B -c size Create a new HASHFILE. File size is 2^size entries of approximately 65+? bytes. .TP .B -C Use curses-based display mode. .TP .B -h Do not use hashfile. .TP .B h Do use hashfile. .TP .B -l pathname Pathname of the loadfile use with .BR get or .BR xget. .TP .B -L lang Use language .I lang from the file .B gnushogi.lang. If -L is not specified it uses the first language in the file. .TP .B -P plylevels Number of plys to include in the binbookfile. For generating a binbookfile. .TP .B -r length Rehash length times in searching entries for position in transposition table. .TP .B -R Use raw text display mode. This can be used for dumb terminals or for systems that don't have curses. .TP .B -s pathname Pathname of the save file to use with the .BR save command. .TP .B -S size Size of binbookfile for memory based books. For creating a binbookfile. .TP .B -t Show statistics for HASHFILE .TP .B -T size Set the transposition table size to 2^size entries. .TP .B -v Show version and patchlevel. .TP .B -x value Use .BR value as the evaluation window .BR xwndw. .TP .B -X Use xshogi display mode (the default). .SH "COMMANDS" .PP In addition to legal moves, the following commands are available as responses. .B Note: command names are determined by the .I language file and may vary with the implementation. The default language is English. .PP .B alg -- allow algebraic input (not implemented) .PP .B Awindow -- change Alpha window (default score + 90) .PP .B Bwindow -- change Beta window (default score - 90) .PP .B beep -- toggles beeping after each move (default: on). .PP .B bd -- updates the current board position on the display. .PP .B book -- turns off use of the opening library. .PP .B both -- causes the computer to play both sides of a shogi game. .PP .B black -- causes the computer to take the white pieces, if the computer is to move first. .PP .B bsave -- saves a game to disk as a book textfile. The program will prompt the user for a file name. .PP .B gamein -- toggles game mode time control. Assumes the time specified for time control is the time for a complete game. Input with the level command should be the game time and the expected number of moves in a game. .B go command must be given. .PP .B coords -- show coordinates on the display (visual only) .PP .B contempt -- allows the value of .I contempt to be modified. .PP .B debug -- asks for a piece as color piece, as wb or bn, and shows its calculated value on each square. .PP .B debuglevel -- sets level of debugging output if compiled with debug options. .PP .B depth -- allows the user to change the search depth of the program. The maximum depth is 29 ply. Normally the depth is set to 29 and the computer terminates its search based on elapsed time rather than depth. If depth is set to (say) 4 ply, the program will search until all moves have been examined to a depth of 4 ply (with extensions up to 11 additional ply for sequences of checks and captures). If you set a maximum time per move and also use the depth command, the search will stop at the specified time or the specified depth, whichever comes first. .PP .B easy -- toggles easy mode (thinking on opponents time) on and off. The default is easy mode ON. If easy mode is disabled, the keyboard is polled for input every so often and when input is seen the search is terminated. It may also be terminated with a .I sigint. .PP .B edit -- allows the user to set up a board position. .B # - command will clear the board. .B c - toggle piece color. .B . - command will exit setup mode. .B p3b - place a pawn on 3b .B p3b+ - place a promoted pawn on 3b .B p* - place a pawn to the captured pieces Pieces are entered by typing a letter (p,l,n,s,g,b,r,k) for the piece followed by the coordinate. The usual warning about the .I language file applies. .PP .B exit -- exits gnushogi. .PP .B first -- tells the computer to move first. Computer begins searching for a move. (same as "go"). .PP .B force -- allows the user to enter moves for both sides. To get the program to play after a sequence of moves has been entered use the 'black' or 'white' commands. .PP .B get -- retrieves a game from disk. The program will prompt the user for a file name. .PP .B hash -- use/don't use hashfile. .PP .B hashdepth -- allows the user to change the minimum depth for using the hashfile and the number of moves from the beginning of the game to use it. .PP .B help -- displays a short description of the commands and the current status of options. .PP .B go -- tells the computer to move first. Computer begins searching for a move. (same as "first"). .PP .B hint -- causes the program to supply the user with its predicted move. .PP .B level -- allows the user to set time controls such as 60 moves in 5 minutes etc. In tournament mode, the program will vary the time it takes for each move depending on the situation. If easy mode is disabled (using the 'easy' command), the program will often respond with its move immediately, saving time on its clock for use later on. .PP .B list -- writes the game moves and some statistics on search depth, nodes, and time to the file 'shogi.lst'. .PP .B material -- toggle material flag - draws on no pawns and both sides < rook .PP .B new -- starts a new game. .PP .B p -- evaluates the board and shows the point score for each piece. The total score for a position is the sum of these individual piece scores. .PP .B post -- causes the program to display the principal variation and the score during the search. A score of 100 is equivalent to a 1 pawn advantage for the computer. .PP .B quit -- exits the game. .PP .B random -- causes the program to randomize its move selection slightly. .PP .B rcptr -- set recapture mode. .PP .B remove -- backout the last level for both sides. Equal to 2 .I undo's. .PP .B reverse -- causes the board display to be reversed. That is, the black pieces will now appear at the top of the board. .PP .B rv -- reverse board display. .PP .B save -- saves a game to disk. The program will prompt the user for a file name. .PP .B switch -- causes the program to switch places with the opponent and begin searching. .PP .B test -- performs some speed tests for MoveList and CaptureList generation, and ScorePosition position scoring for the current board. .PP .B time -- set computer's time remaining, intended for synchronizing clocks among multiple players. .PP .B tsume -- toggle tsume mode. In tsume mode, not all possible moves will be generated. If a king is in check, only moves that get the king out of check are generated. If the king is not in check, only moves that give check to the opponent's king are generated. .PP .B undo -- undoes the last move whether it was the computer's or the human's. You may also type "remove". This is equivalent to two "undo"'s (e.g. retract one move for each side). .PP .B white -- causes the computer to take the black pieces, if the computer is to move first the .B go command must be given. .PP .B xget -- read an .I xshogi position file. .PP .B xsave -- save as an .I xshogi position file. .PP .B xwndw -- change X window. The window around alpha/beta used to determine whether the position should be scored or just estimated. .SH BUGS .PP .fi .SH SEE ALSO .nf xshogi(6) .fi gnushogi-1.5pre/doc/texinfo.tex0000644000175000017500000116703612363550545013623 00000000000000% texinfo.tex -- TeX macros to handle Texinfo files. % % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % \def\texinfoversion{2013-02-01.11} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, % 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as % published by the Free Software Foundation, either version 3 of the % License, or (at your option) any later version. % % This texinfo.tex file is distributed in the hope that it will be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU % General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program. If not, see . % % As a special exception, when this file is read by TeX when processing % a Texinfo source document, you may use the result without % restriction. This Exception is an additional permission under section 7 % of the GNU General Public License, version 3 ("GPLv3"). % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: % http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or % http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or % http://www.gnu.org/software/texinfo/ (the Texinfo home page) % The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. % % Send bug reports to bug-texinfo@gnu.org. Please include including a % complete document in each bug report with which we can reproduce the % problem. Patches are, of course, greatly appreciated. % % To process a Texinfo manual with TeX, it's most reliable to use the % texi2dvi shell script that comes with the distribution. For a simple % manual foo.texi, however, you can get away with this: % tex foo.texi % texindex foo.?? % tex foo.texi % tex foo.texi % dvips foo.dvi -o # or whatever; this makes foo.ps. % The extra TeX runs get the cross-reference information correct. % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. % % It is possible to adapt texinfo.tex for other languages, to some % extent. You can get the existing language-specific files from the % full Texinfo distribution. % % The GNU Texinfo home page is http://www.gnu.org/software/texinfo. \message{Loading texinfo [version \texinfoversion]:} % If in a .fmt file, print the version number % and turn on active characters that we couldn't do earlier because % they might have appeared in the input file name. \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} \chardef\other=12 % We never want plain's \outer definition of \+ in Texinfo. % For @tex, we can use \tabalign. \let\+ = \relax % Save some plain tex macros whose names we will redefine. \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c \let\ptexcomma=\, \let\ptexdot=\. \let\ptexdots=\dots \let\ptexend=\end \let\ptexequiv=\equiv \let\ptexexclam=\! \let\ptexfootnote=\footnote \let\ptexgtr=> \let\ptexhat=^ \let\ptexi=\i \let\ptexindent=\indent \let\ptexinsert=\insert \let\ptexlbrace=\{ \let\ptexless=< \let\ptexnewwrite\newwrite \let\ptexnoindent=\noindent \let\ptexplus=+ \let\ptexraggedright=\raggedright \let\ptexrbrace=\} \let\ptexslash=\/ \let\ptexstar=\* \let\ptext=\t \let\ptextop=\top {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode % If this character appears in an error message or help string, it % starts a new line in the output. \newlinechar = `^^J % Use TeX 3.0's \inputlineno to get the line number, for better error % messages, but if we're using an old version of TeX, don't do anything. % \ifx\inputlineno\thisisundefined \let\linenumber = \empty % Pre-3.0. \else \def\linenumber{l.\the\inputlineno:\space} \fi % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi \ifx\putworderror\undefined \gdef\putworderror{error}\fi \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi \ifx\putwordin\undefined \gdef\putwordin{in}\fi \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi \ifx\putwordof\undefined \gdef\putwordof{of}\fi \ifx\putwordon\undefined \gdef\putwordon{on}\fi \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi % \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi % \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi % Since the category of space is not known, we have to be careful. \chardef\spacecat = 10 \def\spaceisspace{\catcode`\ =\spacecat} % sometimes characters are active, so we need control sequences. \chardef\ampChar = `\& \chardef\colonChar = `\: \chardef\commaChar = `\, \chardef\dashChar = `\- \chardef\dotChar = `\. \chardef\exclamChar= `\! \chardef\hashChar = `\# \chardef\lquoteChar= `\` \chardef\questChar = `\? \chardef\rquoteChar= `\' \chardef\semiChar = `\; \chardef\slashChar = `\/ \chardef\underChar = `\_ % Ignore a token. % \def\gobble#1{} % The following is used inside several \edef's. \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} % Hyphenation fixes. \hyphenation{ Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script ap-pen-dix bit-map bit-maps data-base data-bases eshell fall-ing half-way long-est man-u-script man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces spell-ing spell-ings stand-alone strong-est time-stamp time-stamps which-ever white-space wide-spread wrap-around } % Margin to add to right of even pages, to left of odd pages. \newdimen\bindingoffset \newdimen\normaloffset \newdimen\pagewidth \newdimen\pageheight % For a final copy, take out the rectangles % that mark overfull boxes (in case you have decided % that the text looks ok even though it passes the margin). % \def\finalout{\overfullrule=0pt } % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. We also make % some effort to order the tracing commands to reduce output in the log % file; cf. trace.sty in LaTeX. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% \def\loggingall{% \tracingstats2 \tracingpages1 \tracinglostchars2 % 2 gives us more in etex \tracingparagraphs1 \tracingoutput1 \tracingmacros2 \tracingrestores1 \showboxbreadth\maxdimen \showboxdepth\maxdimen \ifx\eTeXversion\thisisundefined\else % etex gives us more logging \tracingscantokens1 \tracingifs1 \tracinggroups1 \tracingnesting2 \tracingassigns1 \fi \tracingcommands3 % 3 gives us more in etex \errorcontextlines16 }% % @errormsg{MSG}. Do the index-like expansions on MSG, but if things % aren't perfect, it's not the end of the world, being an error message, % after all. % \def\errormsg{\begingroup \indexnofonts \doerrormsg} \def\doerrormsg#1{\errmessage{#1}} % add check for \lastpenalty to plain's definitions. If the last thing % we did was a \nobreak, we don't want to insert more space. % \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount \removelastskip\penalty-50\smallskip\fi\fi} \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount \removelastskip\penalty-100\medskip\fi\fi} \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount \removelastskip\penalty-200\bigskip\fi\fi} % Do @cropmarks to get crop marks. % \newif\ifcropmarks \let\cropmarks = \cropmarkstrue % % Dimensions to add cropmarks at corners. % Added by P. A. MacKay, 12 Nov. 1986 % \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines \newdimen\cornerlong \cornerlong=1pc \newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in % Output a mark which sets \thischapter, \thissection and \thiscolor. % We dump everything together because we only have one kind of mark. % This works because we only use \botmark / \topmark, not \firstmark. % % A mark contains a subexpression of the \ifcase ... \fi construct. % \get*marks macros below extract the needed part using \ifcase. % % Another complication is to let the user choose whether \thischapter % (\thissection) refers to the chapter (section) in effect at the top % of a page, or that at the bottom of a page. The solution is % described on page 260 of The TeXbook. It involves outputting two % marks for the sectioning macros, one before the section break, and % one after. I won't pretend I can describe this better than DEK... \def\domark{% \toks0=\expandafter{\lastchapterdefs}% \toks2=\expandafter{\lastsectiondefs}% \toks4=\expandafter{\prevchapterdefs}% \toks6=\expandafter{\prevsectiondefs}% \toks8=\expandafter{\lastcolordefs}% \mark{% \the\toks0 \the\toks2 \noexpand\or \the\toks4 \the\toks6 \noexpand\else \the\toks8 }% } % \topmark doesn't work for the very first chapter (after the title % page or the contents), so we use \firstmark there -- this gets us % the mark with the chapter defs, unless the user sneaks in, e.g., % @setcolor (or @url, or @link, etc.) between @contents and the very % first @chapter. \def\gettopheadingmarks{% \ifcase0\topmark\fi \ifx\thischapter\empty \ifcase0\firstmark\fi \fi } \def\getbottomheadingmarks{\ifcase1\botmark\fi} \def\getcolormarks{\ifcase2\topmark\fi} % Avoid "undefined control sequence" errors. \def\lastchapterdefs{} \def\lastsectiondefs{} \def\prevchapterdefs{} \def\prevsectiondefs{} \def\lastcolordefs{} % Main output routine. \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} \newbox\headlinebox \newbox\footlinebox % \onepageout takes a vbox as an argument. Note that \pagecontents % does insertions, but you have to call it yourself. \def\onepageout#1{% \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% % {% % Have to do this stuff outside the \shipout because we want it to % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. % \indexdummies % don't expand commands in the output. \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. % We don't want .vr (or whatever) entries like this: % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} % "\acronym" won't work when it's read back in; % it needs to be % {\code {{\tt \backslashcurfont }acronym} \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi % \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize \vskip-\topandbottommargin \vtop to0pt{% \line{\ewtop\hfil\ewtop}% \nointerlineskip \line{% \vbox{\moveleft\cornerthick\nstop}% \hfill \vbox{\moveright\cornerthick\nstop}% }% \vss}% \vskip\topandbottommargin \line\bgroup \hfil % center the page within the outer (page) hsize. \ifodd\pageno\hskip\bindingoffset\fi \vbox\bgroup \fi % \unvbox\headlinebox \pagebody{#1}% \ifdim\ht\footlinebox > 0pt % Only leave this space if the footline is nonempty. % (We lessened \vsize for it in \oddfootingyyy.) % The \baselineskip=24pt in plain's \makefootline has no effect. \vskip 24pt \unvbox\footlinebox \fi % \ifcropmarks \egroup % end of \vbox\bgroup \hfil\egroup % end of (centering) \line\bgroup \vskip\topandbottommargin plus1fill minus1fill \boxmaxdepth = \cornerthick \vbox to0pt{\vss \line{% \vbox{\moveleft\cornerthick\nsbot}% \hfill \vbox{\moveright\cornerthick\nsbot}% }% \nointerlineskip \line{\ewbot\hfil\ewbot}% }% \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox }% end of group with \indexdummies \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } \newinsert\margin \dimen\margin=\maxdimen \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} {\catcode`\@ =11 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi % marginal hacks, juha@viisa.uucp (Juha Takala) \ifvoid\margin\else % marginal info is present \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi \dimen@=\dp#1\relax \unvbox#1\relax \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } % Here are the rules for the cropmarks. Note that they are % offset so that the space between them is truly \outerhsize or \outervsize % (P. A. MacKay, 12 November, 1986) % \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} \def\nstop{\vbox {\hrule height\cornerthick depth\cornerlong width\cornerthick}} \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} \def\nsbot{\vbox {\hrule height\cornerlong depth\cornerthick width\cornerthick}} % Parse an argument, then pass it to #1. The argument is the rest of % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. % \def\parsearg{\parseargusing{}} \def\parseargusing#1#2{% \def\argtorun{#2}% \begingroup \obeylines \spaceisspace #1% \parseargline\empty% Insert the \empty token, see \finishparsearg below. } {\obeylines % \gdef\parseargline#1^^M{% \endgroup % End of the group started in \parsearg. \argremovecomment #1\comment\ArgTerm% }% } % First remove any @comment, then any @c comment. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} % Each occurrence of `\^^M' or `\^^M' is replaced by a single space. % % \argremovec might leave us with trailing space, e.g., % @end itemize @c foo % This space token undergoes the same procedure and is eventually removed % by \finishparsearg. % \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% \def\temp{#3}% \ifx\temp\empty % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: \let\temp\finishparsearg \else \let\temp\argcheckspaces \fi % Put the space token in: \temp#1 #3\ArgTerm } % If a _delimited_ argument is enclosed in braces, they get stripped; so % to get _exactly_ the rest of the line, we had to prevent such situation. % We prepended an \empty token at the very beginning and we expand it now, % just before passing the control to \argtorun. % (Similarly, we have to think about #3 of \argcheckspacesY above: it is % either the null string, or it ends with \^^M---thus there is no danger % that a pair of braces would be stripped. % % But first, we have to remove the trailing space token. % \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} % \parseargdef\foo{...} % is roughly equivalent to % \def\foo{\parsearg\Xfoo} % \def\Xfoo#1{...} % % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my % favourite TeX trick. --kasal, 16nov03 \def\parseargdef#1{% \expandafter \doparseargdef \csname\string#1\endcsname #1% } \def\doparseargdef#1#2{% \def#2{\parsearg#1}% \def#1##1% } % Several utility definitions with active space: { \obeyspaces \gdef\obeyedspace{ } % Make each space character in the input produce a normal interword % space in the output. Don't allow a line break at this space, as this % is used only in environments like @example, where each line of input % should produce a line of output anyway. % \gdef\sepspaces{\obeyspaces\let =\tie} % If an index command is used in an @example environment, any spaces % therein should become regular spaces in the raw index file, not the % expansion of \tie (\leavevmode \penalty \@M \ ). \gdef\unsepspaces{\let =\space} } \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} % Define the framework for environments in texinfo.tex. It's used like this: % % \envdef\foo{...} % \def\Efoo{...} % % It's the responsibility of \envdef to insert \begingroup before the % actual body; @end closes the group after calling \Efoo. \envdef also % defines \thisenv, so the current environment is known; @end checks % whether the environment name matches. The \checkenv macro can also be % used to check whether the current environment is the one expected. % % Non-false conditionals (@iftex, @ifset) don't fit into this, so they % are not treated as environments; they don't open a group. (The % implementation of @end takes care not to call \endgroup in this % special case.) % At run-time, environments start with this: \def\startenvironment#1{\begingroup\def\thisenv{#1}} % initialize \let\thisenv\empty % ... but they get defined via ``\envdef\foo{...}'': \long\def\envdef#1#2{\def#1{\startenvironment#1#2}} \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} % Check whether we're in the right environment: \def\checkenv#1{% \def\temp{#1}% \ifx\thisenv\temp \else \badenverr \fi } % Environment mismatch, #1 expected: \def\badenverr{% \errhelp = \EMsimple \errmessage{This command can appear only \inenvironment\temp, not \inenvironment\thisenv}% } \def\inenvironment#1{% \ifx#1\empty outside of any environment% \else in environment \expandafter\string#1% \fi } % @end foo executes the definition of \Efoo. % But first, it executes a specialized version of \checkenv % \parseargdef\end{% \if 1\csname iscond.#1\endcsname \else % The general wording of \badenverr may not be ideal. \expandafter\checkenv\csname#1\endcsname \csname E#1\endcsname \endgroup \fi } \newhelp\EMsimple{Press RETURN to continue.} % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space % at the beginning of a line will start with \penalty -- and % since \penalty is valid in vertical mode, we'd end up putting the % penalty on the vertical list instead of in the new paragraph. {\catcode`@ = 11 % Avoid using \@M directly, because that causes trouble % if the definition is written into an index file. \global\let\tiepenalty = \@M \gdef\tie{\leavevmode\penalty\tiepenalty\ } } % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } % @* forces a line break. \def\*{\unskip\hfil\break\hbox{}\ignorespaces} % @/ allows a line break. \let\/=\allowbreak % @. is an end-of-sentence period. \def\.{.\spacefactor=\endofsentencespacefactor\space} % @! is an end-of-sentence bang. \def\!{!\spacefactor=\endofsentencespacefactor\space} % @? is an end-of-sentence query. \def\?{?\spacefactor=\endofsentencespacefactor\space} % @frenchspacing on|off says whether to put extra space after punctuation. % \def\onword{on} \def\offword{off} % \parseargdef\frenchspacing{% \def\temp{#1}% \ifx\temp\onword \plainfrenchspacing \else\ifx\temp\offword \plainnonfrenchspacing \else \errhelp = \EMsimple \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% \fi\fi } % @w prevents a word break. Without the \leavevmode, @w at the % beginning of a paragraph, when TeX is still in vertical mode, would % produce a whole line of output instead of starting the paragraph. \def\w#1{\leavevmode\hbox{#1}} % @group ... @end group forces ... to be all on one page, by enclosing % it in a TeX vbox. We use \vtop instead of \vbox to construct the box % to keep its height that of a normal line. According to the rules for % \topskip (p.114 of the TeXbook), the glue inserted is % max (\topskip - \ht (first item), 0). If that height is large, % therefore, no glue is inserted, and the space between the headline and % the text is small, which looks bad. % % Another complication is that the group might be very large. This can % cause the glue on the previous page to be unduly stretched, because it % does not have much material. In this case, it's better to add an % explicit \vfill so that the extra space is at the bottom. The % threshold for doing this is if the group is more than \vfilllimit % percent of a page (\vfilllimit can be changed inside of @tex). % \newbox\groupbox \def\vfilllimit{0.7} % \envdef\group{% \ifnum\catcode`\^^M=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi \startsavinginserts % \setbox\groupbox = \vtop\bgroup % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after % the `@group' to put extra space in the output. Since @group % should appear on a line by itself (according to the Texinfo % manual), we don't worry about eating any user text. \comment } % % The \vtop produces a box with normal height and large depth; thus, TeX puts % \baselineskip glue before it, and (when the next line of text is done) % \lineskip glue after it. Thus, space below is not quite equal to space % above. But it's pretty close. \def\Egroup{% % To get correct interline space between the last line of the group % and the first line afterwards, we have to propagate \prevdepth. \endgraf % Not \par, as it may have been set to \lisppar. \global\dimen1 = \prevdepth \egroup % End the \vtop. % \dimen0 is the vertical size of the group's box. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox % \dimen2 is how much space is left on the page (more or less). \dimen2 = \pageheight \advance\dimen2 by -\pagetotal % if the group doesn't fit on the current page, and it's a big big % group, force a page break. \ifdim \dimen0 > \dimen2 \ifdim \pagetotal < \vfilllimit\pageheight \page \fi \fi \box\groupbox \prevdepth = \dimen1 \checkinserts } % % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. % \newhelp\groupinvalidhelp{% group can only be used in environments such as @example,^^J% where each line of input produces a line of output.} % @need space-in-mils % forces a page break if there is not space-in-mils remaining. \newdimen\mil \mil=0.001in \parseargdef\need{% % Ensure vertical mode, so we don't make a big box in the middle of a % paragraph. \par % % If the @need value is less than one line space, it's useless. \dimen0 = #1\mil \dimen2 = \ht\strutbox \advance\dimen2 by \dp\strutbox \ifdim\dimen0 > \dimen2 % % Do a \strut just to make the height of this box be normal, so the % normal leading is inserted relative to the preceding line. % And a page break here is fine. \vtop to #1\mil{\strut\vfil}% % % TeX does not even consider page breaks if a penalty added to the % main vertical list is 10000 or more. But in order to see if the % empty box we just added fits on the page, we must make it consider % page breaks. On the other hand, we don't want to actually break the % page after the empty box. So we use a penalty of 9999. % % There is an extremely small chance that TeX will actually break the % page at this \penalty, if there are no other feasible breakpoints in % sight. (If the user is using lots of big @group commands, which % almost-but-not-quite fill up a page, TeX will have a hard time doing % good page breaking, for example.) However, I could not construct an % example where a page broke at this \penalty; if it happens in a real % document, then we can reconsider our strategy. \penalty9999 % % Back up by the size of the box, whether we did a page break or not. \kern -#1\mil % % Do not allow a page break right after this kern. \nobreak \fi } % @br forces paragraph break (and is undocumented). \let\br = \par % @page forces the start of a new page. % \def\page{\par\vfill\supereject} % @exdent text.... % outputs text on separate line in roman font, starting at standard page margin % This records the amount of indent in the innermost environment. % That's how much \exdent should take out. \newskip\exdentamount % This defn is used inside fill environments such as @defun. \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} % This defn is used inside nofill environments such as @example. \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount \leftline{\hskip\leftskip{\rm#1}}}} % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current % paragraph. For more general purposes, use the \margin insertion % class. WHICH is `l' or `r'. Not documented, written for gawk manual. % \newskip\inmarginspacing \inmarginspacing=1cm \def\strutdepth{\dp\strutbox} % \def\doinmargin#1#2{\strut\vadjust{% \nobreak \kern-\strutdepth \vtop to \strutdepth{% \baselineskip=\strutdepth \vss % if you have multiple lines of stuff to put here, you'll need to % make the vbox yourself of the appropriate size. \ifx#1l% \llap{\ignorespaces #2\hskip\inmarginspacing}% \else \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% \fi \null }% }} \def\inleftmargin{\doinmargin l} \def\inrightmargin{\doinmargin r} % % @inmargin{TEXT [, RIGHT-TEXT]} % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; % else use TEXT for both). % \def\inmargin#1{\parseinmargin #1,,\finish} \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \def\lefttext{#1}% have both texts \def\righttext{#2}% \else \def\lefttext{#1}% have only one text \def\righttext{#1}% \fi % \ifodd\pageno \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin \else \def\temp{\inleftmargin\lefttext}% \fi \temp } % @| inserts a changebar to the left of the current line. It should % surround any changed text. This approach does *not* work if the % change spans more than two lines of output. To handle that, we would % have adopt a much more difficult approach (putting marks into the main % vertical list for the beginning and end of each change). This command % is not documented, not supported, and doesn't work. % \def\|{% % \vadjust can only be used in horizontal mode. \leavevmode % % Append this vertical mode material after the current line in the output. \vadjust{% % We want to insert a rule with the height and depth of the current % leading; that is exactly what \strutbox is supposed to record. \vskip-\baselineskip % % \vadjust-items are inserted at the left edge of the type. So % the \llap here moves out into the left-hand margin. \llap{% % % For a thicker or thinner bar, change the `1pt'. \vrule height\baselineskip width1pt % % This is the space between the bar and the text. \hskip 12pt }% }% } % @include FILE -- \input text of FILE. % \def\include{\parseargusing\filenamecatcodes\includezzz} \def\includezzz#1{% \pushthisfilestack \def\thisfile{#1}% {% \makevalueexpandable % we want to expand any @value in FILE. \turnoffactive % and allow special characters in the expansion \indexnofonts % Allow `@@' and other weird things in file names. \wlog{texinfo.tex: doing @include of #1^^J}% \edef\temp{\noexpand\input #1 }% % % This trickery is to read FILE outside of a group, in case it makes % definitions, etc. \expandafter }\temp \popthisfilestack } \def\filenamecatcodes{% \catcode`\\=\other \catcode`~=\other \catcode`^=\other \catcode`_=\other \catcode`|=\other \catcode`<=\other \catcode`>=\other \catcode`+=\other \catcode`-=\other \catcode`\`=\other \catcode`\'=\other } \def\pushthisfilestack{% \expandafter\pushthisfilestackX\popthisfilestack\StackTerm } \def\pushthisfilestackX{% \expandafter\pushthisfilestackY\thisfile\StackTerm } \def\pushthisfilestackY #1\StackTerm #2\StackTerm {% \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% } \def\popthisfilestack{\errthisfilestackempty} \def\errthisfilestackempty{\errmessage{Internal error: the stack of filenames is empty.}} % \def\thisfile{} % @center line % outputs that line, centered. % \parseargdef\center{% \ifhmode \let\centersub\centerH \else \let\centersub\centerV \fi \centersub{\hfil \ignorespaces#1\unskip \hfil}% \let\centersub\relax % don't let the definition persist, just in case } \def\centerH#1{{% \hfil\break \advance\hsize by -\leftskip \advance\hsize by -\rightskip \line{#1}% \break }} % \newcount\centerpenalty \def\centerV#1{% % The idea here is the same as in \startdefun, \cartouche, etc.: if % @center is the first thing after a section heading, we need to wipe % out the negative parskip inserted by \sectionheading, but still % prevent a page break here. \centerpenalty = \lastpenalty \ifnum\centerpenalty>10000 \vskip\parskip \fi \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi \line{\kern\leftskip #1\kern\rightskip}% } % @sp n outputs n lines of vertical space % \parseargdef\sp{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment % \def\comment{\begingroup \catcode`\^^M=\other% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% \commentxxx} {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} % \let\c=\comment % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. % NCHARS can also be the word `asis' or `none'. % We cannot feasibly implement @paragraphindent asis, though. % \def\asisword{asis} % no translation, these are keywords \def\noneword{none} % \parseargdef\paragraphindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \defaultparindent = 0pt \else \defaultparindent = #1em \fi \fi \parindent = \defaultparindent } % @exampleindent NCHARS % We'll use ems for NCHARS like @paragraphindent. % It seems @exampleindent asis isn't necessary, but % I preserve it to make it similar to @paragraphindent. \parseargdef\exampleindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \lispnarrowing = 0pt \else \lispnarrowing = #1em \fi \fi } % @firstparagraphindent WORD % If WORD is `none', then suppress indentation of the first paragraph % after a section heading. If WORD is `insert', then do indent at such % paragraphs. % % The paragraph indentation is suppressed or not by calling % \suppressfirstparagraphindent, which the sectioning commands do. % We switch the definition of this back and forth according to WORD. % By default, we suppress indentation. % \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} \def\insertword{insert} % \parseargdef\firstparagraphindent{% \def\temp{#1}% \ifx\temp\noneword \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent \else\ifx\temp\insertword \let\suppressfirstparagraphindent = \relax \else \errhelp = \EMsimple \errmessage{Unknown @firstparagraphindent option `\temp'}% \fi\fi } % Here is how we actually suppress indentation. Redefine \everypar to % \kern backwards by \parindent, and then reset itself to empty. % % We also make \indent itself not actually do anything until the next % paragraph. % \gdef\dosuppressfirstparagraphindent{% \gdef\indent{% \restorefirstparagraphindent \indent }% \gdef\noindent{% \restorefirstparagraphindent \noindent }% \global\everypar = {% \kern -\parindent \restorefirstparagraphindent }% } \gdef\restorefirstparagraphindent{% \global \let \indent = \ptexindent \global \let \noindent = \ptexnoindent \global \everypar = {}% } % @refill is a no-op. \let\refill=\relax % If working on a large document in chapters, it is convenient to % be able to disable indexing, cross-referencing, and contents, for test runs. % This is done with @novalidate (before @setfilename). % \newif\iflinks \linkstrue % by default we want the aux files. \let\novalidate = \linksfalse % @setfilename is done at the beginning of every texinfo file. % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% \fixbackslash % Turn off hack to swallow `\input texinfo'. \iflinks \tryauxfile % Open the new aux file. TeX will close it automatically at exit. \immediate\openout\auxfile=\jobname.aux \fi % \openindices needs to do some work in any case. \openindices \let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. \openin 1 texinfo.cnf \ifeof 1 \else \input texinfo.cnf \fi \closein 1 % \comment % Ignore the actual filename. } % Called from \setfilename. % \def\openindices{% \newindex{cp}% \newcodeindex{fn}% \newcodeindex{vr}% \newcodeindex{tp}% \newcodeindex{ky}% \newcodeindex{pg}% } % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} \message{pdf,} % adobe `portable' document format \newcount\tempnum \newcount\lnkcount \newtoks\filename \newcount\filenamelength \newcount\pgn \newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD \newbox\boxA \newcount\countA \newif\ifpdf \newif\ifpdfmakepagedest % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 % can be set). So we test for \relax and 0 as well as being undefined. \ifx\pdfoutput\thisisundefined \else \ifx\pdfoutput\relax \else \ifcase\pdfoutput \else \pdftrue \fi \fi \fi % PDF uses PostScript string constants for the names of xref targets, % for display in the outlines, and in other places. Thus, we have to % double any backslashes. Otherwise, a name like "\node" will be % interpreted as a newline (\n), followed by o, d, e. Not good. % % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and % related messages. The final outcome is that it is up to the TeX user % to double the backslashes and otherwise make the string valid, so % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to % do this reliably, so we use it. % #1 is a control sequence in which to do the replacements, % which we \xdef. \def\txiescapepdf#1{% \ifx\pdfescapestring\thisisundefined % No primitive available; should we give a warning or log? % Many times it won't matter. \else % The expandable \pdfescapestring primitive escapes parentheses, % backslashes, and other special chars. \xdef#1{\pdfescapestring{#1}}% \fi } \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images with PDF output, and none of those formats could be found. (.eps cannot be supported due to the design of the PDF format; use regular TeX (DVI output) for that.)} \ifpdf % % Color manipulation macros based on pdfcolor.tex, % except using rgb instead of cmyk; the latter is said to render as a % very dark gray on-screen and a very dark halftone in print, instead % of actual black. \def\rgbDarkRed{0.50 0.09 0.12} \def\rgbBlack{0 0 0} % % k sets the color for filling (usual text, etc.); % K sets the color for stroking (thin rules, e.g., normal _'s). \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} % % Set color, and create a mark which defines \thiscolor accordingly, % so that \makeheadline knows which color to restore. \def\setcolor#1{% \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% \domark \pdfsetcolor{#1}% } % \def\maincolor{\rgbBlack} \pdfsetcolor{\maincolor} \edef\thiscolor{\maincolor} \def\lastcolordefs{} % \def\makefootline{% \baselineskip24pt \line{\pdfsetcolor{\maincolor}\the\footline}% } % \def\makeheadline{% \vbox to 0pt{% \vskip-22.5pt \line{% \vbox to8.5pt{}% % Extract \thiscolor definition from the marks. \getcolormarks % Typeset the headline with \maincolor, then restore the color. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% }% \vss }% \nointerlineskip } % % \pdfcatalog{/PageMode /UseOutlines} % % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). \def\dopdfimage#1#2#3{% \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% % % pdftex (and the PDF format) support .pdf, .png, .jpg (among % others). Let's try in that order, PDF first since if % someone has a scalable image, presumably better to use that than a % bitmap. \let\pdfimgext=\empty \begingroup \openin 1 #1.pdf \ifeof 1 \openin 1 #1.PDF \ifeof 1 \openin 1 #1.png \ifeof 1 \openin 1 #1.jpg \ifeof 1 \openin 1 #1.jpeg \ifeof 1 \openin 1 #1.JPG \ifeof 1 \errhelp = \nopdfimagehelp \errmessage{Could not find image file #1 for pdf}% \else \gdef\pdfimgext{JPG}% \fi \else \gdef\pdfimgext{jpeg}% \fi \else \gdef\pdfimgext{jpg}% \fi \else \gdef\pdfimgext{png}% \fi \else \gdef\pdfimgext{PDF}% \fi \else \gdef\pdfimgext{pdf}% \fi \closein 1 \endgroup % % without \immediate, ancient pdftex seg faults when the same image is % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) \ifnum\pdftexversion < 14 \immediate\pdfimage \else \immediate\pdfximage \fi \ifdim \wd0 >0pt width \pdfimagewidth \fi \ifdim \wd2 >0pt height \pdfimageheight \fi \ifnum\pdftexversion<13 #1.\pdfimgext \else {#1.\pdfimgext}% \fi \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} % \def\pdfmkdest#1{{% % We have to set dummies so commands such as @code, and characters % such as \, aren't expanded when present in a section title. \indexnofonts \turnoffactive \makevalueexpandable \def\pdfdestname{#1}% \txiescapepdf\pdfdestname \safewhatsit{\pdfdest name{\pdfdestname} xyz}% }} % % used to mark target names; must be expandable. \def\pdfmkpgn#1{#1} % % by default, use a color that is dark enough to print on paper as % nearly black, but still distinguishable for online viewing. \def\urlcolor{\rgbDarkRed} \def\linkcolor{\rgbDarkRed} \def\endlink{\setcolor{\maincolor}\pdfendlink} % % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% \else \csname#1\endcsname \fi} \def\advancenumber#1{\tempnum=\expnumber{#1}\relax \advance\tempnum by 1 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} % % #1 is the section text, which is what will be displayed in the % outline by the pdf viewer. #2 is the pdf expression for the number % of subentries (or empty, for subsubsections). #3 is the node text, % which might be empty if this toc entry had no corresponding node. % #4 is the page number % \def\dopdfoutline#1#2#3#4{% % Generate a link to the node text if that exists; else, use the % page number. We could generate a destination for the section % text in the case where a section has no node, but it doesn't % seem worth the trouble, since most documents are normally structured. \edef\pdfoutlinedest{#3}% \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}% \else \txiescapepdf\pdfoutlinedest \fi % % Also escape PDF chars in the display string. \edef\pdfoutlinetext{#1}% \txiescapepdf\pdfoutlinetext % \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% } % \def\pdfmakeoutlines{% \begingroup % Read toc silently, to get counts of subentries for \pdfoutline. \def\partentry##1##2##3##4{}% ignore parts in the outlines \def\numchapentry##1##2##3##4{% \def\thischapnum{##2}% \def\thissecnum{0}% \def\thissubsecnum{0}% }% \def\numsecentry##1##2##3##4{% \advancenumber{chap\thischapnum}% \def\thissecnum{##2}% \def\thissubsecnum{0}% }% \def\numsubsecentry##1##2##3##4{% \advancenumber{sec\thissecnum}% \def\thissubsecnum{##2}% }% \def\numsubsubsecentry##1##2##3##4{% \advancenumber{subsec\thissubsecnum}% }% \def\thischapnum{0}% \def\thissecnum{0}% \def\thissubsecnum{0}% % % use \def rather than \let here because we redefine \chapentry et % al. a second time, below. \def\appentry{\numchapentry}% \def\appsecentry{\numsecentry}% \def\appsubsecentry{\numsubsecentry}% \def\appsubsubsecentry{\numsubsubsecentry}% \def\unnchapentry{\numchapentry}% \def\unnsecentry{\numsecentry}% \def\unnsubsecentry{\numsubsecentry}% \def\unnsubsubsecentry{\numsubsubsecentry}% \readdatafile{toc}% % % Read toc second time, this time actually producing the outlines. % The `-' means take the \expnumber as the absolute number of % subentries, which we calculated on our first read of the .toc above. % % We use the node names as the destinations. \def\numchapentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% \def\numsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% \def\numsubsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% \def\numsubsubsecentry##1##2##3##4{% count is always zero \dopdfoutline{##1}{}{##3}{##4}}% % % PDF outlines are displayed using system fonts, instead of % document fonts. Therefore we cannot use special characters, % since the encoding is unknown. For example, the eogonek from % Latin 2 (0xea) gets translated to a | character. Info from % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. % % TODO this right, we have to translate 8-bit characters to % their "best" equivalent, based on the @documentencoding. Too % much work for too little return. Just use the ASCII equivalents % we use for the index sort strings. % \indexnofonts \setupdatafile % We can have normal brace characters in the PDF outlines, unlike % Texinfo index files. So set that up. \def\{{\lbracecharliteral}% \def\}{\rbracecharliteral}% \catcode`\\=\active \otherbackslash \input \tocreadfilename \endgroup } {\catcode`[=1 \catcode`]=2 \catcode`{=\other \catcode`}=\other \gdef\lbracecharliteral[{]% \gdef\rbracecharliteral[}]% ] % \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces \addtokens{\filename}{\PP}% \advance\filenamelength by 1 \fi \nextsp} \def\getfilename#1{% \filenamelength=0 % If we don't expand the argument now, \skipspaces will get % snagged on things like "@value{foo}". \edef\temp{#1}% \expandafter\skipspaces\temp|\relax } \ifnum\pdftexversion < 14 \let \startlink \pdfannotlink \else \let \startlink \pdfstartlink \fi % make a live url in pdf output. \def\pdfurl#1{% \begingroup % it seems we really need yet another set of dummies; have not % tried to figure out what each command should do in the context % of @url. for now, just make @/ a no-op, that's the only one % people have actually reported a problem with. % \normalturnoffactive \def\@{@}% \let\/=\empty \makevalueexpandable % do we want to go so far as to use \indexnofonts instead of just % special-casing \var here? \def\var##1{##1}% % \leavevmode\setcolor{\urlcolor}% \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% \endgroup} \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} \def\maketoks{% \expandafter\poptoks\the\toksA|ENDTOKS|\relax \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 \else \ifnum0=\countA\else\makelink\fi \ifx\first.\let\next=\done\else \let\next=\maketoks \addtokens{\toksB}{\the\toksD} \ifx\first,\addtokens{\toksB}{\space}\fi \fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next} \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} \setcolor{\linkcolor}#1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \else % non-pdf mode \let\pdfmkdest = \gobble \let\pdfurl = \gobble \let\endlink = \relax \let\setcolor = \gobble \let\pdfsetcolor = \gobble \let\pdfmakeoutlines = \relax \fi % \ifx\pdfoutput \message{fonts,} % Change the current font style to #1, remembering it in \curfontstyle. % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in % italics, not bold italics. % \def\setfontstyle#1{% \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. \csname ten#1\endcsname % change the current font } % Select #1 fonts with the current style. % \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} \def\rm{\fam=0 \setfontstyle{rm}} \def\it{\fam=\itfam \setfontstyle{it}} \def\sl{\fam=\slfam \setfontstyle{sl}} \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} \def\tt{\fam=\ttfam \setfontstyle{tt}} % Unfortunately, we have to override this for titles and the like, since % in those cases "rm" is bold. Sigh. \def\rmisbold{\rm\def\curfontstyle{bf}} % Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf. \newfam\sffam \def\sf{\fam=\sffam \setfontstyle{sf}} \let\li = \sf % Sometimes we call it \li, not \sf. % We don't need math for this font style. \def\ttsl{\setfontstyle{ttsl}} % Set the baselineskip to #1, and the lineskip and strut size % correspondingly. There is no deep meaning behind these magic numbers % used as factors; they just match (closely enough) what Knuth defined. % \def\lineskipfactor{.08333} \def\strutheightpercent{.70833} \def\strutdepthpercent {.29167} % % can get a sort of poor man's double spacing by redefining this. \def\baselinefactor{1} % \newdimen\textleading \def\setleading#1{% \dimen0 = #1\relax \normalbaselineskip = \baselinefactor\dimen0 \normallineskip = \lineskipfactor\normalbaselineskip \normalbaselines \setbox\strutbox =\hbox{% \vrule width0pt height\strutheightpercent\baselineskip depth \strutdepthpercent \baselineskip }% } % PDF CMaps. See also LaTeX's t1.cmap. % % do nothing with this by default. \expandafter\let\csname cmapOT1\endcsname\gobble \expandafter\let\csname cmapOT1IT\endcsname\gobble \expandafter\let\csname cmapOT1TT\endcsname\gobble % if we are producing pdf, and we have \pdffontattr, then define cmaps. % (\pdffontattr was introduced many years ago, but people still run % older pdftex's; it's easy to conditionalize, so we do.) \ifpdf \ifx\pdffontattr\thisisundefined \else \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1-0) %%Title: (TeX-OT1-0 TeX OT1 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1) /Supplement 0 >> def /CMapName /TeX-OT1-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <23> <26> <0023> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 40 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1IT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1IT-0) %%Title: (TeX-OT1IT-0 TeX OT1IT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1IT) /Supplement 0 >> def /CMapName /TeX-OT1IT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <25> <26> <0025> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 42 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <23> <0023> <24> <00A3> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1IT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1TT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1TT-0) %%Title: (TeX-OT1TT-0 TeX OT1TT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1TT) /Supplement 0 >> def /CMapName /TeX-OT1TT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 5 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <21> <26> <0021> <28> <5F> <0028> <61> <7E> <0061> endbfrange 32 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <2191> <0C> <2193> <0D> <0027> <0E> <00A1> <0F> <00BF> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <20> <2423> <27> <2019> <60> <2018> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1TT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% \fi\fi % Set the font macro #1 to the font named \fontprefix#2. % #3 is the font's design size, #4 is a scale factor, #5 is the CMap % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit). % Example: % #1 = \textrm % #2 = \rmshape % #3 = 10 % #4 = \mainmagstep % #5 = OT1 % \def\setfont#1#2#3#4#5{% \font#1=\fontprefix#2#3 scaled #4 \csname cmap#5\endcsname#1% } % This is what gets called when #5 of \setfont is empty. \let\cmap\gobble % % (end of cmaps) % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix % before you read in texinfo.tex. \ifx\fontprefix\thisisundefined \def\fontprefix{cm} \fi % Support font families that don't use the same naming scheme as CM. \def\rmshape{r} \def\rmbshape{bx} % where the normal face is bold \def\bfshape{b} \def\bxshape{bx} \def\ttshape{tt} \def\ttbshape{tt} \def\ttslshape{sltt} \def\itshape{ti} \def\itbshape{bxti} \def\slshape{sl} \def\slbshape{bxsl} \def\sfshape{ss} \def\sfbshape{ss} \def\scshape{csc} \def\scbshape{csc} % Definitions for a main text size of 11pt. (The default in Texinfo.) % \def\definetextfontsizexi{% % Text fonts (11.2pt, magstep1). \def\textnominalsize{11pt} \edef\mainmagstep{\magstephalf} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1095} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstep1}{OT1} \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\titleecsize{2074} % Chapter (and unnumbered) fonts (17.28pt). \def\chapnominalsize{17pt} \setfont\chaprm\rmbshape{12}{\magstep2}{OT1} \setfont\chapit\itbshape{10}{\magstep3}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep3}{OT1} \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} \setfont\chapsf\sfbshape{17}{1000}{OT1} \let\chapbf=\chaprm \setfont\chapsc\scbshape{10}{\magstep3}{OT1} \font\chapi=cmmi12 scaled \magstep2 \font\chapsy=cmsy10 scaled \magstep3 \def\chapecsize{1728} % Section fonts (14.4pt). \def\secnominalsize{14pt} \setfont\secrm\rmbshape{12}{\magstep1}{OT1} \setfont\secit\itbshape{10}{\magstep2}{OT1IT} \setfont\secsl\slbshape{10}{\magstep2}{OT1} \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\secsf\sfbshape{12}{\magstep1}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep2}{OT1} \font\seci=cmmi12 scaled \magstep1 \font\secsy=cmsy10 scaled \magstep2 \def\sececsize{1440} % Subsection fonts (13.15pt). \def\ssecnominalsize{13pt} \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} \setfont\ssecit\itbshape{10}{1315}{OT1IT} \setfont\ssecsl\slbshape{10}{1315}{OT1} \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1315}{OT1} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 \def\ssececsize{1200} % Reduced fonts for @acro in text (10pt). \def\reducednominalsize{10pt} \setfont\reducedrm\rmshape{10}{1000}{OT1} \setfont\reducedtt\ttshape{10}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{1000}{OT1} \setfont\reducedit\itshape{10}{1000}{OT1IT} \setfont\reducedsl\slshape{10}{1000}{OT1} \setfont\reducedsf\sfshape{10}{1000}{OT1} \setfont\reducedsc\scshape{10}{1000}{OT1} \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} \font\reducedi=cmmi10 \font\reducedsy=cmsy10 \def\reducedecsize{1000} \textleading = 13.2pt % line spacing for 11pt CM \textfonts % reset the current fonts \rm } % end of 11pt text font size definitions, \definetextfontsizexi % Definitions to make the main text be 10pt Computer Modern, with % section, chapter, etc., sizes following suit. This is for the GNU % Press printing of the Emacs 22 manual. Maybe other manuals in the % future. Used with @smallbook, which sets the leading to 12pt. % \def\definetextfontsizex{% % Text fonts (10pt). \def\textnominalsize{10pt} \edef\mainmagstep{1000} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1000} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstephalf}{OT1} \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\titleecsize{2074} % Chapter fonts (14.4pt). \def\chapnominalsize{14pt} \setfont\chaprm\rmbshape{12}{\magstep1}{OT1} \setfont\chapit\itbshape{10}{\magstep2}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep2}{OT1} \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\chapsf\sfbshape{12}{\magstep1}{OT1} \let\chapbf\chaprm \setfont\chapsc\scbshape{10}{\magstep2}{OT1} \font\chapi=cmmi12 scaled \magstep1 \font\chapsy=cmsy10 scaled \magstep2 \def\chapecsize{1440} % Section fonts (12pt). \def\secnominalsize{12pt} \setfont\secrm\rmbshape{12}{1000}{OT1} \setfont\secit\itbshape{10}{\magstep1}{OT1IT} \setfont\secsl\slbshape{10}{\magstep1}{OT1} \setfont\sectt\ttbshape{12}{1000}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} \setfont\secsf\sfbshape{12}{1000}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep1}{OT1} \font\seci=cmmi12 \font\secsy=cmsy10 scaled \magstep1 \def\sececsize{1200} % Subsection fonts (10pt). \def\ssecnominalsize{10pt} \setfont\ssecrm\rmbshape{10}{1000}{OT1} \setfont\ssecit\itbshape{10}{1000}{OT1IT} \setfont\ssecsl\slbshape{10}{1000}{OT1} \setfont\ssectt\ttbshape{10}{1000}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} \setfont\ssecsf\sfbshape{10}{1000}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1000}{OT1} \font\sseci=cmmi10 \font\ssecsy=cmsy10 \def\ssececsize{1000} % Reduced fonts for @acro in text (9pt). \def\reducednominalsize{9pt} \setfont\reducedrm\rmshape{9}{1000}{OT1} \setfont\reducedtt\ttshape{9}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{900}{OT1} \setfont\reducedit\itshape{9}{1000}{OT1IT} \setfont\reducedsl\slshape{9}{1000}{OT1} \setfont\reducedsf\sfshape{9}{1000}{OT1} \setfont\reducedsc\scshape{10}{900}{OT1} \setfont\reducedttsl\ttslshape{10}{900}{OT1TT} \font\reducedi=cmmi9 \font\reducedsy=cmsy9 \def\reducedecsize{0900} \divide\parskip by 2 % reduce space between paragraphs \textleading = 12pt % line spacing for 10pt CM \textfonts % reset the current fonts \rm } % end of 10pt text font size definitions, \definetextfontsizex % We provide the user-level command % @fonttextsize 10 % (or 11) to redefine the text font size. pt is assumed. % \def\xiword{11} \def\xword{10} \def\xwordpt{10pt} % \parseargdef\fonttextsize{% \def\textsizearg{#1}% %\wlog{doing @fonttextsize \textsizearg}% % % Set \globaldefs so that documents can use this inside @tex, since % makeinfo 4.8 does not support it, but we need it nonetheless. % \begingroup \globaldefs=1 \ifx\textsizearg\xword \definetextfontsizex \else \ifx\textsizearg\xiword \definetextfontsizexi \else \errhelp=\EMsimple \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} \fi\fi \endgroup } % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since % texinfo doesn't allow for producing subscripts and superscripts except % in the main text, we don't bother to reset \scriptfont and % \scriptscriptfont (which would also require loading a lot more fonts). % \def\resetmathfonts{% \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf \textfont\ttfam=\tentt \textfont\sffam=\tensf } % The font-changing commands redefine the meanings of \tenSTYLE, instead % of just \STYLE. We do this because \STYLE needs to also set the % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire % \tenSTYLE to set the current font. % % Each font-changing command also sets the names \lsize (one size lower) % and \lllsize (three sizes lower). These relative commands are used in % the LaTeX logo and acronyms. % % This all needs generalizing, badly. % \def\textfonts{% \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl \def\curfontsize{text}% \def\lsize{reduced}\def\lllsize{smaller}% \resetmathfonts \setleading{\textleading}} \def\titlefonts{% \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tenttsl=\titlettsl \def\curfontsize{title}% \def\lsize{chap}\def\lllsize{subsec}% \resetmathfonts \setleading{27pt}} \def\titlefont#1{{\titlefonts\rmisbold #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl \def\curfontsize{chap}% \def\lsize{sec}\def\lllsize{text}% \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl \def\curfontsize{sec}% \def\lsize{subsec}\def\lllsize{reduced}% \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl \def\curfontsize{ssec}% \def\lsize{text}\def\lllsize{small}% \resetmathfonts \setleading{15pt}} \let\subsubsecfonts = \subsecfonts \def\reducedfonts{% \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy \let\tenttsl=\reducedttsl \def\curfontsize{reduced}% \def\lsize{small}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallfonts{% \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy \let\tenttsl=\smallttsl \def\curfontsize{small}% \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallerfonts{% \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy \let\tenttsl=\smallerttsl \def\curfontsize{smaller}% \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{9.5pt}} % Fonts for short table of contents. \setfont\shortcontrm\rmshape{12}{1000}{OT1} \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 \setfont\shortcontsl\slshape{12}{1000}{OT1} \setfont\shortconttt\ttshape{12}{1000}{OT1TT} % Define these just so they can be easily changed for other fonts. \def\angleleft{$\langle$} \def\angleright{$\rangle$} % Set the fonts to use with the @small... environments. \let\smallexamplefonts = \smallfonts % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample % can fit this many characters: % 8.5x11=86 smallbook=72 a4=90 a5=69 % If we use \scriptfonts (8pt), then we can fit this many characters: % 8.5x11=90+ smallbook=80 a4=90+ a5=77 % For me, subjectively, the few extra characters that fit aren't worth % the additional smallness of 8pt. So I'm making the default 9pt. % % By the way, for comparison, here's what fits with @example (10pt): % 8.5x11=71 smallbook=60 a4=75 a5=58 % --karl, 24jan03. % Set up the default fonts, so we can use them for creating boxes. % \definetextfontsizexi \message{markup,} % Check if we are currently using a typewriter font. Since all the % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have % this property, we can check that font parameter. % \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will % define and register \INITMACRO to be called on markup style changes. % \INITMACRO can check \currentmarkupstyle for the innermost % style and the set of \ifmarkupSTYLE switches for all styles % currently in effect. \newif\ifmarkupvar \newif\ifmarkupsamp \newif\ifmarkupkey %\newif\ifmarkupfile % @file == @samp. %\newif\ifmarkupoption % @option == @samp. \newif\ifmarkupcode \newif\ifmarkupkbd %\newif\ifmarkupenv % @env == @code. %\newif\ifmarkupcommand % @command == @code. \newif\ifmarkuptex % @tex (and part of @math, for now). \newif\ifmarkupexample \newif\ifmarkupverb \newif\ifmarkupverbatim \let\currentmarkupstyle\empty \def\setupmarkupstyle#1{% \csname markup#1true\endcsname \def\currentmarkupstyle{#1}% \markupstylesetup } \let\markupstylesetup\empty \def\defmarkupstylesetup#1{% \expandafter\def\expandafter\markupstylesetup \expandafter{\markupstylesetup #1}% \def#1% } % Markup style setup for left and right quotes. \defmarkupstylesetup\markupsetuplq{% \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname \ifx\temp\relax \markupsetuplqdefault \else \temp \fi } \defmarkupstylesetup\markupsetuprq{% \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname \ifx\temp\relax \markupsetuprqdefault \else \temp \fi } { \catcode`\'=\active \catcode`\`=\active \gdef\markupsetuplqdefault{\let`\lq} \gdef\markupsetuprqdefault{\let'\rq} \gdef\markupsetcodequoteleft{\let`\codequoteleft} \gdef\markupsetcodequoteright{\let'\codequoteright} } \let\markupsetuplqcode \markupsetcodequoteleft \let\markupsetuprqcode \markupsetcodequoteright % \let\markupsetuplqexample \markupsetcodequoteleft \let\markupsetuprqexample \markupsetcodequoteright % \let\markupsetuplqkbd \markupsetcodequoteleft \let\markupsetuprqkbd \markupsetcodequoteright % \let\markupsetuplqsamp \markupsetcodequoteleft \let\markupsetuprqsamp \markupsetcodequoteright % \let\markupsetuplqverb \markupsetcodequoteleft \let\markupsetuprqverb \markupsetcodequoteright % \let\markupsetuplqverbatim \markupsetcodequoteleft \let\markupsetuprqverbatim \markupsetcodequoteright % Allow an option to not use regular directed right quote/apostrophe % (char 0x27), but instead the undirected quote from cmtt (char 0x0d). % The undirected quote is ugly, so don't make it the default, but it % works for pasting with more pdf viewers (at least evince), the % lilypond developers report. xpdf does work with the regular 0x27. % \def\codequoteright{% \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax '% \else \char'15 \fi \else \char'15 \fi } % % and a similar option for the left quote char vs. a grave accent. % Modern fonts display ASCII 0x60 as a grave accent, so some people like % the code environments to do likewise. % \def\codequoteleft{% \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax % [Knuth] pp. 380,381,391 % \relax disables Spanish ligatures ?` and !` of \tt font. \relax`% \else \char'22 \fi \else \char'22 \fi } % Commands to set the quote options. % \parseargdef\codequoteundirected{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxicodequoteundirected\endcsname = t% \else\ifx\temp\offword \expandafter\let\csname SETtxicodequoteundirected\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}% \fi\fi } % \parseargdef\codequotebacktick{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxicodequotebacktick\endcsname = t% \else\ifx\temp\offword \expandafter\let\csname SETtxicodequotebacktick\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}% \fi\fi } % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. \def\noligaturesquoteleft{\relax\lq} % Count depth in font-changes, for error checks \newcount\fontdepth \fontdepth=0 % Font commands. % #1 is the font command (\sl or \it), #2 is the text to slant. % If we are in a monospaced environment, however, 1) always use \ttsl, % and 2) do not add an italic correction. \def\dosmartslant#1#2{% \ifusingtt {{\ttsl #2}\let\next=\relax}% {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% \next } \def\smartslanted{\dosmartslant\sl} \def\smartitalic{\dosmartslant\it} % Output an italic correction unless \next (presumed to be the following % character) is such as not to need one. \def\smartitaliccorrection{% \ifx\next,% \else\ifx\next-% \else\ifx\next.% \else\ptexslash \fi\fi\fi \aftersmartic } % Unconditional use \ttsl, and no ic. @var is set to this for defuns. \def\ttslanted#1{{\ttsl #1}} % @cite is like \smartslanted except unconditionally use \sl. We never want % ttsl for book titles, do we? \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection} \def\aftersmartic{} \def\var#1{% \let\saveaftersmartic = \aftersmartic \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% \smartslanted{#1}% } \let\i=\smartitalic \let\slanted=\smartslanted \let\dfn=\smartslanted \let\emph=\smartitalic % Explicit font changes: @r, @sc, undocumented @ii. \def\r#1{{\rm #1}} % roman font \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font % @b, explicit bold. Also @strong. \def\b#1{{\bf #1}} \let\strong=\b % @sansserif, explicit sans. \def\sansserif#1{{\sf #1}} % We can't just use \exhyphenpenalty, because that only has effect at % the end of a paragraph. Restore normal hyphenation at the end of the % group within which \nohyphenation is presumably called. % \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} \def\restorehyphenation{\hyphenchar\font = `- } % Set sfcode to normal for the chars that usually have another value. % Can't use plain's \frenchspacing because it uses the `\x notation, and % sometimes \x has an active definition that messes things up. % \catcode`@=11 \def\plainfrenchspacing{% \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m \def\endofsentencespacefactor{1000}% for @. and friends } \def\plainnonfrenchspacing{% \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 \def\endofsentencespacefactor{3000}% for @. and friends } \catcode`@=\other \def\endofsentencespacefactor{3000}% default % @t, explicit typewriter. \def\t#1{% {\tt \rawbackslash \plainfrenchspacing #1}% \null } % @samp. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} % @indicateurl is \samp, that is, with quotes. \let\indicateurl=\samp % @code (and similar) prints in typewriter, but with spaces the same % size as normal in the surrounding text, without hyphenation, etc. % This is a subroutine for that. \def\tclose#1{% {% % Change normal interword space to be same as for the current font. \spaceskip = \fontdimen2\font % % Switch to typewriter. \tt % % But `\ ' produces the large typewriter interword space. \def\ {{\spaceskip = 0pt{} }}% % % Turn off hyphenation. \nohyphenation % \rawbackslash \plainfrenchspacing #1% }% \null % reset spacefactor to 1000 } % We *must* turn on hyphenation at `-' and `_' in @code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. % % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) % and arrange explicitly to hyphenate at a dash. % -- rms. { \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active \catcode`\`=\active \global\let'=\rq \global\let`=\lq % default definitions % \global\def\code{\begingroup \setupmarkupstyle{code}% % The following should really be moved into \setupmarkupstyle handlers. \catcode\dashChar=\active \catcode\underChar=\active \ifallowcodebreaks \let-\codedash \let_\codeunder \else \let-\normaldash \let_\realunder \fi \codex } } \def\codex #1{\tclose{#1}\endgroup} \def\normaldash{-} \def\codedash{-\discretionary{}{}{}} \def\codeunder{% % this is all so @math{@code{var_name}+1} can work. In math mode, _ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) % will therefore expand the active definition of _, which is us % (inside @code that is), therefore an endless loop. \ifusingtt{\ifmmode \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. \else\normalunderscore \fi \discretionary{}{}{}}% {\_}% } % An additional complication: the above will allow breaks after, e.g., % each of the four underscores in __typeof__. This is bad. % @allowcodebreaks provides a document-level way to turn breaking at - % and _ on and off. % \newif\ifallowcodebreaks \allowcodebreakstrue \def\keywordtrue{true} \def\keywordfalse{false} \parseargdef\allowcodebreaks{% \def\txiarg{#1}% \ifx\txiarg\keywordtrue \allowcodebreakstrue \else\ifx\txiarg\keywordfalse \allowcodebreaksfalse \else \errhelp = \EMsimple \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% \fi\fi } % For @command, @env, @file, @option quotes seem unnecessary, % so use \code rather than \samp. \let\command=\code \let\env=\code \let\file=\code \let\option=\code % @uref (abbreviation for `urlref') takes an optional (comma-separated) % second argument specifying the text to display and an optional third % arg as text to display instead of (rather than in addition to) the url % itself. First (mandatory) arg is the url. % (This \urefnobreak definition isn't used now, leaving it for a while % for comparison.) \def\urefnobreak#1{\dourefnobreak #1,,,\finish} \def\dourefnobreak#1,#2,#3,#4\finish{\begingroup \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \ifpdf \unhbox0 % PDF: 2nd arg given, show only it \else \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url \fi \else \code{#1}% only url given, so show it \fi \fi \endlink \endgroup} % This \urefbreak definition is the active one. \def\urefbreak{\begingroup \urefcatcodes \dourefbreak} \let\uref=\urefbreak \def\dourefbreak#1{\urefbreakfinish #1,,,\finish} \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \ifpdf \unhbox0 % PDF: 2nd arg given, show only it \else \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url \fi \else \urefcode{#1}% only url given, so show it \fi \fi \endlink \endgroup} % Allow line breaks around only a few characters (only). \def\urefcatcodes{% \catcode\ampChar=\active \catcode\dotChar=\active \catcode\hashChar=\active \catcode\questChar=\active \catcode\slashChar=\active } { \urefcatcodes % \global\def\urefcode{\begingroup \setupmarkupstyle{code}% \urefcatcodes \let&\urefcodeamp \let.\urefcodedot \let#\urefcodehash \let?\urefcodequest \let/\urefcodeslash \codex } % % By default, they are just regular characters. \global\def&{\normalamp} \global\def.{\normaldot} \global\def#{\normalhash} \global\def?{\normalquest} \global\def/{\normalslash} } % we put a little stretch before and after the breakable chars, to help % line breaking of long url's. The unequal skips make look better in % cmtt at least, especially for dots. \def\urefprestretch{\urefprebreak \hskip0pt plus.13em } \def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em } % \def\urefcodeamp{\urefprestretch \&\urefpoststretch} \def\urefcodedot{\urefprestretch .\urefpoststretch} \def\urefcodehash{\urefprestretch \#\urefpoststretch} \def\urefcodequest{\urefprestretch ?\urefpoststretch} \def\urefcodeslash{\futurelet\next\urefcodeslashfinish} { \catcode`\/=\active \global\def\urefcodeslashfinish{% \urefprestretch \slashChar % Allow line break only after the final / in a sequence of % slashes, to avoid line break between the slashes in http://. \ifx\next/\else \urefpoststretch \fi } } % One more complication: by default we'll break after the special % characters, but some people like to break before the special chars, so % allow that. Also allow no breaking at all, for manual control. % \parseargdef\urefbreakstyle{% \def\txiarg{#1}% \ifx\txiarg\wordnone \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordbefore \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordafter \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} \else \errhelp = \EMsimple \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% \fi\fi\fi } \def\wordafter{after} \def\wordbefore{before} \def\wordnone{none} \urefbreakstyle after % @url synonym for @uref, since that's how everyone uses it. % \let\url=\uref % rms does not like angle brackets --karl, 17may97. % So now @email is just like @uref, unless we are pdf. % %\def\email#1{\angleleft{\tt #1}\angleright} \ifpdf \def\email#1{\doemail#1,,\finish} \def\doemail#1,#2,#3\finish{\begingroup \unsepspaces \pdfurl{mailto:#1}% \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi \endlink \endgroup} \else \let\email=\uref \fi % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). \parseargdef\kbdinputstyle{% \def\txiarg{#1}% \ifx\txiarg\worddistinct \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% \else\ifx\txiarg\wordexample \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% \else\ifx\txiarg\wordcode \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% \else \errhelp = \EMsimple \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% \fi\fi\fi } \def\worddistinct{distinct} \def\wordexample{example} \def\wordcode{code} % Default is `distinct'. \kbdinputstyle distinct % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. \def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}} \def\xkey{\key} \def\kbdsub#1#2#3\par{% \def\one{#1}\def\three{#3}\def\threex{??}% \ifx\one\xkey\ifx\threex\three \key{#2}% \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi } % definition of @key that produces a lozenge. Doesn't adjust to text size. %\setfont\keyrm\rmshape{8}{1000}{OT1} %\font\keysy=cmsy9 %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% % \vbox{\hrule\kern-0.4pt % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% % \kern-0.4pt\hrule}% % \kern-.06em\raise0.4pt\hbox{\angleright}}}} % definition of @key with no lozenge. If the current font is already % monospace, don't change it; that way, we respect @kbdinputstyle. But % if it isn't monospace, then use \tt. % \def\key#1{{\setupmarkupstyle{key}% \nohyphenation \ifmonospace\else\tt\fi #1}\null} % @clicksequence{File @click{} Open ...} \def\clicksequence#1{\begingroup #1\endgroup} % @clickstyle @arrow (by default) \parseargdef\clickstyle{\def\click{#1}} \def\click{\arrow} % Typeset a dimension, e.g., `in' or `pt'. The only reason for the % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. % \def\dmn#1{\thinspace #1} % @l was never documented to mean ``switch to the Lisp font'', % and it is not used as such in any manual I can find. We need it for % Polish suppressed-l. --karl, 22sep96. %\def\l#1{{\li #1}\null} % @acronym for "FBI", "NATO", and the like. % We print this one point size smaller, since it's intended for % all-uppercase. % \def\acronym#1{\doacronym #1,,\finish} \def\doacronym#1,#2,#3\finish{% {\selectfonts\lsize #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi \null % reset \spacefactor=1000 } % @abbr for "Comput. J." and the like. % No font change, but don't do end-of-sentence spacing. % \def\abbr#1{\doabbr #1,,\finish} \def\doabbr#1,#2,#3\finish{% {\plainfrenchspacing #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi \null % reset \spacefactor=1000 } % @asis just yields its argument. Used with @table, for example. % \def\asis#1{#1} % @math outputs its argument in math mode. % % One complication: _ usually means subscripts, but it could also mean % an actual _ character, as in @math{@var{some_variable} + 1}. So make % _ active, and distinguish by seeing if the current family is \slfam, % which is what @var uses. { \catcode`\_ = \active \gdef\mathunderscore{% \catcode`\_=\active \def_{\ifnum\fam=\slfam \_\else\sb\fi}% } } % Another complication: we want \\ (and @\) to output a math (or tt) \. % FYI, plain.tex uses \\ as a temporary control sequence (for no % particular reason), but this is not advertised and we don't care. % % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % \def\math{% \tex \mathunderscore \let\\ = \mathbackslash \mathactive % make the texinfo accent commands work in math mode \let\"=\ddot \let\'=\acute \let\==\bar \let\^=\hat \let\`=\grave \let\u=\breve \let\v=\check \let\~=\tilde \let\dotaccent=\dot $\finishmath } \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. % Some active characters (such as <) are spaced differently in math. % We have to reset their definitions in case the @math was an argument % to a command which sets the catcodes (such as @item or @section). % { \catcode`^ = \active \catcode`< = \active \catcode`> = \active \catcode`+ = \active \catcode`' = \active \gdef\mathactive{% \let^ = \ptexhat \let< = \ptexless \let> = \ptexgtr \let+ = \ptexplus \let' = \ptexquoteright } } % ctrl is no longer a Texinfo command, but leave this definition for fun. \def\ctrl #1{{\tt \rawbackslash \hat}#1} % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, % except specified as a normal braced arg, so no newlines to worry about. % \def\outfmtnametex{tex} % \long\def\inlinefmt#1{\doinlinefmt #1,\finish} \long\def\doinlinefmt#1,#2,\finish{% \def\inlinefmtname{#1}% \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi } % For raw, must switch into @tex before parsing the argument, to avoid % setting catcodes prematurely. Doing it this way means that, for % example, @inlineraw{html, foo{bar} gets a parse error instead of being % ignored. But this isn't important because if people want a literal % *right* brace they would have to use a command anyway, so they may as % well use a command to get a left brace too. We could re-use the % delimiter character idea from \verb, but it seems like overkill. % \long\def\inlineraw{\tex \doinlineraw} \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish} \def\doinlinerawtwo#1,#2,\finish{% \def\inlinerawname{#1}% \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi \endgroup % close group opened by \tex. } \message{glyphs,} % and logos. % @@ prints an @, as does @atchar{}. \def\@{\char64 } \let\atchar=\@ % @{ @} @lbracechar{} @rbracechar{} all generate brace characters. % Unless we're in typewriter, use \ecfont because the CM text fonts do % not have braces, and we don't want to switch into math. \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}} \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}} \let\{=\mylbrace \let\lbracechar=\{ \let\}=\myrbrace \let\rbracechar=\} \begingroup % Definitions to produce \{ and \} commands for indices, % and @{ and @} for the aux/toc files. \catcode`\{ = \other \catcode`\} = \other \catcode`\[ = 1 \catcode`\] = 2 \catcode`\! = 0 \catcode`\\ = \other !gdef!lbracecmd[\{]% !gdef!rbracecmd[\}]% !gdef!lbraceatcmd[@{]% !gdef!rbraceatcmd[@}]% !endgroup % @comma{} to avoid , parsing problems. \let\comma = , % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. \let\, = \ptexc \let\dotaccent = \ptexdot \def\ringaccent#1{{\accent23 #1}} \let\tieaccent = \ptext \let\ubaraccent = \ptexb \let\udotaccent = \d % Other special characters: @questiondown @exclamdown @ordf @ordm % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} % Dotless i and dotless j, used for accents. \def\imacro{i} \def\jmacro{j} \def\dotless#1{% \def\temp{#1}% \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi \else \errmessage{@dotless can be used only with i or j}% \fi\fi } % The \TeX{} logo, as in plain, but resetting the spacing so that a % period following counts as ending a sentence. (Idea found in latex.) % \edef\TeX{\TeX \spacefactor=1000 } % @LaTeX{} logo. Not quite the same results as the definition in % latex.ltx, since we use a different font for the raised A; it's most % convenient for us to use an explicitly smaller font, rather than using % the \scriptstyle font (since we don't reset \scriptstyle and % \scriptscriptstyle). % \def\LaTeX{% L\kern-.36em {\setbox0=\hbox{T}% \vbox to \ht0{\hbox{% \ifx\textnominalsize\xwordpt % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX. % Revert to plain's \scriptsize, which is 7pt. \count255=\the\fam $\fam\count255 \scriptstyle A$% \else % For 11pt, we can use our lllsize. \selectfonts\lllsize A% \fi }% \vss }}% \kern-.15em \TeX } % Some math mode symbols. \def\bullet{$\ptexbullet$} \def\geq{\ifmmode \ge\else $\ge$\fi} \def\leq{\ifmmode \le\else $\le$\fi} \def\minus{\ifmmode -\else $-$\fi} % @dots{} outputs an ellipsis using the current font. % We do .5em per period so that it has the same spacing in the cm % typewriter fonts as three actual period characters; on the other hand, % in other typewriter fonts three periods are wider than 1.5em. So do % whichever is larger. % \def\dots{% \leavevmode \setbox0=\hbox{...}% get width of three periods \ifdim\wd0 > 1.5em \dimen0 = \wd0 \else \dimen0 = 1.5em \fi \hbox to \dimen0{% \hskip 0pt plus.25fil .\hskip 0pt plus1fil .\hskip 0pt plus1fil .\hskip 0pt plus.5fil }% } % @enddots{} is an end-of-sentence ellipsis. % \def\enddots{% \dots \spacefactor=\endofsentencespacefactor } % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. % % Since these characters are used in examples, they should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. % \def\point{$\star$} \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} % The @error{} command. % Adapted from the TeXbook's \boxit. % \newbox\errorbox % {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} % \setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. \advance\hsize by -2\dimen2 % Rules. \vbox{% \hrule height\dimen2 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. \kern3pt\vrule width\dimen2}% Space to right. \hrule height\dimen2} \hfil} % \def\error{\leavevmode\lower.7ex\copy\errorbox} % @pounds{} is a sterling sign, which Knuth put in the CM italic font. % \def\pounds{{\it\$}} % @euro{} comes from a separate font, depending on the current style. % We use the free feym* fonts from the eurosym package by Henrik % Theiling, which support regular, slanted, bold and bold slanted (and % "outlined" (blackboard board, sort of) versions, which we don't need). % It is available from http://www.ctan.org/tex-archive/fonts/eurosym. % % Although only regular is the truly official Euro symbol, we ignore % that. The Euro is designed to be slightly taller than the regular % font height. % % feymr - regular % feymo - slanted % feybr - bold % feybo - bold slanted % % There is no good (free) typewriter version, to my knowledge. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. % Hmm. % % Also doesn't work in math. Do we need to do math with euro symbols? % Hope not. % % \def\euro{{\eurofont e}} \def\eurofont{% % We set the font at each command, rather than predefining it in % \textfonts and the other font-switching commands, so that % installations which never need the symbol don't have to have the % font installed. % % There is only one designed size (nominal 10pt), so we always scale % that to the current nominal size. % % By the way, simply using "at 1em" works for cmr10 and the like, but % does not work for cmbx10 and other extended/shrunken fonts. % \def\eurosize{\csname\curfontsize nominalsize\endcsname}% % \ifx\curfontstyle\bfstylename % bold: \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize \else % regular: \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize \fi \thiseurofont } % Glyphs from the EC fonts. We don't use \let for the aliases, because % sometimes we redefine the original macro, and the alias should reflect % the redefinition. % % Use LaTeX names for the Icelandic letters. \def\DH{{\ecfont \char"D0}} % Eth \def\dh{{\ecfont \char"F0}} % eth \def\TH{{\ecfont \char"DE}} % Thorn \def\th{{\ecfont \char"FE}} % thorn % \def\guillemetleft{{\ecfont \char"13}} \def\guillemotleft{\guillemetleft} \def\guillemetright{{\ecfont \char"14}} \def\guillemotright{\guillemetright} \def\guilsinglleft{{\ecfont \char"0E}} \def\guilsinglright{{\ecfont \char"0F}} \def\quotedblbase{{\ecfont \char"12}} \def\quotesinglbase{{\ecfont \char"0D}} % % This positioning is not perfect (see the ogonek LaTeX package), but % we have the precomposed glyphs for the most common cases. We put the % tests to use those glyphs in the single \ogonek macro so we have fewer % dummy definitions to worry about for index entries, etc. % % ogonek is also used with other letters in Lithuanian (IOU), but using % the precomposed glyphs for those is not so easy since they aren't in % the same EC font. \def\ogonek#1{{% \def\temp{#1}% \ifx\temp\macrocharA\Aogonek \else\ifx\temp\macrochara\aogonek \else\ifx\temp\macrocharE\Eogonek \else\ifx\temp\macrochare\eogonek \else \ecfont \setbox0=\hbox{#1}% \ifdim\ht0=1ex\accent"0C #1% \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% \fi \fi\fi\fi\fi }% } \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} % % Use the ec* fonts (cm-super in outline format) for non-CM glyphs. \def\ecfont{% % We can't distinguish serif/sans and italic/slanted, but this % is used for crude hacks anyway (like adding French and German % quotes to documents typeset with CM, where we lose kerning), so % hopefully nobody will notice/care. \edef\ecsize{\csname\curfontsize ecsize\endcsname}% \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% \ifmonospace % typewriter: \font\thisecfont = ectt\ecsize \space at \nominalsize \else \ifx\curfontstyle\bfstylename % bold: \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize \else % regular: \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize \fi \fi \thisecfont } % @registeredsymbol - R in a circle. The font for the R should really % be smaller yet, but lllsize is the best we can do for now. % Adapted from the plain.tex definition of \copyright. % \def\registeredsymbol{% $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% \hfil\crcr\Orb}}% }$% } % @textdegree - the normal degrees sign. % \def\textdegree{$^\circ$} % Laurent Siebenmann reports \Orb undefined with: % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 % so we'll define it if necessary. % \ifx\Orb\thisisundefined \def\Orb{\mathhexbox20D} \fi % Quotes. \chardef\quotedblleft="5C \chardef\quotedblright=`\" \chardef\quoteleft=`\` \chardef\quoteright=`\' \message{page headings,} \newskip\titlepagetopglue \titlepagetopglue = 1.5in \newskip\titlepagebottomglue \titlepagebottomglue = 2pc % First the title page. Must do @settitle before @titlepage. \newif\ifseenauthor \newif\iffinishedtitlepage % Do an implicit @contents or @shortcontents after @end titlepage if the % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. % \newif\ifsetcontentsaftertitlepage \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue \newif\ifsetshortcontentsaftertitlepage \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue \parseargdef\shorttitlepage{% \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} \envdef\titlepage{% % Open one extra group, as we want to close it in the middle of \Etitlepage. \begingroup \parindent=0pt \textfonts % Leave some space at the very top of the page. \vglue\titlepagetopglue % No rule at page bottom unless we print one at the top with @title. \finishedtitlepagetrue % % Most title ``pages'' are actually two pages long, with space % at the top of the second. We don't want the ragged left on the second. \let\oldpage = \page \def\page{% \iffinishedtitlepage\else \finishtitlepage \fi \let\page = \oldpage \page \null }% } \def\Etitlepage{% \iffinishedtitlepage\else \finishtitlepage \fi % It is important to do the page break before ending the group, % because the headline and footline are only empty inside the group. % If we use the new definition of \page, we always get a blank page % after the title page, which we certainly don't want. \oldpage \endgroup % % Need this before the \...aftertitlepage checks so that if they are % in effect the toc pages will come out with page numbers. \HEADINGSon % % If they want short, they certainly want long too. \ifsetshortcontentsaftertitlepage \shortcontents \contents \global\let\shortcontents = \relax \global\let\contents = \relax \fi % \ifsetcontentsaftertitlepage \contents \global\let\contents = \relax \global\let\shortcontents = \relax \fi } \def\finishtitlepage{% \vskip4pt \hrule height 2pt width \hsize \vskip\titlepagebottomglue \finishedtitlepagetrue } % Settings used for typesetting titles: no hyphenation, no indentation, % don't worry much about spacing, ragged right. This should be used % inside a \vbox, and fonts need to be set appropriately first. Because % it is always used for titles, nothing else, we call \rmisbold. \par % should be specified before the end of the \vbox, since a vbox is a group. % \def\raggedtitlesettings{% \rmisbold \hyphenpenalty=10000 \parindent=0pt \tolerance=5000 \ptexraggedright } % Macros to be used within @titlepage: \let\subtitlerm=\tenrm \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} \parseargdef\title{% \checkenv\titlepage \vbox{\titlefonts \raggedtitlesettings #1\par}% % print a rule at the page bottom also. \finishedtitlepagefalse \vskip4pt \hrule height 4pt width \hsize \vskip4pt } \parseargdef\subtitle{% \checkenv\titlepage {\subtitlefont \rightline{#1}}% } % @author should come last, but may come many times. % It can also be used inside @quotation. % \parseargdef\author{% \def\temp{\quotation}% \ifx\thisenv\temp \def\quotationauthor{#1}% printed in \Equotation. \else \checkenv\titlepage \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi {\secfonts\rmisbold \leftline{#1}}% \fi } % Set up page headings and footings. \let\thispage=\folio \newtoks\evenheadline % headline on even pages \newtoks\oddheadline % headline on odd pages \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages % Now make TeX use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}\HEADINGShook} \let\HEADINGShook=\relax % Commands to set those variables. % For example, this is what @headings on does % @evenheading @thistitle|@thispage|@thischapter % @oddheading @thischapter|@thispage|@thistitle % @evenfooting @thisfile|| % @oddfooting ||@thisfile \def\evenheading{\parsearg\evenheadingxxx} \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} \def\evenheadingyyy #1\|#2\|#3\|#4\finish{% \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddheading{\parsearg\oddheadingxxx} \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} \def\oddheadingyyy #1\|#2\|#3\|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% \def\evenfooting{\parsearg\evenfootingxxx} \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} \def\evenfootingyyy #1\|#2\|#3\|#4\finish{% \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddfooting{\parsearg\oddfootingxxx} \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} \def\oddfootingyyy #1\|#2\|#3\|#4\finish{% \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. \global\advance\pageheight by -12pt \global\advance\vsize by -12pt } \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} % @evenheadingmarks top \thischapter <- chapter at the top of a page % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page % % The same set of arguments for: % % @oddheadingmarks % @evenfootingmarks % @oddfootingmarks % @everyheadingmarks % @everyfootingmarks \def\evenheadingmarks{\headingmarks{even}{heading}} \def\oddheadingmarks{\headingmarks{odd}{heading}} \def\evenfootingmarks{\headingmarks{even}{footing}} \def\oddfootingmarks{\headingmarks{odd}{footing}} \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} \headingmarks{odd}{heading}{#1} } \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} \headingmarks{odd}{footing}{#1} } % #1 = even/odd, #2 = heading/footing, #3 = top/bottom. \def\headingmarks#1#2#3 {% \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname \global\expandafter\let\csname get#1#2marks\endcsname \temp } \everyheadingmarks bottom \everyfootingmarks bottom % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. % @headings off turns them off. % @headings on same as @headings double, retained for compatibility. % @headings after turns on double-sided headings after this page. % @headings doubleafter turns on double-sided headings after this page. % @headings singleafter turns on single-sided headings after this page. % By default, they are off at the start of a document, % and turned `on' after @end titlepage. \def\headings #1 {\csname HEADINGS#1\endcsname} \def\headingsoff{% non-global headings elimination \evenheadline={\hfil}\evenfootline={\hfil}% \oddheadline={\hfil}\oddfootline={\hfil}% } \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting \HEADINGSoff % it's the default % When we turn headings on, set the page number to 1. % For double-sided printing, put current file name in lower left corner, % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. \def\HEADINGSdouble{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \let\contentsalignmacro = \chappager % For single-sided printing, chapter title goes across top left of page, % page number on top right. \def\HEADINGSsingle{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} \let\HEADINGSdoubleafter=\HEADINGSafter \def\HEADINGSdoublex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } % Subroutines used in generating headings % This produces Day Month Year style of output. % Only define if not already defined, in case a txi-??.tex file has set % up a different format (e.g., txi-cs.tex does this). \ifx\today\thisisundefined \def\today{% \number\day\space \ifcase\month \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec \fi \space\number\year} \fi % @settitle line... specifies the title of the document, for headings. % It generates no output of its own. \def\thistitle{\putwordNoTitle} \def\settitle{\parsearg{\gdef\thistitle}} \message{tables,} % Tables -- @table, @ftable, @vtable, @item(x). % default indentation of table text \newdimen\tableindent \tableindent=.8in % default indentation of @itemize and @enumerate text \newdimen\itemindent \itemindent=.3in % margin between end of table item and start of table text. \newdimen\itemmargin \itemmargin=.1in % used internally for \itemindent minus \itemmargin \newdimen\itemmax % Note @table, @ftable, and @vtable define @item, @itemx, etc., with % these defs. % They also define \itemindex % to index the item name in whatever manner is desired (perhaps none). \newif\ifitemxneedsnegativevskip \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} \def\itemzzz #1{\begingroup % \advance\hsize by -\rightskip \advance\hsize by -\tableindent \setbox0=\hbox{\itemindicate{#1}}% \itemindex{#1}% \nobreak % This prevents a break before @itemx. % % If the item text does not fit in the space we have, put it on a line % by itself, and do not allow a page break either before or after that % line. We do not start a paragraph here because then if the next % command is, e.g., @kindex, the whatsit would get put into the % horizontal list on a line by itself, resulting in extra blank space. \ifdim \wd0>\itemmax % % Make this a paragraph so we get the \parskip glue and wrapping, % but leave it ragged-right. \begingroup \advance\leftskip by-\tableindent \advance\hsize by\tableindent \advance\rightskip by0pt plus1fil\relax \leavevmode\unhbox0\par \endgroup % % We're going to be starting a paragraph, but we don't want the % \parskip glue -- logically it's part of the @item we just started. \nobreak \vskip-\parskip % % Stop a page break at the \parskip glue coming up. However, if % what follows is an environment such as @example, there will be no % \parskip glue; then the negative vskip we just inserted would % cause the example and the item to crash together. So we use this % bizarre value of 10001 as a signal to \aboveenvbreak to insert % \parskip glue after all. Section titles are handled this way also. % \penalty 10001 \endgroup \itemxneedsnegativevskipfalse \else % The item text fits into the space. Start a paragraph, so that the % following text (if any) will end up on the same line. \noindent % Do this with kerns and \unhbox so that if there is a footnote in % the item text, it can migrate to the main vertical list and % eventually be printed. \nobreak\kern-\tableindent \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 \unhbox0 \nobreak\kern\dimen0 \endgroup \itemxneedsnegativevskiptrue \fi } \def\item{\errmessage{@item while not in a list environment}} \def\itemx{\errmessage{@itemx while not in a list environment}} % @table, @ftable, @vtable. \envdef\table{% \let\itemindex\gobble \tablecheck{table}% } \envdef\ftable{% \def\itemindex ##1{\doind {fn}{\code{##1}}}% \tablecheck{ftable}% } \envdef\vtable{% \def\itemindex ##1{\doind {vr}{\code{##1}}}% \tablecheck{vtable}% } \def\tablecheck#1{% \ifnum \the\catcode`\^^M=\active \endgroup \errmessage{This command won't work in this context; perhaps the problem is that we are \inenvironment\thisenv}% \def\next{\doignore{#1}}% \else \let\next\tablex \fi \next } \def\tablex#1{% \def\itemindicate{#1}% \parsearg\tabley } \def\tabley#1{% {% \makevalueexpandable \edef\temp{\noexpand\tablez #1\space\space\space}% \expandafter }\temp \endtablez } \def\tablez #1 #2 #3 #4\endtablez{% \aboveenvbreak \ifnum 0#1>0 \advance \leftskip by #1\mil \fi \ifnum 0#2>0 \tableindent=#2\mil \fi \ifnum 0#3>0 \advance \rightskip by #3\mil \fi \itemmax=\tableindent \advance \itemmax by -\itemmargin \advance \leftskip by \tableindent \exdentamount=\tableindent \parindent = 0pt \parskip = \smallskipamount \ifdim \parskip=0pt \parskip=2pt \fi \let\item = \internalBitem \let\itemx = \internalBitemx } \def\Etable{\endgraf\afterenvbreak} \let\Eftable\Etable \let\Evtable\Etable \let\Eitemize\Etable \let\Eenumerate\Etable % This is the counter used by @enumerate, which is really @itemize \newcount \itemno \envdef\itemize{\parsearg\doitemize} \def\doitemize#1{% \aboveenvbreak \itemmax=\itemindent \advance\itemmax by -\itemmargin \advance\leftskip by \itemindent \exdentamount=\itemindent \parindent=0pt \parskip=\smallskipamount \ifdim\parskip=0pt \parskip=2pt \fi % % Try typesetting the item mark that if the document erroneously says % something like @itemize @samp (intending @table), there's an error % right away at the @itemize. It's not the best error message in the % world, but it's better than leaving it to the @item. This means if % the user wants an empty mark, they have to say @w{} not just @w. \def\itemcontents{#1}% \setbox0 = \hbox{\itemcontents}% % % @itemize with no arg is equivalent to @itemize @bullet. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi % \let\item=\itemizeitem } % Definition of @item while inside @itemize and @enumerate. % \def\itemizeitem{% \advance\itemno by 1 % for enumerations {\let\par=\endgraf \smallbreak}% reasonable place to break {% % If the document has an @itemize directly after a section title, a % \nobreak will be last on the list, and \sectionheading will have % done a \vskip-\parskip. In that case, we don't want to zero % parskip, or the item text will crash with the heading. On the % other hand, when there is normal text preceding the item (as there % usually is), we do want to zero parskip, or there would be too much % space. In that case, we won't have a \nobreak before. At least % that's the theory. \ifnum\lastpenalty<10000 \parskip=0in \fi \noindent \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% % \vadjust{\penalty 1200}}% not good to break after first line of item. \flushcr } % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. % \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% % Allow an optional argument of an uppercase letter, lowercase letter, % or number, to specify the first label in the enumerated list. No % argument is the same as `1'. % \envparseargdef\enumerate{\enumeratey #1 \endenumeratey} \def\enumeratey #1 #2\endenumeratey{% % If we were given no argument, pretend we were given `1'. \def\thearg{#1}% \ifx\thearg\empty \def\thearg{1}\fi % % Detect if the argument is a single token. If so, it might be a % letter. Otherwise, the only valid thing it can be is a number. % (We will always have one token, because of the test we just made. % This is a good thing, since \splitoff doesn't work given nothing at % all -- the first parameter is undelimited.) \expandafter\splitoff\thearg\endmark \ifx\rest\empty % Only one token in the argument. It could still be anything. % A ``lowercase letter'' is one whose \lccode is nonzero. % An ``uppercase letter'' is one whose \lccode is both nonzero, and % not equal to itself. % Otherwise, we assume it's a number. % % We need the \relax at the end of the \ifnum lines to stop TeX from % continuing to look for a . % \ifnum\lccode\expandafter`\thearg=0\relax \numericenumerate % a number (we hope) \else % It's a letter. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax \lowercaseenumerate % lowercase letter \else \uppercaseenumerate % uppercase letter \fi \fi \else % Multiple tokens in the argument. We hope it's a number. \numericenumerate \fi } % An @enumerate whose labels are integers. The starting integer is % given in \thearg. % \def\numericenumerate{% \itemno = \thearg \startenumeration{\the\itemno}% } % The starting (lowercase) letter is in \thearg. \def\lowercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more lowercase letters in @enumerate; get a bigger alphabet}% \fi \char\lccode\itemno }% } % The starting (uppercase) letter is in \thearg. \def\uppercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more uppercase letters in @enumerate; get a bigger alphabet} \fi \char\uccode\itemno }% } % Call \doitemize, adding a period to the first argument and supplying the % common last two arguments. Also subtract one from the initial value in % \itemno, since @item increments \itemno. % \def\startenumeration#1{% \advance\itemno by -1 \doitemize{#1.}\flushcr } % @alphaenumerate and @capsenumerate are abbreviations for giving an arg % to @enumerate. % \def\alphaenumerate{\enumerate{a}} \def\capsenumerate{\enumerate{A}} \def\Ealphaenumerate{\Eenumerate} \def\Ecapsenumerate{\Eenumerate} % @multitable macros % Amy Hendrickson, 8/18/94, 3/6/96 % % @multitable ... @end multitable will make as many columns as desired. % Contents of each column will wrap at width given in preamble. Width % can be specified either with sample text given in a template line, % or in percent of \hsize, the current width of text on page. % Table can continue over pages but will only break between lines. % To make preamble: % % Either define widths of columns in terms of percent of \hsize: % @multitable @columnfractions .25 .3 .45 % @item ... % % Numbers following @columnfractions are the percent of the total % current hsize to be used for each column. You may use as many % columns as desired. % Or use a template: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. % @item, @tab do not need to be on their own lines, but it will not hurt % if they are. % Sample multitable: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item first col stuff @tab second col stuff @tab third col % @item % first col stuff % @tab % second col stuff % @tab % third col % @item first col stuff @tab second col stuff % @tab Many paragraphs of text may be used in any column. % % They will wrap at the width determined by the template. % @item@tab@tab This will be in third column. % @end multitable % Default dimensions may be reset by user. % @multitableparskip is vertical space between paragraphs in table. % @multitableparindent is paragraph indent in table. % @multitablecolmargin is horizontal space to be left between columns. % @multitablelinespace is space to leave between table items, baseline % to baseline. % 0pt means it depends on current normal line spacing. % \newskip\multitableparskip \newskip\multitableparindent \newdimen\multitablecolspace \newskip\multitablelinespace \multitableparskip=0pt \multitableparindent=6pt \multitablecolspace=12pt \multitablelinespace=0pt % Macros used to set up halign preamble: % \let\endsetuptable\relax \def\xendsetuptable{\endsetuptable} \let\columnfractions\relax \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent % #1 is the @columnfraction, usually a decimal number like .5, but might % be just 1. We just use it, whatever it is. % \def\pickupwholefraction#1 {% \global\advance\colcount by 1 \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% \setuptable } \newcount\colcount \def\setuptable#1{% \def\firstarg{#1}% \ifx\firstarg\xendsetuptable \let\go = \relax \else \ifx\firstarg\xcolumnfractions \global\setpercenttrue \else \ifsetpercent \let\go\pickupwholefraction \else \global\advance\colcount by 1 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a % separator; typically that is always in the input, anyway. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi \fi \ifx\go\pickupwholefraction % Put the argument back for the \pickupwholefraction call, so % we'll always have a period there to be parsed. \def\go{\pickupwholefraction#1}% \else \let\go = \setuptable \fi% \fi \go } % multitable-only commands. % % @headitem starts a heading row, which we typeset in bold. % Assignments have to be global since we are inside the implicit group % of an alignment entry. \everycr resets \everytab so we don't have to % undo it ourselves. \def\headitemfont{\b}% for people to use in the template row; not changeable \def\headitem{% \checkenv\multitable \crcr \global\everytab={\bf}% can't use \headitemfont since the parsing differs \the\everytab % for the first item }% % % A \tab used to include \hskip1sp. But then the space in a template % line is not enough. That is bad. So let's go back to just `&' until % we again encounter the problem the 1sp was intended to solve. % --karl, nathan@acm.org, 20apr99. \def\tab{\checkenv\multitable &\the\everytab}% % @multitable ... @end multitable definitions: % \newtoks\everytab % insert after every tab. % \envdef\multitable{% \vskip\parskip \startsavinginserts % % @item within a multitable starts a normal row. % We use \def instead of \let so that if one of the multitable entries % contains an @itemize, we don't choke on the \item (seen as \crcr aka % \endtemplate) expanding \doitemize. \def\item{\crcr}% % \tolerance=9500 \hbadness=9500 \setmultitablespacing \parskip=\multitableparskip \parindent=\multitableparindent \overfullrule=0pt \global\colcount=0 % \everycr = {% \noalign{% \global\everytab={}% \global\colcount=0 % Reset the column counter. % Check for saved footnotes, etc. \checkinserts % Keeps underfull box messages off when table breaks over pages. %\filbreak % Maybe so, but it also creates really weird page breaks when the % table breaks over pages. Wouldn't \vfil be better? Wait until the % problem manifests itself, so it can be fixed for real --karl. }% }% % \parsearg\domultitable } \def\domultitable#1{% % To parse everything between @multitable and @item: \setuptable#1 \endsetuptable % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. \halign\bgroup &% \global\advance\colcount by 1 \multistrut \vtop{% % Use the current \colcount to find the correct column width: \hsize=\expandafter\csname col\the\colcount\endcsname % % In order to keep entries from bumping into each other % we will add a \leftskip of \multitablecolspace to all columns after % the first one. % % If a template has been used, we will add \multitablecolspace % to the width of each template entry. % % If the user has set preamble in terms of percent of \hsize we will % use that dimension as the width of the column, and the \leftskip % will keep entries from bumping into each other. Table will start at % left margin and final column will justify at right margin. % % Make sure we don't inherit \rightskip from the outer environment. \rightskip=0pt \ifnum\colcount=1 % The first column will be indented with the surrounding text. \advance\hsize by\leftskip \else \ifsetpercent \else % If user has not set preamble in terms of percent of \hsize % we will advance \hsize by \multitablecolspace. \advance\hsize by \multitablecolspace \fi % In either case we will make \leftskip=\multitablecolspace: \leftskip=\multitablecolspace \fi % Ignoring space at the beginning and end avoids an occasional spurious % blank line, when TeX decides to break the line at the space before the % box from the multistrut, so the strut ends up on a line by itself. % For example: % @multitable @columnfractions .11 .89 % @item @code{#} % @tab Legal holiday which is valid in major parts of the whole country. % Is automatically provided with highlighting sequences respectively % marking characters. \noindent\ignorespaces##\unskip\multistrut }\cr } \def\Emultitable{% \crcr \egroup % end the \halign \global\setpercentfalse } \def\setmultitablespacing{% \def\multistrut{\strut}% just use the standard line spacing % % Compute \multitablelinespace (if not defined by user) for use in % \multitableparskip calculation. We used define \multistrut based on % this, but (ironically) that caused the spacing to be off. % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. \ifdim\multitablelinespace=0pt \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip \global\advance\multitablelinespace by-\ht0 \fi % Test to see if parskip is larger than space between lines of % table. If not, do nothing. % If so, set to same dimension as multitablelinespace. \ifdim\multitableparskip>\multitablelinespace \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller % than skip between lines in the table. \fi% \ifdim\multitableparskip=0pt \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller % than skip between lines in the table. \fi} \message{conditionals,} % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, % @ifnotxml always succeed. They currently do nothing; we don't % attempt to check whether the conditionals are properly nested. But we % have to remember that they are conditionals, so that @end doesn't % attempt to close an environment group. % \def\makecond#1{% \expandafter\let\csname #1\endcsname = \relax \expandafter\let\csname iscond.#1\endcsname = 1 } \makecond{iftex} \makecond{ifnotdocbook} \makecond{ifnothtml} \makecond{ifnotinfo} \makecond{ifnotplaintext} \makecond{ifnotxml} % Ignore @ignore, @ifhtml, @ifinfo, and the like. % \def\direntry{\doignore{direntry}} \def\documentdescription{\doignore{documentdescription}} \def\docbook{\doignore{docbook}} \def\html{\doignore{html}} \def\ifdocbook{\doignore{ifdocbook}} \def\ifhtml{\doignore{ifhtml}} \def\ifinfo{\doignore{ifinfo}} \def\ifnottex{\doignore{ifnottex}} \def\ifplaintext{\doignore{ifplaintext}} \def\ifxml{\doignore{ifxml}} \def\ignore{\doignore{ignore}} \def\menu{\doignore{menu}} \def\xml{\doignore{xml}} % Ignore text until a line `@end #1', keeping track of nested conditionals. % % A count to remember the depth of nesting. \newcount\doignorecount \def\doignore#1{\begingroup % Scan in ``verbatim'' mode: \obeylines \catcode`\@ = \other \catcode`\{ = \other \catcode`\} = \other % % Make sure that spaces turn into tokens that match what \doignoretext wants. \spaceisspace % % Count number of #1's that we've seen. \doignorecount = 0 % % Swallow text until we reach the matching `@end #1'. \dodoignore{#1}% } { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. \obeylines % % \gdef\dodoignore#1{% % #1 contains the command name as a string, e.g., `ifinfo'. % % Define a command to find the next `@end #1'. \long\def\doignoretext##1^^M@end #1{% \doignoretextyyy##1^^M@#1\_STOP_}% % % And this command to find another #1 command, at the beginning of a % line. (Otherwise, we would consider a line `@c @ifset', for % example, to count as an @ifset for nesting.) \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% % % And now expand that command. \doignoretext ^^M% }% } \def\doignoreyyy#1{% \def\temp{#1}% \ifx\temp\empty % Nothing found. \let\next\doignoretextzzz \else % Found a nested condition, ... \advance\doignorecount by 1 \let\next\doignoretextyyy % ..., look for another. % If we're here, #1 ends with ^^M\ifinfo (for example). \fi \next #1% the token \_STOP_ is present just after this macro. } % We have to swallow the remaining "\_STOP_". % \def\doignoretextzzz#1{% \ifnum\doignorecount = 0 % We have just found the outermost @end. \let\next\enddoignore \else % Still inside a nested condition. \advance\doignorecount by -1 \let\next\doignoretext % Look for the next @end. \fi \next } % Finish off ignored text. { \obeylines% % Ignore anything after the last `@end #1'; this matters in verbatim % environments, where otherwise the newline after an ignored conditional % would result in a blank line in the output. \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% } % @set VAR sets the variable VAR to an empty value. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. % % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we % didn't need it. % We rely on the fact that \parsearg sets \catcode`\ =10. % \parseargdef\set{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% {% \makevalueexpandable \def\temp{#2}% \edef\next{\gdef\makecsname{SET#1}}% \ifx\temp\empty \next{}% \else \setzzz#2\endsetzzz \fi }% } % Remove the trailing space \setxxx inserted. \def\setzzz#1 \endsetzzz{\next{#1}} % @clear VAR clears (i.e., unsets) the variable VAR. % \parseargdef\clear{% {% \makevalueexpandable \global\expandafter\let\csname SET#1\endcsname=\relax }% } % @value{foo} gets the text saved in variable foo. \def\value{\begingroup\makevalueexpandable\valuexxx} \def\valuexxx#1{\expandablevalue{#1}\endgroup} { \catcode`\- = \active \catcode`\_ = \active % \gdef\makevalueexpandable{% \let\value = \expandablevalue % We don't want these characters active, ... \catcode`\-=\other \catcode`\_=\other % ..., but we might end up with active ones in the argument if % we're called from @code, as @code{@value{foo-bar_}}, though. % So \let them to their normal equivalents. \let-\normaldash \let_\normalunderscore } } % We have this subroutine so that we can handle at least some @value's % properly in indexes (we call \makevalueexpandable in \indexdummies). % The command has to be fully expandable (if the variable is set), since % the result winds up in the index file. This means that if the % variable's value contains other Texinfo commands, it's almost certain % it will fail (although perhaps we could fix that with sufficient work % to do a one-level expansion on the result, instead of complete). % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']}% \message{Variable `#1', used in @value, is not set.}% \else \csname SET#1\endcsname \fi } % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % % To get special treatment of `@end ifset,' call \makeond and the redefine. % \makecond{ifset} \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} \def\doifset#1#2{% {% \makevalueexpandable \let\next=\empty \expandafter\ifx\csname SET#2\endcsname\relax #1% If not set, redefine \next. \fi \expandafter }\next } \def\ifsetfail{\doignore{ifset}} % @ifclear VAR ... @end executes the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % % The `\else' inside the `\doifset' parameter is a trick to reuse the % above code: if the variable is not set, do nothing, if it is set, % then redefine \next to \ifclearfail. % \makecond{ifclear} \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} \def\ifclearfail{\doignore{ifclear}} % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written % without the @) is in fact defined. We can only feasibly check at the % TeX level, so something like `mathcode' is going to considered % defined even though it is not a Texinfo command. % \makecond{ifcommanddefined} \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} % \def\doifcmddefined#1#2{{% \makevalueexpandable \let\next=\empty \expandafter\ifx\csname #2\endcsname\relax #1% If not defined, \let\next as above. \fi \expandafter }\next } \def\ifcmddefinedfail{\doignore{ifcommanddefined}} % @ifcommandnotdefined CMD ... handled similar to @ifclear above. \makecond{ifcommandnotdefined} \def\ifcommandnotdefined{% \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}} \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}} % Set the `txicommandconditionals' variable, so documents have a way to % test if the @ifcommand...defined conditionals are available. \set txicommandconditionals % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. \let\dircategory=\comment % @defininfoenclose. \let\definfoenclose=\comment \message{indexing,} % Index generation facilities % Define \newwrite to be identical to plain tex's \newwrite % except not \outer, so it can be used within macros and \if's. \edef\newwrite{\makecsname{ptexnewwrite}} % \newindex {foo} defines an index named foo. % It automatically defines \fooindex such that % \fooindex ...rest of line... puts an entry in the index foo. % It also defines \fooindfile to be the number of the output channel for % the file that accumulates this index. The file's extension is foo. % The name of an index should be no more than 2 characters long % for the sake of vms. % \def\newindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 % Open the file \fi \expandafter\xdef\csname#1index\endcsname{% % Define @#1index \noexpand\doindex{#1}} } % @defindex foo == \newindex{foo} % \def\defindex{\parsearg\newindex} % Define @defcodeindex, like @defindex except put all entries in @code. % \def\defcodeindex{\parsearg\newcodeindex} % \def\newcodeindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 \fi \expandafter\xdef\csname#1index\endcsname{% \noexpand\docodeindex{#1}}% } % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. % % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. % \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), % #3 the target index (bar). \def\dosynindex#1#2#3{% % Only do \closeout if we haven't already done it, else we'll end up % closing the target index. \expandafter \ifx\csname donesynindex#2\endcsname \relax % The \closeout helps reduce unnecessary open files; the limit on the % Acorn RISC OS is a mere 16 files. \expandafter\closeout\csname#2indfile\endcsname \expandafter\let\csname donesynindex#2\endcsname = 1 \fi % redefine \fooindfile: \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname \expandafter\let\csname#2indfile\endcsname=\temp % redefine \fooindex: \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% } % Define \doindex, the driver for all \fooindex macros. % Argument #1 is generated by the calling \fooindex macro, % and it is "foo", the name of the index. % \doindex just uses \parsearg; it calls \doind for the actual work. % This is because \doind is more useful to call from other macros. % There is also \dosubind {index}{topic}{subtopic} % which makes an entry in a two-level index such as the operation index. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} \def\singleindexer #1{\doind{\indexname}{#1}} % like the previous two, but they put @code around the argument. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} % Take care of Texinfo commands that can appear in an index entry. % Since there are some commands we want to expand, and others we don't, % we have to laboriously prevent expansion for those that we don't. % \def\indexdummies{% \escapechar = `\\ % use backslash in output files. \def\@{@}% change to @@ when we switch to @ as escape char in index files. \def\ {\realbackslash\space }% % % Need these unexpandable (because we define \tt as a dummy) % definitions when @{ or @} appear in index entry text. Also, more % complicated, when \tex is in effect and \{ is a \delimiter again. % We can't use \lbracecmd and \rbracecmd because texindex assumes % braces and backslashes are used only as delimiters. Perhaps we % should define @lbrace and @rbrace commands a la @comma. \def\{{{\tt\char123}}% \def\}{{\tt\char125}}% % % I don't entirely understand this, but when an index entry is % generated from a macro call, the \endinput which \scanmacro inserts % causes processing to be prematurely terminated. This is, % apparently, because \indexsorttmp is fully expanded, and \endinput % is an expandable command. The redefinition below makes \endinput % disappear altogether for that purpose -- although logging shows that % processing continues to some further point. On the other hand, it % seems \endinput does not hurt in the printed index arg, since that % is still getting written without apparent harm. % % Sample source (mac-idx3.tex, reported by Graham Percival to % help-texinfo, 22may06): % @macro funindex {WORD} % @findex xyz % @end macro % ... % @funindex commtest % % The above is not enough to reproduce the bug, but it gives the flavor. % % Sample whatsit resulting: % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} % % So: \let\endinput = \empty % % Do the redefinitions. \commondummies } % For the aux and toc files, @ is the escape character. So we want to % redefine everything using @ as the escape character (instead of % \realbackslash, still used for index files). When everything uses @, % this will be simpler. % \def\atdummies{% \def\@{@@}% \def\ {@ }% \let\{ = \lbraceatcmd \let\} = \rbraceatcmd % % Do the redefinitions. \commondummies \otherbackslash } % Called from \indexdummies and \atdummies. % \def\commondummies{% % % \definedummyword defines \#1 as \string\#1\space, thus effectively % preventing its expansion. This is used only for control words, % not control letters, because the \space would be incorrect for % control characters, but is needed to separate the control word % from whatever follows. % % For control letters, we have \definedummyletter, which omits the % space. % % These can be used both for control words that take an argument and % those that do not. If it is followed by {arg} in the input, then % that will dutifully get written to the index (or wherever). % \def\definedummyword ##1{\def##1{\string##1\space}}% \def\definedummyletter##1{\def##1{\string##1}}% \let\definedummyaccent\definedummyletter % \commondummiesnofonts % \definedummyletter\_% \definedummyletter\-% % % Non-English letters. \definedummyword\AA \definedummyword\AE \definedummyword\DH \definedummyword\L \definedummyword\O \definedummyword\OE \definedummyword\TH \definedummyword\aa \definedummyword\ae \definedummyword\dh \definedummyword\exclamdown \definedummyword\l \definedummyword\o \definedummyword\oe \definedummyword\ordf \definedummyword\ordm \definedummyword\questiondown \definedummyword\ss \definedummyword\th % % Although these internal commands shouldn't show up, sometimes they do. \definedummyword\bf \definedummyword\gtr \definedummyword\hat \definedummyword\less \definedummyword\sf \definedummyword\sl \definedummyword\tclose \definedummyword\tt % \definedummyword\LaTeX \definedummyword\TeX % % Assorted special characters. \definedummyword\arrow \definedummyword\bullet \definedummyword\comma \definedummyword\copyright \definedummyword\registeredsymbol \definedummyword\dots \definedummyword\enddots \definedummyword\entrybreak \definedummyword\equiv \definedummyword\error \definedummyword\euro \definedummyword\expansion \definedummyword\geq \definedummyword\guillemetleft \definedummyword\guillemetright \definedummyword\guilsinglleft \definedummyword\guilsinglright \definedummyword\lbracechar \definedummyword\leq \definedummyword\minus \definedummyword\ogonek \definedummyword\pounds \definedummyword\point \definedummyword\print \definedummyword\quotedblbase \definedummyword\quotedblleft \definedummyword\quotedblright \definedummyword\quoteleft \definedummyword\quoteright \definedummyword\quotesinglbase \definedummyword\rbracechar \definedummyword\result \definedummyword\textdegree % % We want to disable all macros so that they are not expanded by \write. \macrolist % \normalturnoffactive % % Handle some cases of @value -- where it does not contain any % (non-fully-expandable) commands. \makevalueexpandable } % \commondummiesnofonts: common to \commondummies and \indexnofonts. % \def\commondummiesnofonts{% % Control letters and accents. \definedummyletter\!% \definedummyaccent\"% \definedummyaccent\'% \definedummyletter\*% \definedummyaccent\,% \definedummyletter\.% \definedummyletter\/% \definedummyletter\:% \definedummyaccent\=% \definedummyletter\?% \definedummyaccent\^% \definedummyaccent\`% \definedummyaccent\~% \definedummyword\u \definedummyword\v \definedummyword\H \definedummyword\dotaccent \definedummyword\ogonek \definedummyword\ringaccent \definedummyword\tieaccent \definedummyword\ubaraccent \definedummyword\udotaccent \definedummyword\dotless % % Texinfo font commands. \definedummyword\b \definedummyword\i \definedummyword\r \definedummyword\sansserif \definedummyword\sc \definedummyword\slanted \definedummyword\t % % Commands that take arguments. \definedummyword\abbr \definedummyword\acronym \definedummyword\anchor \definedummyword\cite \definedummyword\code \definedummyword\command \definedummyword\dfn \definedummyword\dmn \definedummyword\email \definedummyword\emph \definedummyword\env \definedummyword\file \definedummyword\image \definedummyword\indicateurl \definedummyword\inforef \definedummyword\kbd \definedummyword\key \definedummyword\math \definedummyword\option \definedummyword\pxref \definedummyword\ref \definedummyword\samp \definedummyword\strong \definedummyword\tie \definedummyword\uref \definedummyword\url \definedummyword\var \definedummyword\verb \definedummyword\w \definedummyword\xref } % \indexnofonts is used when outputting the strings to sort the index % by, and when constructing control sequence names. It eliminates all % control sequences and just writes whatever the best ASCII sort string % would be for a given command (usually its argument). % \def\indexnofonts{% % Accent commands should become @asis. \def\definedummyaccent##1{\let##1\asis}% % We can just ignore other control letters. \def\definedummyletter##1{\let##1\empty}% % All control words become @asis by default; overrides below. \let\definedummyword\definedummyaccent % \commondummiesnofonts % % Don't no-op \tt, since it isn't a user-level command % and is used in the definitions of the active chars like <, >, |, etc. % Likewise with the other plain tex font commands. %\let\tt=\asis % \def\ { }% \def\@{@}% \def\_{\normalunderscore}% \def\-{}% @- shouldn't affect sorting % % Unfortunately, texindex is not prepared to handle braces in the % content at all. So for index sorting, we map @{ and @} to strings % starting with |, since that ASCII character is between ASCII { and }. \def\{{|a}% \def\lbracechar{|a}% % \def\}{|b}% \def\rbracechar{|b}% % % Non-English letters. \def\AA{AA}% \def\AE{AE}% \def\DH{DZZ}% \def\L{L}% \def\OE{OE}% \def\O{O}% \def\TH{ZZZ}% \def\aa{aa}% \def\ae{ae}% \def\dh{dzz}% \def\exclamdown{!}% \def\l{l}% \def\oe{oe}% \def\ordf{a}% \def\ordm{o}% \def\o{o}% \def\questiondown{?}% \def\ss{ss}% \def\th{zzz}% % \def\LaTeX{LaTeX}% \def\TeX{TeX}% % % Assorted special characters. % (The following {} will end up in the sort string, but that's ok.) \def\arrow{->}% \def\bullet{bullet}% \def\comma{,}% \def\copyright{copyright}% \def\dots{...}% \def\enddots{...}% \def\equiv{==}% \def\error{error}% \def\euro{euro}% \def\expansion{==>}% \def\geq{>=}% \def\guillemetleft{<<}% \def\guillemetright{>>}% \def\guilsinglleft{<}% \def\guilsinglright{>}% \def\leq{<=}% \def\minus{-}% \def\point{.}% \def\pounds{pounds}% \def\print{-|}% \def\quotedblbase{"}% \def\quotedblleft{"}% \def\quotedblright{"}% \def\quoteleft{`}% \def\quoteright{'}% \def\quotesinglbase{,}% \def\registeredsymbol{R}% \def\result{=>}% \def\textdegree{o}% % \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax \else \indexlquoteignore \fi % % We need to get rid of all macros, leaving only the arguments (if present). % Of course this is not nearly correct, but it is the best we can do for now. % makeinfo does not expand macros in the argument to @deffn, which ends up % writing an index entry, and texindex isn't prepared for an index sort entry % that starts with \. % % Since macro invocations are followed by braces, we can just redefine them % to take a single TeX argument. The case of a macro invocation that % goes to end-of-line is not handled. % \macrolist } % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us % ignore left quotes in the sort term. {\catcode`\`=\active \gdef\indexlquoteignore{\let`=\empty}} \let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? % Most index entries go through here, but \dosubind is the general case. % #1 is the index name, #2 is the entry text. \def\doind#1#2{\dosubind{#1}{#2}{}} % Workhorse for all \fooindexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- % empty if called from \doind, as we usually are (the main exception % is with most defuns, which call us directly). % \def\dosubind#1#2#3{% \iflinks {% % Store the main index entry text (including the third arg). \toks0 = {#2}% % If third arg is present, precede it with a space. \def\thirdarg{#3}% \ifx\thirdarg\empty \else \toks0 = \expandafter{\the\toks0 \space #3}% \fi % \edef\writeto{\csname#1indfile\endcsname}% % \safewhatsit\dosubindwrite }% \fi } % Write the entry in \toks0 to the index file: % \def\dosubindwrite{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% \fi % % Remember, we are within a group. \indexdummies % Must do this here, since \bf, etc expand at this stage \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash. % % Process the index entry with all font commands turned off, to % get the string to sort by. {\indexnofonts \edef\temp{\the\toks0}% need full expansion \xdef\indexsorttmp{\temp}% }% % % Set up the complete index entry, with both the sort key and % the original text, including any font commands. We write % three arguments to \entry to the .?? file (four in the % subentry case), texindex reduces to two when writing the .??s % sorted result. \edef\temp{% \write\writeto{% \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% }% \temp } % Take care of unwanted page breaks/skips around a whatsit: % % If a skip is the last thing on the list now, preserve it % by backing up by \lastskip, doing the \write, then inserting % the skip again. Otherwise, the whatsit generated by the % \write or \pdfdest will make \lastskip zero. The result is that % sequences like this: % @end defun % @tindex whatever % @defun ... % will have extra space inserted, because the \medbreak in the % start of the @defun won't see the skip inserted by the @end of % the previous defun. % % But don't do any of this if we're not in vertical mode. We % don't want to do a \vskip and prematurely end a paragraph. % % Avoid page breaks due to these extra skips, too. % % But wait, there is a catch there: % We'll have to check whether \lastskip is zero skip. \ifdim is not % sufficient for this purpose, as it ignores stretch and shrink parts % of the skip. The only way seems to be to check the textual % representation of the skip. % % The following is almost like \def\zeroskipmacro{0.0pt} except that % the ``p'' and ``t'' characters have catcode \other, not 11 (letter). % \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} % \newskip\whatsitskip \newcount\whatsitpenalty % % ..., ready, GO: % \def\safewhatsit#1{\ifhmode #1% \else % \lastskip and \lastpenalty cannot both be nonzero simultaneously. \whatsitskip = \lastskip \edef\lastskipmacro{\the\lastskip}% \whatsitpenalty = \lastpenalty % % If \lastskip is nonzero, that means the last item was a % skip. And since a skip is discardable, that means this % -\whatsitskip glue we're inserting is preceded by a % non-discardable item, therefore it is not a potential % breakpoint, therefore no \nobreak needed. \ifx\lastskipmacro\zeroskipmacro \else \vskip-\whatsitskip \fi % #1% % \ifx\lastskipmacro\zeroskipmacro % If \lastskip was zero, perhaps the last item was a penalty, and % perhaps it was >=10000, e.g., a \nobreak. In that case, we want % to re-insert the same penalty (values >10000 are used for various % signals); since we just inserted a non-discardable item, any % following glue (such as a \parskip) would be a breakpoint. For example: % @deffn deffn-whatever % @vindex index-whatever % Description. % would allow a break between the index-whatever whatsit % and the "Description." paragraph. \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi \else % On the other hand, if we had a nonzero \lastskip, % this make-up glue would be preceded by a non-discardable item % (the whatsit from the \write), so we must insert a \nobreak. \nobreak\vskip\whatsitskip \fi \fi} % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} % or % \entry {sortstring}{page}{topic}{subtopic} % The texindex program reads in these files and writes files % containing these kinds of lines: % \initial {c} % before the first topic whose initial is c % \entry {topic}{pagelist} % for a topic that is used without subtopics % \primary {topic} % for the beginning of a topic that is used with subtopics % \secondary {subtopic}{pagelist} % for each subtopic. % Define the user-accessible indexing commands % @findex, @vindex, @kindex, @cindex. \def\findex {\fnindex} \def\kindex {\kyindex} \def\cindex {\cpindex} \def\vindex {\vrindex} \def\tindex {\tpindex} \def\pindex {\pgindex} \def\cindexsub {\begingroup\obeylines\cindexsub} {\obeylines % \gdef\cindexsub "#1" #2^^M{\endgroup % \dosubind{cp}{#2}{#1}}} % Define the macros used in formatting output of the sorted index material. % @printindex causes a particular index (the ??s file) to get printed. % It does not print any chapter heading (usually an @unnumbered). % \parseargdef\printindex{\begingroup \dobreak \chapheadingskip{10000}% % \smallfonts \rm \tolerance = 9500 \plainfrenchspacing \everypar = {}% don't want the \kern\-parindent from indentation suppression. % % See if the index file exists and is nonempty. % Change catcode of @ here so that if the index file contains % \initial {@} % as its first line, TeX doesn't complain about mismatched braces % (because it thinks @} is a control sequence). \catcode`\@ = 11 \openin 1 \jobname.#1s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, % and it loses the chapter title and the aux file entries for the % index. The easiest way to prevent this problem is to make sure % there is some text. \putwordIndexNonexistent \else % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so % it can discover if there is anything in it. \read 1 to \temp \ifeof 1 \putwordIndexIsEmpty \else % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. \def\indexbackslash{\backslashcurfont}% \catcode`\\ = 0 \escapechar = `\\ \begindoublecolumns \input \jobname.#1s \enddoublecolumns \fi \fi \closein 1 \endgroup} % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. \def\initial#1{{% % Some minor font changes for the special characters. \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt % % Remove any glue we may have, we'll be inserting our own. \removelastskip % % We like breaks before the index initials, so insert a bonus. \nobreak \vskip 0pt plus 3\baselineskip \penalty 0 \vskip 0pt plus -3\baselineskip % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column % to column. It still won't often be perfect, because of the stretch % we need before each entry, but it's better. % % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus .5\baselineskip \leftline{\secbf #1}% % Do our best not to break after the initial. \nobreak \vskip .33\baselineskip plus .1\baselineskip }} % \entry typesets a paragraph consisting of the text (#1), dot leaders, and % then page number (#2) flushed to the right margin. It is used for index % and table of contents entries. The paragraph is indented by \leftskip. % % A straightforward implementation would start like this: % \def\entry#1#2{... % But this freezes the catcodes in the argument, and can cause problems to % @code, which sets - active. This problem was fixed by a kludge--- % ``-'' was active throughout whole index, but this isn't really right. % The right solution is to prevent \entry from swallowing the whole text. % --kasal, 21nov03 \def\entry{% \begingroup % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. \par % % Do not fill out the last line with white space. \parfillskip = 0in % % No extra space above this paragraph. \parskip = 0in % % Do not prefer a separate line ending with a hyphen to fewer lines. \finalhyphendemerits = 0 % % \hangindent is only relevant when the entry text and page number % don't both fit on one line. In that case, bob suggests starting the % dots pretty far over on the line. Unfortunately, a large % indentation looks wrong when the entry text itself is broken across % lines. So we use a small indentation and put up with long leaders. % % \hangafter is reset to 1 (which is the value we want) at the start % of each paragraph, so we need not do anything with that. \hangindent = 2em % % When the entry text needs to be broken, just fill out the first line % with blank space. \rightskip = 0pt plus1fil % % A bit of stretch before each entry for the benefit of balancing % columns. \vskip 0pt plus1pt % % When reading the text of entry, convert explicit line breaks % from @* into spaces. The user might give these in long section % titles, for instance. \def\*{\unskip\space\ignorespaces}% \def\entrybreak{\hfil\break}% % % Swallow the left brace of the text (first parameter): \afterassignment\doentry \let\temp = } \def\entrybreak{\unskip\space\ignorespaces}% \def\doentry{% \bgroup % Instead of the swallowed brace. \noindent \aftergroup\finishentry % And now comes the text of the entry. } \def\finishentry#1{% % #1 is the page number. % % The following is kludged to not output a line of dots in the index if % there are no page numbers. The next person who breaks this will be % cursed by a Unix daemon. \setbox\boxA = \hbox{#1}% \ifdim\wd\boxA = 0pt \ % \else % % If we must, put the page number on a line of its own, and fill out % this line with blank space. (The \hfil is overwhelmed with the % fill leaders glue in \indexdotfill if the page number does fit.) \hfil\penalty50 \null\nobreak\indexdotfill % Have leaders before the page number. % % The `\ ' here is removed by the implicit \unskip that TeX does as % part of (the primitive) \par. Without it, a spurious underfull % \hbox ensues. \ifpdf \pdfgettoks#1.% \ \the\toksA \else \ #1% \fi \fi \par \endgroup } % Like plain.tex's \dotfill, except uses up at least 1 em. \def\indexdotfill{\cleaders \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} \def\primary #1{\line{#1\hfil}} \newskip\secondaryindent \secondaryindent=0.5cm \def\secondary#1#2{{% \parfillskip=0in \parskip=0in \hangindent=1in \hangafter=1 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill \ifpdf \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \else #2 \fi \par }} % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, % the manmac.tex format used to print the TeXbook itself. \catcode`\@=11 \newbox\partialpage \newdimen\doublecolumnhsize \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % Grab any single-column material above us. \output = {% % % Here is a possibility not foreseen in manmac: if we accumulate a % whole lot of material, we might end up calling this \output % routine twice in a row (see the doublecol-lose test, which is % essentially a couple of indexes with @setchapternewpage off). In % that case we just ship out what is in \partialpage with the normal % output routine. Generally, \partialpage will be empty when this % runs and this will be a no-op. See the indexspread.tex test case. \ifvoid\partialpage \else \onepageout{\pagecontents\partialpage}% \fi % \global\setbox\partialpage = \vbox{% % Unvbox the main output page. \unvbox\PAGE \kern-\topskip \kern\baselineskip }% }% \eject % run that output routine to set \partialpage % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% % % Change the page size parameters. We could do this once outside this % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 % format, but then we repeat the same computation. Repeating a couple % of assignments once per index is clearly meaningless for the % execution time, so we may as well do it in one place. % % First we halve the line length, less a little for the gutter between % the columns. We compute the gutter based on the line length, so it % changes automatically with the paper format. The magic constant % below is chosen so that the gutter has the same value (well, +-<1pt) % as it did when we hard-coded it. % % We put the result in a separate register, \doublecolumhsize, so we % can restore it in \pagesofar, after \hsize itself has (potentially) % been clobbered. % \doublecolumnhsize = \hsize \advance\doublecolumnhsize by -.04154\hsize \divide\doublecolumnhsize by 2 \hsize = \doublecolumnhsize % % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) \vsize = 2\vsize } % The double-column output routine for all double-column pages except % the last. % \def\doublecolumnout{% \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the % previous page. \dimen@ = \vsize \divide\dimen@ by 2 \advance\dimen@ by -\ht\partialpage % % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ \onepageout\pagesofar \unvbox255 \penalty\outputpenalty } % % Re-output the contents of the output page -- any previous material, % followed by the two boxes we just split, in box0 and box2. \def\pagesofar{% \unvbox\partialpage % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } % % All done with double columns. \def\enddoublecolumns{% % The following penalty ensures that the page builder is exercised % _before_ we change the output routine. This is necessary in the % following situation: % % The last section of the index consists only of a single entry. % Before this section, \pagetotal is less than \pagegoal, so no % break occurs before the last section starts. However, the last % section, consisting of \initial and the single \entry, does not % fit on the page and has to be broken off. Without the following % penalty the page builder will not be exercised until \eject % below, and by that time we'll already have changed the output % routine to the \balancecolumns version, so the next-to-last % double-column page will be processed with \balancecolumns, which % is wrong: The two columns will go to the main vertical list, with % the broken-off section in the recent contributions. As soon as % the output routine finishes, TeX starts reconsidering the page % break. The two columns and the broken-off section both fit on the % page, because the two columns now take up only half of the page % goal. When TeX sees \eject from below which follows the final % section, it invokes the new output routine that we've set after % \balancecolumns below; \onepageout will try to fit the two columns % and the final section into the vbox of \pageheight (see % \pagebody), causing an overfull box. % % Note that glue won't work here, because glue does not exercise the % page builder, unlike penalties (see The TeXbook, pp. 280-281). \penalty0 % \output = {% % Split the last of the double-column material. Leave it on the % current page, no automatic page break. \balancecolumns % % If we end up splitting too much material for the current page, % though, there will be another page break right after this \output % invocation ends. Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal % definition right away. (We hope \balancecolumns will never be % called on to balance too much material, but if it is, this makes % the output somewhat more palatable.) \global\output = {\onepageout{\pagecontents\PAGE}}% }% \eject \endgroup % started in \begindoublecolumns % % \pagegoal was set to the doubled \vsize above, since we restarted % the current page. We're now back to normal single-column % typesetting, so reset \pagegoal to the normal \vsize (after the % \endgroup where \vsize got restored). \pagegoal = \vsize } % % Called at the end of the double column material. \def\balancecolumns{% \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip \divide\dimen@ by 2 % target to split to %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% \splittopskip = \topskip % Loop until we get a decent breakpoint. {% \vbadness = 10000 \loop \global\setbox3 = \copy0 \global\setbox1 = \vsplit3 to \dimen@ \ifdim\ht3>\dimen@ \global\advance\dimen@ by 1pt \repeat }% %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% \setbox0=\vbox to\dimen@{\unvbox1}% \setbox2=\vbox to\dimen@{\unvbox3}% % \pagesofar } \catcode`\@ = \other \message{sectioning,} % Chapters, sections, etc. % Let's start with @part. \outer\parseargdef\part{\partzzz{#1}} \def\partzzz#1{% \chapoddpage \null \vskip.3\vsize % move it down on the page a bit \begingroup \noindent \titlefonts\rmisbold #1\par % the text \let\lastnode=\empty % no node to associate with \writetocentry{part}{#1}{}% but put it in the toc \headingsoff % no headline or footline on the part page \chapoddpage \endgroup } % \unnumberedno is an oxymoron. But we count the unnumbered % sections so that we can refer to them unambiguously in the pdf % outlines by their "section number". We avoid collisions with chapter % numbers by starting them at 10000. (If a document ever has 10000 % chapters, we're in trouble anyway, I'm sure.) \newcount\unnumberedno \unnumberedno = 10000 \newcount\chapno \newcount\secno \secno=0 \newcount\subsecno \subsecno=0 \newcount\subsubsecno \subsubsecno=0 % This counter is funny since it counts through charcodes of letters A, B, ... \newcount\appendixno \appendixno = `\@ % % \def\appendixletter{\char\the\appendixno} % We do the following ugly conditional instead of the above simple % construct for the sake of pdftex, which needs the actual % letter in the expansion, not just typeset. % \def\appendixletter{% \ifnum\appendixno=`A A% \else\ifnum\appendixno=`B B% \else\ifnum\appendixno=`C C% \else\ifnum\appendixno=`D D% \else\ifnum\appendixno=`E E% \else\ifnum\appendixno=`F F% \else\ifnum\appendixno=`G G% \else\ifnum\appendixno=`H H% \else\ifnum\appendixno=`I I% \else\ifnum\appendixno=`J J% \else\ifnum\appendixno=`K K% \else\ifnum\appendixno=`L L% \else\ifnum\appendixno=`M M% \else\ifnum\appendixno=`N N% \else\ifnum\appendixno=`O O% \else\ifnum\appendixno=`P P% \else\ifnum\appendixno=`Q Q% \else\ifnum\appendixno=`R R% \else\ifnum\appendixno=`S S% \else\ifnum\appendixno=`T T% \else\ifnum\appendixno=`U U% \else\ifnum\appendixno=`V V% \else\ifnum\appendixno=`W W% \else\ifnum\appendixno=`X X% \else\ifnum\appendixno=`Y Y% \else\ifnum\appendixno=`Z Z% % The \the is necessary, despite appearances, because \appendixletter is % expanded while writing the .toc file. \char\appendixno is not % expandable, thus it is written literally, thus all appendixes come out % with the same letter (or @) in the toc without it. \else\char\the\appendixno \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} % Each @chapter defines these (using marks) as the number+name, number % and name of the chapter. Page headings and footings can use % these. @section does likewise. \def\thischapter{} \def\thischapternum{} \def\thischaptername{} \def\thissection{} \def\thissectionnum{} \def\thissectionname{} \newcount\absseclevel % used to calculate proper heading level \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} \let\up=\raisesections % original BFox name % @lowersections: treat @chapter as section, @section as subsection, etc. \def\lowersections{\global\advance\secbase by 1} \let\down=\lowersections % original BFox name % we only have subsub. \chardef\maxseclevel = 3 % % A numbered section within an unnumbered changes to unnumbered too. % To achieve this, remember the "biggest" unnum. sec. we are currently in: \chardef\unnlevel = \maxseclevel % % Trace whether the current chapter is an appendix or not: % \chapheadtype is "N" or "A", unnumbered chapters are ignored. \def\chapheadtype{N} % Choose a heading macro % #1 is heading type % #2 is heading level % #3 is text for heading \def\genhead#1#2#3{% % Compute the abs. sec. level: \absseclevel=#2 \advance\absseclevel by \secbase % Make sure \absseclevel doesn't fall outside the range: \ifnum \absseclevel < 0 \absseclevel = 0 \else \ifnum \absseclevel > 3 \absseclevel = 3 \fi \fi % The heading type: \def\headtype{#1}% \if \headtype U% \ifnum \absseclevel < \unnlevel \chardef\unnlevel = \absseclevel \fi \else % Check for appendix sections: \ifnum \absseclevel = 0 \edef\chapheadtype{\headtype}% \else \if \headtype A\if \chapheadtype N% \errmessage{@appendix... within a non-appendix chapter}% \fi\fi \fi % Check for numbered within unnumbered: \ifnum \absseclevel > \unnlevel \def\headtype{U}% \else \chardef\unnlevel = 3 \fi \fi % Now print the heading: \if \headtype U% \ifcase\absseclevel \unnumberedzzz{#3}% \or \unnumberedseczzz{#3}% \or \unnumberedsubseczzz{#3}% \or \unnumberedsubsubseczzz{#3}% \fi \else \if \headtype A% \ifcase\absseclevel \appendixzzz{#3}% \or \appendixsectionzzz{#3}% \or \appendixsubseczzz{#3}% \or \appendixsubsubseczzz{#3}% \fi \else \ifcase\absseclevel \chapterzzz{#3}% \or \seczzz{#3}% \or \numberedsubseczzz{#3}% \or \numberedsubsubseczzz{#3}% \fi \fi \fi \suppressfirstparagraphindent } % an interface: \def\numhead{\genhead N} \def\apphead{\genhead A} \def\unnmhead{\genhead U} % @chapter, @appendix, @unnumbered. Increment top-level counter, reset % all lower-level sectioning counters to zero. % % Also set \chaplevelprefix, which we prepend to @float sequence numbers % (e.g., figures), q.v. By default (before any chapter), that is empty. \let\chaplevelprefix = \empty % \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz \def\chapterzzz#1{% % section resetting is \global in case the chapter is in a group, such % as an @include file. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\chapno by 1 % % Used for \float. \gdef\chaplevelprefix{\the\chapno.}% \resetallfloatnos % % \putwordChapter can contain complex things in translations. \toks0=\expandafter{\putwordChapter}% \message{\the\toks0 \space \the\chapno}% % % Write the actual heading. \chapmacro{#1}{Ynumbered}{\the\chapno}% % % So @section and the like are numbered underneath this chapter. \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec } \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz % \def\appendixzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\appendixno by 1 \gdef\chaplevelprefix{\appendixletter.}% \resetallfloatnos % % \putwordAppendix can contain complex things in translations. \toks0=\expandafter{\putwordAppendix}% \message{\the\toks0 \space \appendixletter}% % \chapmacro{#1}{Yappendix}{\appendixletter}% % \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \global\let\subsubsection = \appendixsubsubsec } % normally unnmhead0 calls unnumberedzzz: \outer\parseargdef\unnumbered{\unnmhead0{#1}} \def\unnumberedzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\unnumberedno by 1 % % Since an unnumbered has no number, no prefix for figures. \global\let\chaplevelprefix = \empty \resetallfloatnos % % This used to be simply \message{#1}, but TeX fully expands the % argument to \message. Therefore, if #1 contained @-commands, TeX % expanded them. For example, in `@unnumbered The @cite{Book}', TeX % expanded @cite (which turns out to cause errors because \cite is meant % to be executed, not expanded). % % Anyway, we don't want the fully-expanded definition of @cite to appear % as a result of the \message, we just want `@cite' itself. We use % \the to achieve this: TeX expands \the only once, % simply yielding the contents of . (We also do this for % the toc entries.) \toks0 = {#1}% \message{(\the\toks0)}% % \chapmacro{#1}{Ynothing}{\the\unnumberedno}% % \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec } % @centerchap is like @unnumbered, but the heading is centered. \outer\parseargdef\centerchap{% % Well, we could do the following in a group, but that would break % an assumption that \chapmacro is called at the outermost level. % Thus we are safer this way: --kasal, 24feb04 \let\centerparametersmaybe = \centerparameters \unnmhead0{#1}% \let\centerparametersmaybe = \relax } % @top is like @unnumbered. \let\top\unnumbered % Sections. % \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz \def\seczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% } % normally calls appendixsectionzzz: \outer\parseargdef\appendixsection{\apphead1{#1}} \def\appendixsectionzzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% } \let\appendixsec\appendixsection % normally calls unnumberedseczzz: \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} \def\unnumberedseczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% } % Subsections. % % normally calls numberedsubseczzz: \outer\parseargdef\numberedsubsec{\numhead2{#1}} \def\numberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% } % normally calls appendixsubseczzz: \outer\parseargdef\appendixsubsec{\apphead2{#1}} \def\appendixsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno}% } % normally calls unnumberedsubseczzz: \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} \def\unnumberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno}% } % Subsubsections. % % normally numberedsubsubseczzz: \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} \def\numberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynumbered}% {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% } % normally appendixsubsubseczzz: \outer\parseargdef\appendixsubsubsec{\apphead3{#1}} \def\appendixsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% } % normally unnumberedsubsubseczzz: \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} \def\unnumberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% } % These macros control what the section commands do, according % to what kind of chapter we are in (ordinary, appendix, or unnumbered). % Define them by default for a numbered chapter. \let\section = \numberedsec \let\subsection = \numberedsubsec \let\subsubsection = \numberedsubsubsec % Define @majorheading, @heading and @subheading \def\majorheading{% {\advance\chapheadingskip by 10pt \chapbreak }% \parsearg\chapheadingzzz } \def\chapheading{\chapbreak \parsearg\chapheadingzzz} \def\chapheadingzzz#1{% \vbox{\chapfonts \raggedtitlesettings #1\par}% \nobreak\bigskip \nobreak \suppressfirstparagraphindent } % @heading, @subheading, @subsubheading. \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), % given all the information in convenient, parsed form. % Args are the skip and penalty (usually negative) \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} % Parameter controlling skip before chapter headings (if needed) \newskip\chapheadingskip % Define plain chapter starts, and page on/off switching for it. \def\chapbreak{\dobreak \chapheadingskip {-4000}} \def\chappager{\par\vfill\supereject} % Because \domark is called before \chapoddpage, the filler page will % get the headings for the next chapter, which is wrong. But we don't % care -- we just disable all headings on the filler page. \def\chapoddpage{% \chappager \ifodd\pageno \else \begingroup \headingsoff \null \chappager \endgroup \fi } \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} \def\CHAPPAGon{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} \def\CHAPPAGodd{% \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} \CHAPPAGon % Chapter opening. % % #1 is the text, #2 is the section type (Ynumbered, Ynothing, % Yappendix, Yomitfromtoc), #3 the chapter number. % % To test against our argument. \def\Ynothingkeyword{Ynothing} \def\Yomitfromtockeyword{Yomitfromtoc} \def\Yappendixkeyword{Yappendix} % \def\chapmacro#1#2#3{% % Insert the first mark before the heading break (see notes for \domark). \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% \gdef\thissection{}}% % \def\temptype{#2}% \ifx\temptype\Ynothingkeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{\thischaptername}}% \else\ifx\temptype\Yomitfromtockeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{}}% \else\ifx\temptype\Yappendixkeyword \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\appendixletter}% % \noexpand\putwordAppendix avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thischapter{\noexpand\putwordAppendix{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \else \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\the\chapno}% % \noexpand\putwordChapter avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thischapter{\noexpand\putwordChapter{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \fi\fi\fi % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert the chapter heading break. \pchapsepmacro % % Now the second mark, after the heading break. No break points % between here and the heading. \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \domark % {% \chapfonts \rmisbold % % Have to define \lastsection before calling \donoderef, because the % xref code eventually uses it. On the other hand, it has to be called % after \pchapsepmacro, or the headline will change too soon. \gdef\lastsection{#1}% % % Only insert the separating space if we have a chapter/appendix % number, and don't print the unnumbered ``number''. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unnchap}% \else\ifx\temptype\Yomitfromtockeyword \setbox0 = \hbox{}% contents like unnumbered, but no toc entry \def\toctype{omit}% \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% \def\toctype{app}% \else \setbox0 = \hbox{#3\enspace}% \def\toctype{numchap}% \fi\fi\fi % % Write the toc entry for this chapter. Must come before the % \donoderef, because we include the current node name in the toc % entry, and \donoderef resets it to empty. \writetocentry{\toctype}{#1}{#3}% % % For pdftex, we have to write out the node definition (aka, make % the pdfdest) after any page break, but before the actual text has % been typeset. If the destination for the pdf outline is after the % text, then jumping from the outline may wind up with the text not % being visible, for instance under high magnification. \donoderef{#2}% % % Typeset the actual heading. \nobreak % Avoid page breaks at the interline glue. \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title \nobreak } % @centerchap -- centered and unnumbered. \let\centerparametersmaybe = \relax \def\centerparameters{% \advance\rightskip by 3\rightskip \leftskip = \rightskip \parfillskip = 0pt } % I don't think this chapter style is supported any more, so I'm not % updating it with the new noderef stuff. We'll see. --karl, 11aug03. % \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} % \def\unnchfopen #1{% \chapoddpage \vbox{\chapfonts \raggedtitlesettings #1\par}% \nobreak\bigskip\nobreak } \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } \def\centerchfopen #1{% \chapoddpage \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}% \nobreak\bigskip \nobreak } \def\CHAPFopen{% \global\let\chapmacro=\chfopen \global\let\centerchapmacro=\centerchfopen} % Section titles. These macros combine the section number parts and % call the generic \sectionheading to do the printing. % \newskip\secheadingskip \def\secheadingbreak{\dobreak \secheadingskip{-1000}} % Subsection titles. \newskip\subsecheadingskip \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} % Subsubsection titles. \def\subsubsecheadingskip{\subsecheadingskip} \def\subsubsecheadingbreak{\subsecheadingbreak} % Print any size, any type, section title. % % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the % section number. % \def\seckeyword{sec} % \def\sectionheading#1#2#3#4{% {% \checkenv{}% should not be in an environment. % % Switch to the right set of fonts. \csname #2fonts\endcsname \rmisbold % \def\sectionlevel{#2}% \def\temptype{#3}% % % Insert first mark before the heading break (see notes for \domark). \let\prevsectiondefs=\lastsectiondefs \ifx\temptype\Ynothingkeyword \ifx\sectionlevel\seckeyword \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% \gdef\thissection{\thissectionname}}% \fi \else\ifx\temptype\Yomitfromtockeyword % Don't redefine \thissection. \else\ifx\temptype\Yappendixkeyword \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thissection{\noexpand\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \else \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thissection{\noexpand\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \fi\fi\fi % % Go into vertical mode. Usually we'll already be there, but we % don't want the following whatsit to end up in a preceding paragraph % if the document didn't happen to have a blank line. \par % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert space above the heading. \csname #2headingbreak\endcsname % % Now the second mark, after the heading break. No break points % between here and the heading. \let\prevsectiondefs=\lastsectiondefs \domark % % Only insert the space after the number if we have a section number. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unn}% \gdef\lastsection{#1}% \else\ifx\temptype\Yomitfromtockeyword % for @headings -- no section number, don't include in toc, % and don't redefine \lastsection. \setbox0 = \hbox{}% \def\toctype{omit}% \let\sectionlevel=\empty \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{#4\enspace}% \def\toctype{app}% \gdef\lastsection{#1}% \else \setbox0 = \hbox{#4\enspace}% \def\toctype{num}% \gdef\lastsection{#1}% \fi\fi\fi % % Write the toc entry (before \donoderef). See comments in \chapmacro. \writetocentry{\toctype\sectionlevel}{#1}{#4}% % % Write the node reference (= pdf destination for pdftex). % Again, see comments in \chapmacro. \donoderef{#3}% % % Interline glue will be inserted when the vbox is completed. % That glue will be a valid breakpoint for the page, since it'll be % preceded by a whatsit (usually from the \donoderef, or from the % \writetocentry if there was no node). We don't want to allow that % break, since then the whatsits could end up on page n while the % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. \nobreak % % Output the actual section heading. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright \hangindent=\wd0 % zero if no section number \unhbox0 #1}% }% % Add extra space after the heading -- half of whatever came above it. % Don't allow stretch, though. \kern .5 \csname #2headingskip\endcsname % % Do not let the kern be a potential breakpoint, as it would be if it % was followed by glue. \nobreak % % We'll almost certainly start a paragraph next, so don't let that % glue accumulate. (Not a breakpoint because it's preceded by a % discardable item.) However, when a paragraph is not started next % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out % or the negative glue will cause weirdly wrong output, typically % obscuring the section heading with something else. \vskip-\parskip % % This is so the last item on the main vertical list is a known % \penalty > 10000, so \startdefun, etc., can recognize the situation % and do the needful. \penalty 10001 } \message{toc,} % Table of contents. \newwrite\tocfile % Write an entry to the toc file, opening it if necessary. % Called from @chapter, etc. % % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} % We append the current node name (if any) and page number as additional % arguments for the \{chap,sec,...}entry macros which will eventually % read this. The node name is used in the pdf outlines as the % destination to jump to. % % We open the .toc file for writing here instead of at @setfilename (or % any other fixed time) so that @contents can be anywhere in the document. % But if #1 is `omit', then we don't do anything. This is used for the % table of contents chapter openings themselves. % \newif\iftocfileopened \def\omitkeyword{omit}% % \def\writetocentry#1#2#3{% \edef\writetoctype{#1}% \ifx\writetoctype\omitkeyword \else \iftocfileopened\else \immediate\openout\tocfile = \jobname.toc \global\tocfileopenedtrue \fi % \iflinks {\atdummies \edef\temp{% \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% \temp }% \fi \fi % % Tell \shipout to create a pdf destination on each page, if we're % writing pdf. These are used in the table of contents. We can't % just write one on every page because the title pages are numbered % 1 and 2 (the page numbers aren't printed), and so are the first % two pages of the document. Thus, we'd have two destinations named % `1', and two named `2'. \ifpdf \global\pdfmakepagedesttrue \fi } % These characters do not print properly in the Computer Modern roman % fonts, so we must take special care. This is more or less redundant % with the Texinfo input format setup at the end of this file. % \def\activecatcodes{% \catcode`\"=\active \catcode`\$=\active \catcode`\<=\active \catcode`\>=\active \catcode`\\=\active \catcode`\^=\active \catcode`\_=\active \catcode`\|=\active \catcode`\~=\active } % Read the toc file, which is essentially Texinfo input. \def\readtocfile{% \setupdatafile \activecatcodes \input \tocreadfilename } \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 % Prepare to read what we've written to \tocfile. % \def\startcontents#1{% % If @setchapternewpage on, and @headings double, the contents should % start on an odd page, unlike chapters. Thus, we maintain % \contentsalignmacro in parallel with \pagealignmacro. % From: Torbjorn Granlund \contentsalignmacro \immediate\closeout\tocfile % % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \chapmacro{#1}{Yomitfromtoc}{}% % \savepageno = \pageno \begingroup % Set up to handle contents files properly. \raggedbottom % Worry more about breakpoints than the bottom. \advance\hsize by -\contentsrightmargin % Don't use the full line length. % % Roman numerals for page numbers. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi } % redefined for the two-volume lispref. We always output on % \jobname.toc even if this is redefined. % \def\tocreadfilename{\jobname.toc} % Normal (long) toc. % \def\contents{% \startcontents{\putwordTOC}% \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \ifeof 1 \else \pdfmakeoutlines \fi \closein 1 \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } % And just the chapters. \def\summarycontents{% \startcontents{\putwordShortTOC}% % \let\partentry = \shortpartentry \let\numchapentry = \shortchapentry \let\appentry = \shortchapentry \let\unnchapentry = \shortunnchapentry % We want a true roman here for the page numbers. \secfonts \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl \let\tt=\shortconttt \rm \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. \def\numsecentry##1##2##3##4{} \let\appsecentry = \numsecentry \let\unnsecentry = \numsecentry \let\numsubsecentry = \numsecentry \let\appsubsecentry = \numsecentry \let\unnsubsecentry = \numsecentry \let\numsubsubsecentry = \numsecentry \let\appsubsubsecentry = \numsecentry \let\unnsubsubsecentry = \numsecentry \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \closein 1 \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } \let\shortcontents = \summarycontents % Typeset the label for a chapter or appendix for the short contents. % The arg is, e.g., `A' for an appendix, or `3' for a chapter. % \def\shortchaplabel#1{% % This space should be enough, since a single number is .5em, and the % widest letter (M) is 1em, at least in the Computer Modern fonts. % But use \hss just in case. % (This space doesn't include the extra space that gets added after % the label; that gets put in by \shortchapentry above.) % % We'd like to right-justify chapter numbers, but that looks strange % with appendix letters. And right-justifying numbers and % left-justifying letters looks strange when there is less than 10 % chapters. Have to read the whole toc once to know how many chapters % there are before deciding ... \hbox to 1em{#1\hss}% } % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. % The last argument is the page number. % The arguments in between are the chapter number, section number, ... % Parts, in the main contents. Replace the part number, which doesn't % exist, with an empty box. Let's hope all the numbers have the same width. % Also ignore the page number, which is conventionally not printed. \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}} % % Parts, in the short toc. \def\shortpartentry#1#2#3#4{% \penalty-300 \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip \shortchapentry{{\bf #1}}{\numeralbox}{}{}% } % Chapters, in the main contents. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} % % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. \def\shortchapentry#1#2#3#4{% \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% } % Appendices, in the main contents. % Need the word Appendix, and a fixed-size box. % \def\appendixbox#1{% % We use M since it's probably the widest letter. \setbox0 = \hbox{\putwordAppendix{} M}% \hbox to \wd0{\putwordAppendix{} #1\hss}} % \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} % Unnumbered chapters. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} % Sections. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} \let\appsecentry=\numsecentry \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} % Subsections. \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} \let\appsubsecentry=\numsubsecentry \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} % And subsubsections. \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} \let\appsubsubsecentry=\numsubsubsecentry \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} % This parameter controls the indentation of the various levels. % Same as \defaultparindent. \newdimen\tocindent \tocindent = 15pt % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. % % If the toc has to be broken over pages, we want it to be at chapters % if at all possible; hence the \penalty. \def\dochapentry#1#2{% \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup \chapentryfonts \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup \nobreak\vskip .25\baselineskip plus.1\baselineskip } \def\dosecentry#1#2{\begingroup \secentryfonts \leftskip=\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsecentry#1#2{\begingroup \subsecentryfonts \leftskip=2\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsubsecentry#1#2{\begingroup \subsubsecentryfonts \leftskip=3\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} % We use the same \entry macro as for the index entries. \let\tocentry = \entry % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} \def\dopageno#1{{\rm #1}} \def\doshortpageno#1{{\rm #1}} \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} \def\subsecentryfonts{\textfonts} \def\subsubsecentryfonts{\textfonts} \message{environments,} % @foo ... @end foo. % @tex ... @end tex escapes into raw TeX temporarily. % One exception: @ is still an escape character, so that @end tex works. % But \@ or @@ will get a plain @ character. \envdef\tex{% \setupmarkupstyle{tex}% \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie \catcode `\%=14 \catcode `\+=\other \catcode `\"=\other \catcode `\|=\other \catcode `\<=\other \catcode `\>=\other \catcode`\`=\other \catcode`\'=\other \escapechar=`\\ % % ' is active in math mode (mathcode"8000). So reset it, and all our % other math active characters (just in case), to plain's definitions. \mathactive % \let\b=\ptexb \let\bullet=\ptexbullet \let\c=\ptexc \let\,=\ptexcomma \let\.=\ptexdot \let\dots=\ptexdots \let\equiv=\ptexequiv \let\!=\ptexexclam \let\i=\ptexi \let\indent=\ptexindent \let\noindent=\ptexnoindent \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace \let\/=\ptexslash \let\*=\ptexstar \let\t=\ptext \expandafter \let\csname top\endcsname=\ptextop % outer \let\frenchspacing=\plainfrenchspacing % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% } % There is no need to define \Etex. % Define @lisp ... @end lisp. % @lisp environment forms a group so it can rebind things, % including the definition of @end lisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. \newskip\lispnarrowing \lispnarrowing=0.4in % This is the definition that ^^M gets inside @lisp, @example, and other % such environments. \null is better than a space, since it doesn't % have any width. \def\lisppar{\null\endgraf} % This space is always present above and below environments. \newskip\envskipamount \envskipamount = 0pt % Make spacing and below environment symmetrical. We use \parskip here % to help in doing that, since in @example-like environments \parskip % is reset to zero; thus the \afterenvbreak inserts no space -- but the % start of the next paragraph will insert \parskip. % \def\aboveenvbreak{{% % =10000 instead of <10000 because of a special case in \itemzzz and % \sectionheading, q.v. \ifnum \lastpenalty=10000 \else \advance\envskipamount by \parskip \endgraf \ifdim\lastskip<\envskipamount \removelastskip % it's not a good place to break if the last penalty was \nobreak % or better ... \ifnum\lastpenalty<10000 \penalty-50 \fi \vskip\envskipamount \fi \fi }} \let\afterenvbreak = \aboveenvbreak % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will % also clear it, so that its embedded environments do the narrowing again. \let\nonarrowing=\relax % @cartouche ... @end cartouche: draw rectangle w/rounded corners around % environment contents. \font\circle=lcircle10 \newdimen\circthick \newdimen\cartouter\newdimen\cartinner \newskip\normbskip\newskip\normpskip\newskip\normlskip \circthick=\fontdimen8\circle % \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth \def\ctr{{\hskip 6pt\circle\char'010}} \def\cbl{{\circle\char'012\hskip -6pt}} \def\cbr{{\hskip 6pt\circle\char'011}} \def\carttop{\hbox to \cartouter{\hskip\lskip \ctl\leaders\hrule height\circthick\hfil\ctr \hskip\rskip}} \def\cartbot{\hbox to \cartouter{\hskip\lskip \cbl\leaders\hrule height\circthick\hfil\cbr \hskip\rskip}} % \newskip\lskip\newskip\rskip \envdef\cartouche{% \ifhmode\par\fi % can't be in the midst of a paragraph. \startsavinginserts \lskip=\leftskip \rskip=\rightskip \leftskip=0pt\rightskip=0pt % we want these *outside*. \cartinner=\hsize \advance\cartinner by-\lskip \advance\cartinner by-\rskip \cartouter=\hsize \advance\cartouter by 18.4pt % allow for 3pt kerns on either % side, and for 6pt waste from % each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. \let\nonarrowing = t% % % If this cartouche directly follows a sectioning command, we need the % \parskip glue (backspaced over by default) or the cartouche can % collide with the section heading. \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi % \vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop \hbox\bgroup \hskip\lskip \vrule\kern3pt \vbox\bgroup \kern3pt \hsize=\cartinner \baselineskip=\normbskip \lineskip=\normlskip \parskip=\normpskip \vskip -\parskip \comment % For explanation, see the end of def\group. } \def\Ecartouche{% \ifhmode\par\fi \kern3pt \egroup \kern3pt\vrule \hskip\rskip \egroup \cartbot \egroup \checkinserts } % This macro is called at the beginning of all the @example variants, % inside a group. \newdimen\nonfillparindent \def\nonfillstart{% \aboveenvbreak \hfuzz = 12pt % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output \parskip = 0pt % Turn off paragraph indentation but redefine \indent to emulate % the normal \indent. \nonfillparindent=\parindent \parindent = 0pt \let\indent\nonfillindent % \emergencystretch = 0pt % don't try to avoid overfull boxes \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing \else \let\nonarrowing = \relax \fi \let\exdent=\nofillexdent } \begingroup \obeyspaces % We want to swallow spaces (but not other tokens) after the fake % @indent in our nonfill-environments, where spaces are normally % active and set to @tie, resulting in them not being ignored after % @indent. \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% \gdef\nonfillindentcheck{% \ifx\temp % \expandafter\nonfillindentgobble% \else% \leavevmode\nonfillindentbox% \fi% }% \endgroup \def\nonfillindentgobble#1{\nonfillindent} \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} % If you want all examples etc. small: @set dispenvsize small. % If you want even small examples the full size: @set dispenvsize nosmall. % This affects the following displayed environments: % @example, @display, @format, @lisp % \def\smallword{small} \def\nosmallword{nosmall} \let\SETdispenvsize\relax \def\setnormaldispenv{% \ifx\SETdispenvsize\smallword % end paragraph for sake of leading, in case document has no blank % line. This is redundant with what happens in \aboveenvbreak, but % we need to do it before changing the fonts, and it's inconvenient % to change the fonts afterward. \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } \def\setsmalldispenv{% \ifx\SETdispenvsize\nosmallword \else \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } % We often define two environments, @foo and @smallfoo. % Let's do it in one command. #1 is the env name, #2 the definition. \def\makedispenvdef#1#2{% \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}% \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}% \expandafter\let\csname E#1\endcsname \afterenvbreak \expandafter\let\csname Esmall#1\endcsname \afterenvbreak } % Define two environment synonyms (#1 and #2) for an environment. \def\maketwodispenvdef#1#2#3{% \makedispenvdef{#1}{#3}% \makedispenvdef{#2}{#3}% } % % @lisp: indented, narrowed, typewriter font; % @example: same as @lisp. % % @smallexample and @smalllisp: use smaller fonts. % Originally contributed by Pavel@xerox. % \maketwodispenvdef{lisp}{example}{% \nonfillstart \tt\setupmarkupstyle{example}% \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } % @display/@smalldisplay: same as @lisp except keep current font. % \makedispenvdef{display}{% \nonfillstart \gobble } % @format/@smallformat: same as @display except don't narrow margins. % \makedispenvdef{format}{% \let\nonarrowing = t% \nonfillstart \gobble } % @flushleft: same as @format, but doesn't obey \SETdispenvsize. \envdef\flushleft{% \let\nonarrowing = t% \nonfillstart \gobble } \let\Eflushleft = \afterenvbreak % @flushright. % \envdef\flushright{% \let\nonarrowing = t% \nonfillstart \advance\leftskip by 0pt plus 1fill\relax \gobble } \let\Eflushright = \afterenvbreak % @raggedright does more-or-less normal line breaking but no right % justification. From plain.tex. \envdef\raggedright{% \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax } \let\Eraggedright\par \envdef\raggedleft{% \parindent=0pt \leftskip0pt plus2em \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt \hbadness=10000 % Last line will usually be underfull, so turn off % badness reporting. } \let\Eraggedleft\par \envdef\raggedcenter{% \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt \hbadness=10000 % Last line will usually be underfull, so turn off % badness reporting. } \let\Eraggedcenter\par % @quotation does normal linebreaking (hence we can't use \nonfillstart) % and narrows the margins. We keep \parskip nonzero in general, since % we're doing normal filling. So, when using \aboveenvbreak and % \afterenvbreak, temporarily make \parskip 0. % \makedispenvdef{quotation}{\quotationstart} % \def\quotationstart{% \indentedblockstart % same as \indentedblock, but increase right margin too. \ifx\nonarrowing\relax \advance\rightskip by \lispnarrowing \fi \parsearg\quotationlabel } % We have retained a nonzero parskip for the environment, since we're % doing normal filling. % \def\Equotation{% \par \ifx\quotationauthor\thisisundefined\else % indent a bit. \leftline{\kern 2\leftskip \sl ---\quotationauthor}% \fi {\parskip=0pt \afterenvbreak}% } \def\Esmallquotation{\Equotation} % If we're given an argument, typeset it in bold with a colon after. \def\quotationlabel#1{% \def\temp{#1}% \ifx\temp\empty \else {\bf #1: }% \fi } % @indentedblock is like @quotation, but indents only on the left and % has no optional argument. % \makedispenvdef{indentedblock}{\indentedblockstart} % \def\indentedblockstart{% {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip \parindent=0pt % % @cartouche defines \nonarrowing to inhibit narrowing at next level down. \ifx\nonarrowing\relax \advance\leftskip by \lispnarrowing \exdentamount = \lispnarrowing \else \let\nonarrowing = \relax \fi } % Keep a nonzero parskip for the environment, since we're doing normal filling. % \def\Eindentedblock{% \par {\parskip=0pt \afterenvbreak}% } \def\Esmallindentedblock{\Eindentedblock} % LaTeX-like @verbatim...@end verbatim and @verb{...} % If we want to allow any as delimiter, % we need the curly braces so that makeinfo sees the @verb command, eg: % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org % % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. % % [Knuth] p.344; only we need to do the other characters Texinfo sets % active too. Otherwise, they get lost as the first character on a % verbatim line. \def\dospecials{% \do\ \do\\\do\{\do\}\do\$\do\&% \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% \do\<\do\>\do\|\do\@\do+\do\"% % Don't do the quotes -- if we do, @set txicodequoteundirected and % @set txicodequotebacktick will not have effect on @verb and % @verbatim, and ?` and !` ligatures won't get disabled. %\do\`\do\'% } % % [Knuth] p. 380 \def\uncatcodespecials{% \def\do##1{\catcode`##1=\other}\dospecials} % % Setup for the @verb command. % % Eight spaces for a tab \begingroup \catcode`\^^I=\active \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} \endgroup % \def\setupverb{% \tt % easiest (and conventionally used) font for verbatim \def\par{\leavevmode\endgraf}% \setupmarkupstyle{verb}% \tabeightspaces % Respect line breaks, % print special symbols as themselves, and % make each space count % must do in this order: \obeylines \uncatcodespecials \sepspaces } % Setup for the @verbatim environment % % Real tab expansion. \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount % % We typeset each line of the verbatim in an \hbox, so we can handle % tabs. The \global is in case the verbatim line starts with an accent, % or some other command that starts with a begin-group. Otherwise, the % entire \verbbox would disappear at the corresponding end-group, before % it is typeset. Meanwhile, we can't have nested verbatim commands % (can we?), so the \global won't be overwriting itself. \newbox\verbbox \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup} % \begingroup \catcode`\^^I=\active \gdef\tabexpand{% \catcode`\^^I=\active \def^^I{\leavevmode\egroup \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab \divide\dimen\verbbox by\tabw \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox }% } \endgroup % start the verbatim environment. \def\setupverbatim{% \let\nonarrowing = t% \nonfillstart \tt % easiest (and conventionally used) font for verbatim % The \leavevmode here is for blank lines. Otherwise, we would % never \starttabox and the \egroup would end verbatim mode. \def\par{\leavevmode\egroup\box\verbbox\endgraf}% \tabexpand \setupmarkupstyle{verbatim}% % Respect line breaks, % print special symbols as themselves, and % make each space count. % Must do in this order: \obeylines \uncatcodespecials \sepspaces \everypar{\starttabbox}% } % Do the @verb magic: verbatim text is quoted by unique % delimiter characters. Before first delimiter expect a % right brace, after last delimiter expect closing brace: % % \def\doverb'{'#1'}'{#1} % % [Knuth] p. 382; only eat outer {} \begingroup \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] \endgroup % \def\verb{\begingroup\setupverb\doverb} % % % Do the @verbatim magic: define the macro \doverbatim so that % the (first) argument ends when '@end verbatim' is reached, ie: % % \def\doverbatim#1@end verbatim{#1} % % For Texinfo it's a lot easier than for LaTeX, % because texinfo's \verbatim doesn't stop at '\end{verbatim}': % we need not redefine '\', '{' and '}'. % % Inspired by LaTeX's verbatim command set [latex.ltx] % \begingroup \catcode`\ =\active \obeylines % % ignore everything up to the first ^^M, that's the newline at the end % of the @verbatim input line itself. Otherwise we get an extra blank % line in the output. \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% % We really want {...\end verbatim} in the body of the macro, but % without the active space; thus we have to use \xdef and \gobble. \endgroup % \envdef\verbatim{% \setupverbatim\doverbatim } \let\Everbatim = \afterenvbreak % @verbatiminclude FILE - insert text of file in verbatim environment. % \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} % \def\doverbatiminclude#1{% {% \makevalueexpandable \setupverbatim \indexnofonts % Allow `@@' and other weird things in file names. \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% \input #1 \afterenvbreak }% } % @copying ... @end copying. % Save the text away for @insertcopying later. % % We save the uninterpreted tokens, rather than creating a box. % Saving the text in a box would be much easier, but then all the % typesetting commands (@smallbook, font changes, etc.) have to be done % beforehand -- and a) we want @copying to be done first in the source % file; b) letting users define the frontmatter in as flexible order as % possible is very desirable. % \def\copying{\checkenv{}\begingroup\scanargctxt\docopying} \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} % \def\insertcopying{% \begingroup \parindent = 0pt % paragraph indentation looks wrong on title page \scanexp\copyingtext \endgroup } \message{defuns,} % @defun etc. \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt \newskip\deflastargmargin \deflastargmargin=18pt \newcount\defunpenalty % Start the processing of @deffn: \def\startdefun{% \ifnum\lastpenalty<10000 \medbreak \defunpenalty=10003 % Will keep this @deffn together with the % following @def command, see below. \else % If there are two @def commands in a row, we'll have a \nobreak, % which is there to keep the function description together with its % header. But if there's nothing but headers, we need to allow a % break somewhere. Check specifically for penalty 10002, inserted % by \printdefunline, instead of 10000, since the sectioning % commands also insert a nobreak penalty, and we don't want to allow % a break between a section heading and a defun. % % As a further refinement, we avoid "club" headers by signalling % with penalty of 10003 after the very first @deffn in the % sequence (see above), and penalty of 10002 after any following % @def command. \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi % % Similarly, after a section heading, do not allow a break. % But do insert the glue. \medskip % preceded by discardable penalty, so not a breakpoint \fi % \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent } \def\dodefunx#1{% % First, check whether we are in the right environment: \checkenv#1% % % As above, allow line break if we have multiple x headers in a row. % It's not a great place, though. \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi % % And now, it's time to reuse the body of the original defun: \expandafter\gobbledefun#1% } \def\gobbledefun#1\startdefun{} % \printdefunline \deffnheader{text} % \def\printdefunline#1#2{% \begingroup % call \deffnheader: #1#2 \endheader % common ending: \interlinepenalty = 10000 \advance\rightskip by 0pt plus 1fil\relax \endgraf \nobreak\vskip -\parskip \penalty\defunpenalty % signal to \startdefun and \dodefunx % Some of the @defun-type tags do not enable magic parentheses, % rendering the following check redundant. But we don't optimize. \checkparencounts \endgroup } \def\Edefun{\endgraf\medbreak} % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; % the only thing remaining is to define \deffnheader. % \def\makedefun#1{% \expandafter\let\csname E#1\endcsname = \Edefun \edef\temp{\noexpand\domakedefun \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% \temp } % \domakedefun \deffn \deffnx \deffnheader % % Define \deffn and \deffnx, without parameters. % \deffnheader has to be defined explicitly. % \def\domakedefun#1#2#3{% \envdef#1{% \startdefun \doingtypefnfalse % distinguish typed functions from all else \parseargusing\activeparens{\printdefunline#3}% }% \def#2{\dodefunx#1}% \def#3% } \newif\ifdoingtypefn % doing typed function? \newif\ifrettypeownline % typeset return type on its own line? % @deftypefnnewline on|off says whether the return type of typed functions % are printed on their own line. This affects @deftypefn, @deftypefun, % @deftypeop, and @deftypemethod. % \parseargdef\deftypefnnewline{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxideftypefnnl\endcsname = \empty \else\ifx\temp\offword \expandafter\let\csname SETtxideftypefnnl\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @txideftypefnnl value `\temp', must be on|off}% \fi\fi } % Untyped functions: % @deffn category name args \makedefun{deffn}{\deffngeneral{}} % @deffn category class name args \makedefun{defop}#1 {\defopon{#1\ \putwordon}} % \defopon {category on}class name args \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deffngeneral {subind}category name args % \def\deffngeneral#1#2 #3 #4\endheader{% % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. \dosubind{fn}{\code{#3}}{#1}% \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% } % Typed functions: % @deftypefn category type name args \makedefun{deftypefn}{\deftypefngeneral{}} % @deftypeop category class type name args \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} % \deftypeopon {category on}class type name args \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deftypefngeneral {subind}category type name args % \def\deftypefngeneral#1#2 #3 #4 #5\endheader{% \dosubind{fn}{\code{#4}}{#1}% \doingtypefntrue \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } % Typed variables: % @deftypevr category type var args \makedefun{deftypevr}{\deftypecvgeneral{}} % @deftypecv category class type var args \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} % \deftypecvof {category of}class type var args \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } % \deftypecvgeneral {subind}category type var args % \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% \dosubind{vr}{\code{#4}}{#1}% \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } % Untyped variables: % @defvr category var args \makedefun{defvr}#1 {\deftypevrheader{#1} {} } % @defcv category class var args \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} % \defcvof {category of}class var args \def\defcvof#1#2 {\deftypecvof{#1}#2 {} } % Types: % @deftp category name args \makedefun{deftp}#1 #2 #3\endheader{% \doind{tp}{\code{#2}}% \defname{#1}{}{#2}\defunargs{#3\unskip}% } % Remaining @defun-like shortcuts: \makedefun{defun}{\deffnheader{\putwordDeffunc} } \makedefun{defmac}{\deffnheader{\putwordDefmac} } \makedefun{defspec}{\deffnheader{\putwordDefspec} } \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } \makedefun{defvar}{\defvrheader{\putwordDefvar} } \makedefun{defopt}{\defvrheader{\putwordDefopt} } \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } \makedefun{defmethod}{\defopon\putwordMethodon} \makedefun{deftypemethod}{\deftypeopon\putwordMethodon} \makedefun{defivar}{\defcvof\putwordInstanceVariableof} \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} % \defname, which formats the name of the @def (not the args). % #1 is the category, such as "Function". % #2 is the return type, if any. % #3 is the function name. % % We are followed by (but not passed) the arguments, if any. % \def\defname#1#2#3{% \par % Get the values of \leftskip and \rightskip as they were outside the @def... \advance\leftskip by -\defbodyindent % % Determine if we are typesetting the return type of a typed function % on a line by itself. \rettypeownlinefalse \ifdoingtypefn % doing a typed function specifically? % then check user option for putting return type on its own line: \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else \rettypeownlinetrue \fi \fi % % How we'll format the category name. Putting it in brackets helps % distinguish it from the body text that may end up on the next line % just below it. \def\temp{#1}% \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} % % Figure out line sizes for the paragraph shape. We'll always have at % least two. \tempnum = 2 % % The first line needs space for \box0; but if \rightskip is nonzero, % we need only space for the part of \box0 which exceeds it: \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip % % If doing a return type on its own line, we'll have another line. \ifrettypeownline \advance\tempnum by 1 \def\maybeshapeline{0in \hsize}% \else \def\maybeshapeline{}% \fi % % The continuations: \dimen2=\hsize \advance\dimen2 by -\defargsindent % % The final paragraph shape: \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2 % % Put the category name at the right margin. \noindent \hbox to 0pt{% \hfil\box0 \kern-\hsize % \hsize has to be shortened this way: \kern\leftskip % Intentionally do not respect \rightskip, since we need the space. }% % % Allow all lines to be underfull without complaint: \tolerance=10000 \hbadness=10000 \exdentamount=\defbodyindent {% % defun fonts. We use typewriter by default (used to be bold) because: % . we're printing identifiers, they should be in tt in principle. % . in languages with many accents, such as Czech or French, it's % common to leave accents off identifiers. The result looks ok in % tt, but exceedingly strange in rm. % . we don't want -- and --- to be treated as ligatures. % . this still does not fix the ?` and !` ligatures, but so far no % one has made identifiers using them :). \df \tt \def\temp{#2}% text of the return type \ifx\temp\empty\else \tclose{\temp}% typeset the return type \ifrettypeownline % put return type on its own line; prohibit line break following: \hfil\vadjust{\nobreak}\break \else \space % type on same line, so just followed by a space \fi \fi % no return type #3% output function name }% {\rm\enskip}% hskip 0.5 em of \tenrm % \boldbrax % arguments will be output next, if any. } % Print arguments in slanted roman (not ttsl), inconsistently with using % tt for the name. This is because literal text is sometimes needed in % the argument list (groff manual), and ttsl and tt are not very % distinguishable. Prevent hyphenation at `-' chars. % \def\defunargs#1{% % use sl by default (not ttsl), % tt for the names. \df \sl \hyphenchar\font=0 % % On the other hand, if an argument has two dashes (for instance), we % want a way to get ttsl. We used to recommend @var for that, so % leave the code in, but it's strange for @var to lead to typewriter. % Nowadays we recommend @code, since the difference between a ttsl hyphen % and a tt hyphen is pretty tiny. @code also disables ?` !`. \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% #1% \sl\hyphenchar\font=45 } % We want ()&[] to print specially on the defun line. % \def\activeparens{% \catcode`\(=\active \catcode`\)=\active \catcode`\[=\active \catcode`\]=\active \catcode`\&=\active } % Make control sequences which act like normal parenthesis chars. \let\lparen = ( \let\rparen = ) % Be sure that we always have a definition for `(', etc. For example, % if the fn name has parens in it, \boldbrax will not be in effect yet, % so TeX would otherwise complain about undefined control sequence. { \activeparens \global\let(=\lparen \global\let)=\rparen \global\let[=\lbrack \global\let]=\rbrack \global\let& = \& \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} \gdef\magicamp{\let&=\amprm} } \newcount\parencount % If we encounter &foo, then turn on ()-hacking afterwards \newif\ifampseen \def\amprm#1 {\ampseentrue{\bf\ }} \def\parenfont{% \ifampseen % At the first level, print parens in roman, % otherwise use the default font. \ifnum \parencount=1 \rm \fi \else % The \sf parens (in \boldbrax) actually are a little bolder than % the contained text. This is especially needed for [ and ] . \sf \fi } \def\infirstlevel#1{% \ifampseen \ifnum\parencount=1 #1% \fi \fi } \def\bfafterword#1 {#1 \bf} \def\opnr{% \global\advance\parencount by 1 {\parenfont(}% \infirstlevel \bfafterword } \def\clnr{% {\parenfont)}% \infirstlevel \sl \global\advance\parencount by -1 } \newcount\brackcount \def\lbrb{% \global\advance\brackcount by 1 {\bf[}% } \def\rbrb{% {\bf]}% \global\advance\brackcount by -1 } \def\checkparencounts{% \ifnum\parencount=0 \else \badparencount \fi \ifnum\brackcount=0 \else \badbrackcount \fi } % these should not use \errmessage; the glibc manual, at least, actually % has such constructs (when documenting function pointers). \def\badparencount{% \message{Warning: unbalanced parentheses in @def...}% \global\parencount=0 } \def\badbrackcount{% \message{Warning: unbalanced square brackets in @def...}% \global\brackcount=0 } \message{macros,} % @macro. % To do this right we need a feature of e-TeX, \scantokens, % which we arrange to emulate with a temporary file in ordinary TeX. \ifx\eTeXversion\thisisundefined \newwrite\macscribble \def\scantokens#1{% \toks0={#1}% \immediate\openout\macscribble=\jobname.tmp \immediate\write\macscribble{\the\toks0}% \immediate\closeout\macscribble \input \jobname.tmp } \fi \def\scanmacro#1{\begingroup \newlinechar`\^^M \let\xeatspaces\eatspaces % % Undo catcode changes of \startcontents and \doprintindex % When called from @insertcopying or (short)caption, we need active % backslash to get it printed correctly. Previously, we had % \catcode`\\=\other instead. We'll see whether a problem appears % with macro expansion. --kasal, 19aug04 \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ % % ... and for \example: \spaceisspace % % The \empty here causes a following catcode 5 newline to be eaten as % part of reading whitespace after a control sequence. It does not % eat a catcode 13 newline. There's no good way to handle the two % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX % would then have different behavior). See the Macro Details node in % the manual for the workaround we recommend for macros and % line-oriented commands. % \scantokens{#1\empty}% \endgroup} \def\scanexp#1{% \edef\temp{\noexpand\scanmacro{#1}}% \temp } \newcount\paramno % Count of parameters \newtoks\macname % Macro name \newif\ifrecursive % Is it recursive? % List of all defined macros in the form % \definedummyword\macro1\definedummyword\macro2... % Currently is also contains all @aliases; the list can be split % if there is a need. \def\macrolist{} % Add the macro to \macrolist \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} \def\addtomacrolistxxx#1{% \toks0 = \expandafter{\macrolist\definedummyword#1}% \xdef\macrolist{\the\toks0}% } % Utility routines. % This does \let #1 = #2, with \csnames; that is, % \let \csname#1\endcsname = \csname#2\endcsname % (except of course we have to play expansion games). % \def\cslet#1#2{% \expandafter\let \csname#1\expandafter\endcsname \csname#2\endcsname } % Trim leading and trailing spaces off a string. % Concepts from aro-bend problem 15 (see CTAN). {\catcode`\@=11 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} \def\unbrace#1{#1} \unbrace{\gdef\trim@@@ #1 } #2@{#1} } % Trim a single trailing ^^M off a string. {\catcode`\^^M=\other \catcode`\Q=3% \gdef\eatcr #1{\eatcra #1Q^^MQ}% \gdef\eatcra#1^^MQ{\eatcrb#1Q}% \gdef\eatcrb#1Q#2Q{#1}% } % Macro bodies are absorbed as an argument in a context where % all characters are catcode 10, 11 or 12, except \ which is active % (as in normal texinfo). It is necessary to change the definition of \ % to recognize macro arguments; this is the job of \mbodybackslash. % % Non-ASCII encodings make 8-bit characters active, so un-activate % them to avoid their expansion. Must do this non-globally, to % confine the change to the current group. % % It's necessary to have hard CRs when the macro is executed. This is % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. % \def\scanctxt{% used as subroutine \catcode`\"=\other \catcode`\+=\other \catcode`\<=\other \catcode`\>=\other \catcode`\@=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\~=\other \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi } \def\scanargctxt{% used for copying and captions, not macros. \scanctxt \catcode`\\=\other \catcode`\^^M=\other } \def\macrobodyctxt{% used for @macro definitions \scanctxt \catcode`\{=\other \catcode`\}=\other \catcode`\^^M=\other \usembodybackslash } \def\macroargctxt{% used when scanning invocations \scanctxt \catcode`\\=0 } % why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes" % for the single characters \ { }. Thus, we end up with the "commands" % that would be written @\ @{ @} in a Texinfo document. % % We already have @{ and @}. For @\, we define it here, and only for % this purpose, to produce a typewriter backslash (so, the @\ that we % define for @math can't be used with @macro calls): % \def\\{\normalbackslash}% % % We would like to do this for \, too, since that is what makeinfo does. % But it is not possible, because Texinfo already has a command @, for a % cedilla accent. Documents must use @comma{} instead. % % \anythingelse will almost certainly be an error of some kind. % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N % where N is the macro parameter number. % We define \csname macarg.\endcsname to be \realbackslash, so % \\ in macro replacement text gets you a backslash. % {\catcode`@=0 @catcode`@\=@active @gdef@usembodybackslash{@let\=@mbodybackslash} @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} } \expandafter\def\csname macarg.\endcsname{\realbackslash} \def\margbackslash#1{\char`\#1 } \def\macro{\recursivefalse\parsearg\macroxxx} \def\rmacro{\recursivetrue\parsearg\macroxxx} \def\macroxxx#1{% \getargs{#1}% now \macname is the macname and \argl the arglist \ifx\argl\empty % no arguments \paramno=0\relax \else \expandafter\parsemargdef \argl;% \if\paramno>256\relax \ifx\eTeXversion\thisisundefined \errhelp = \EMsimple \errmessage{You need eTeX to compile a file with macros with more than 256 arguments} \fi \fi \fi \if1\csname ismacro.\the\macname\endcsname \message{Warning: redefining \the\macname}% \else \expandafter\ifx\csname \the\macname\endcsname \relax \else \errmessage{Macro name \the\macname\space already defined}\fi \global\cslet{macsave.\the\macname}{\the\macname}% \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% \addtomacrolist{\the\macname}% \fi \begingroup \macrobodyctxt \ifrecursive \expandafter\parsermacbody \else \expandafter\parsemacbody \fi} \parseargdef\unmacro{% \if1\csname ismacro.#1\endcsname \global\cslet{#1}{macsave.#1}% \global\expandafter\let \csname ismacro.#1\endcsname=0% % Remove the macro name from \macrolist: \begingroup \expandafter\let\csname#1\endcsname \relax \let\definedummyword\unmacrodo \xdef\macrolist{\macrolist}% \endgroup \else \errmessage{Macro #1 not defined}% \fi } % Called by \do from \dounmacro on each macro. The idea is to omit any % macro definitions that have been changed to \relax. % \def\unmacrodo#1{% \ifx #1\relax % remove this \else \noexpand\definedummyword \noexpand#1% \fi } % This makes use of the obscure feature that if the last token of a % is #, then the preceding argument is delimited by % an opening brace, and that opening brace is not consumed. \def\getargs#1{\getargsxxx#1{}} \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} \def\getmacname#1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} % For macro processing make @ a letter so that we can make Texinfo private macro names. \edef\texiatcatcode{\the\catcode`\@} \catcode `@=11\relax % Parse the optional {params} list. Set up \paramno and \paramlist % so \defmacro knows what to do. Define \macarg.BLAH for each BLAH % in the params list to some hook where the argument si to be expanded. If % there are less than 10 arguments that hook is to be replaced by ##N where N % is the position in that list, that is to say the macro arguments are to be % defined `a la TeX in the macro body. % % That gets used by \mbodybackslash (above). % % We need to get `macro parameter char #' into several definitions. % The technique used is stolen from LaTeX: let \hash be something % unexpandable, insert that wherever you need a #, and then redefine % it to # just before using the token list produced. % % The same technique is used to protect \eatspaces till just before % the macro is used. % % If there are 10 or more arguments, a different technique is used, where the % hook remains in the body, and when macro is to be expanded the body is % processed again to replace the arguments. % % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the % argument N value and then \edef the body (nothing else will expand because of % the catcode regime underwhich the body was input). % % If you compile with TeX (not eTeX), and you have macros with 10 or more % arguments, you need that no macro has more than 256 arguments, otherwise an % error is produced. \def\parsemargdef#1;{% \paramno=0\def\paramlist{}% \let\hash\relax \let\xeatspaces\relax \parsemargdefxxx#1,;,% % In case that there are 10 or more arguments we parse again the arguments % list to set new definitions for the \macarg.BLAH macros corresponding to % each BLAH argument. It was anyhow needed to parse already once this list % in order to count the arguments, and as macros with at most 9 arguments % are by far more frequent than macro with 10 or more arguments, defining % twice the \macarg.BLAH macros does not cost too much processing power. \ifnum\paramno<10\relax\else \paramno0\relax \parsemmanyargdef@@#1,;,% 10 or more arguments \fi } \def\parsemargdefxxx#1,{% \if#1;\let\next=\relax \else \let\next=\parsemargdefxxx \advance\paramno by 1 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname {\xeatspaces{\hash\the\paramno}}% \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} \def\parsemmanyargdef@@#1,{% \if#1;\let\next=\relax \else \let\next=\parsemmanyargdef@@ \edef\tempb{\eatspaces{#1}}% \expandafter\def\expandafter\tempa \expandafter{\csname macarg.\tempb\endcsname}% % Note that we need some extra \noexpand\noexpand, this is because we % don't want \the to be expanded in the \parsermacbody as it uses an % \xdef . \expandafter\edef\tempa {\noexpand\noexpand\noexpand\the\toks\the\paramno}% \advance\paramno by 1\relax \fi\next} % These two commands read recursive and nonrecursive macro bodies. % (They're different since rec and nonrec macros end differently.) % \catcode `\@\texiatcatcode \long\def\parsemacbody#1@end macro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \long\def\parsermacbody#1@end rmacro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \catcode `\@=11\relax \let\endargs@\relax \let\nil@\relax \def\nilm@{\nil@}% \long\def\nillm@{\nil@}% % This macro is expanded during the Texinfo macro expansion, not during its % definition. It gets all the arguments values and assigns them to macros % macarg.ARGNAME % % #1 is the macro name % #2 is the list of argument names % #3 is the list of argument values \def\getargvals@#1#2#3{% \def\macargdeflist@{}% \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion. \def\paramlist{#2,\nil@}% \def\macroname{#1}% \begingroup \macroargctxt \def\argvaluelist{#3,\nil@}% \def\@tempa{#3}% \ifx\@tempa\empty \setemptyargvalues@ \else \getargvals@@ \fi } % \def\getargvals@@{% \ifx\paramlist\nilm@ % Some sanity check needed here that \argvaluelist is also empty. \ifx\argvaluelist\nillm@ \else \errhelp = \EMsimple \errmessage{Too many arguments in macro `\macroname'!}% \fi \let\next\macargexpandinbody@ \else \ifx\argvaluelist\nillm@ % No more arguments values passed to macro. Set remaining named-arg % macros to empty. \let\next\setemptyargvalues@ \else % pop current arg name into \@tempb \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}% \expandafter\@tempa\expandafter{\paramlist}% % pop current argument value into \@tempc \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}% \expandafter\@tempa\expandafter{\argvaluelist}% % Here \@tempb is the current arg name and \@tempc is the current arg value. % First place the new argument macro definition into \@tempd \expandafter\macname\expandafter{\@tempc}% \expandafter\let\csname macarg.\@tempb\endcsname\relax \expandafter\def\expandafter\@tempe\expandafter{% \csname macarg.\@tempb\endcsname}% \edef\@tempd{\long\def\@tempe{\the\macname}}% \push@\@tempd\macargdeflist@ \let\next\getargvals@@ \fi \fi \next } \def\push@#1#2{% \expandafter\expandafter\expandafter\def \expandafter\expandafter\expandafter#2% \expandafter\expandafter\expandafter{% \expandafter#1#2}% } % Replace arguments by their values in the macro body, and place the result % in macro \@tempa \def\macvalstoargs@{% % To do this we use the property that token registers that are \the'ed % within an \edef expand only once. So we are going to place all argument % values into respective token registers. % % First we save the token context, and initialize argument numbering. \begingroup \paramno0\relax % Then, for each argument number #N, we place the corresponding argument % value into a new token list register \toks#N \expandafter\putargsintokens@\saveparamlist@,;,% % Then, we expand the body so that argument are replaced by their % values. The trick for values not to be expanded themselves is that they % are within tokens and that tokens expand only once in an \edef . \edef\@tempc{\csname mac.\macroname .body\endcsname}% % Now we restore the token stack pointer to free the token list registers % which we have used, but we make sure that expanded body is saved after % group. \expandafter \endgroup \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% } \def\macargexpandinbody@{% %% Define the named-macro outside of this group and then close this group. \expandafter \endgroup \macargdeflist@ % First the replace in body the macro arguments by their values, the result % is in \@tempa . \macvalstoargs@ % Then we point at the \norecurse or \gobble (for recursive) macro value % with \@tempb . \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname % Depending on whether it is recursive or not, we need some tailing % \egroup . \ifx\@tempb\gobble \let\@tempc\relax \else \let\@tempc\egroup \fi % And now we do the real job: \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}% \@tempd } \def\putargsintokens@#1,{% \if#1;\let\next\relax \else \let\next\putargsintokens@ % First we allocate the new token list register, and give it a temporary % alias \@tempb . \toksdef\@tempb\the\paramno % Then we place the argument value into that token list register. \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname \expandafter\@tempb\expandafter{\@tempa}% \advance\paramno by 1\relax \fi \next } % Save the token stack pointer into macro #1 \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}} % Restore the token stack pointer from number in macro #1 \def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax} % newtoks that can be used non \outer . \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi} % Tailing missing arguments are set to empty \def\setemptyargvalues@{% \ifx\paramlist\nilm@ \let\next\macargexpandinbody@ \else \expandafter\setemptyargvaluesparser@\paramlist\endargs@ \let\next\setemptyargvalues@ \fi \next } \def\setemptyargvaluesparser@#1,#2\endargs@{% \expandafter\def\expandafter\@tempa\expandafter{% \expandafter\def\csname macarg.#1\endcsname{}}% \push@\@tempa\macargdeflist@ \def\paramlist{#2}% } % #1 is the element target macro % #2 is the list macro % #3,#4\endargs@ is the list value \def\pop@#1#2#3,#4\endargs@{% \def#1{#3}% \def#2{#4}% } \long\def\longpop@#1#2#3,#4\endargs@{% \long\def#1{#3}% \long\def#2{#4}% } % This defines a Texinfo @macro. There are eight cases: recursive and % nonrecursive macros of zero, one, up to nine, and many arguments. % Much magic with \expandafter here. % \xdef is used so that macro definitions will survive the file % they're defined in; @include reads the file inside a group. % \def\defmacro{% \let\hash=##% convert placeholders to macro parameter chars \ifrecursive \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\scanmacro{\temp}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup\noexpand\scanmacro{\temp}}% \else \ifnum\paramno<10\relax % at most 9 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{\egroup\noexpand\scanmacro{\temp}}% \else % 10 or more \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% }% \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble \fi \fi \else \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % at most 9 \ifnum\paramno<10\relax \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \expandafter\noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % 10 or more: \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% }% \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse \fi \fi \fi} \catcode `\@\texiatcatcode\relax \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} % \braceorline decides whether the next nonwhitespace character is a % {. If so it reads up to the closing }, if not, it reads the whole % line. Whatever was read is then fed to the next control sequence % as an argument (by \parsebrace or \parsearg). % \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% \ifx\nchar\bgroup\else \expandafter\parsearg \fi \macnamexxx} % @alias. % We need some trickery to remove the optional spaces around the equal % sign. Make them active and then expand them all to nothing. % \def\alias{\parseargusing\obeyspaces\aliasxxx} \def\aliasxxx #1{\aliasyyy#1\relax} \def\aliasyyy #1=#2\relax{% {% \expandafter\let\obeyedspace=\empty \addtomacrolist{#1}% \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% }% \next } \message{cross references,} \newwrite\auxfile \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. % @inforef is relatively simple. \def\inforef #1{\inforefzzz #1,,,,**} \def\inforefzzz #1,#2,#3,#4**{% \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} % @node's only job in TeX is to define \lastnode, which is used in % cross-references. The @node line might or might not have commas, and % might or might not have spaces before the first comma, like: % @node foo , bar , ... % We don't want such trailing spaces in the node name. % \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} % % also remove a trailing comma, in case of something like this: % @node Help-Cross, , , Cross-refs \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} \let\nwnode=\node \let\lastnode=\empty % Write a cross-reference definition for the current node. #1 is the % type (Ynumbered, Yappendix, Ynothing). % \def\donoderef#1{% \ifx\lastnode\empty\else \setref{\lastnode}{#1}% \global\let\lastnode=\empty \fi } % @anchor{NAME} -- define xref target at arbitrary point. % \newcount\savesfregister % \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an % anchor), which consists of three parts: % 1) NAME-title - the current sectioning name taken from \lastsection, % or the anchor name. % 2) NAME-snt - section number and type, passed as the SNT arg, or % empty for anchors. % 3) NAME-pg - the page number. % % This is called from \donoderef, \anchor, and \dofloat. In the case of % floats, there is an additional part, which is not written here: % 4) NAME-lof - the text as it should appear in a @listoffloats. % \def\setref#1#2{% \pdfmkdest{#1}% \iflinks {% \atdummies % preserve commands, but don't expand them \edef\writexrdef##1##2{% \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef ##1}{##2}}% these are parameters of \writexrdef }% \toks0 = \expandafter{\lastsection}% \immediate \writexrdef{title}{\the\toks0 }% \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout }% \fi } % @xrefautosectiontitle on|off says whether @section(ing) names are used % automatically in xrefs, if the third arg is not explicitly specified. % This was provided as a "secret" @set xref-automatic-section-title % variable, now it's official. % \parseargdef\xrefautomaticsectiontitle{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETxref-automatic-section-title\endcsname = \empty \else\ifx\temp\offword \expandafter\let\csname SETxref-automatic-section-title\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @xrefautomaticsectiontitle value `\temp', must be on|off}% \fi\fi } % % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed % node name, #4 the name of the Info file, #5 the name of the printed % manual. All but the node name can be omitted. % \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} \def\ref#1{\xrefX[#1,,,,,,,]} % \newbox\toprefbox \newbox\printedrefnamebox \newbox\infofilenamebox \newbox\printedmanualbox % \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \unsepspaces % % Get args without leading/trailing spaces. \def\printedrefname{\ignorespaces #3}% \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}% % \def\infofilename{\ignorespaces #4}% \setbox\infofilenamebox = \hbox{\infofilename\unskip}% % \def\printedmanual{\ignorespaces #5}% \setbox\printedmanualbox = \hbox{\printedmanual\unskip}% % % If the printed reference name (arg #3) was not explicitly given in % the @xref, figure out what we want to use. \ifdim \wd\printedrefnamebox = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax % Not auto section-title: use node name inside the square brackets. \def\printedrefname{\ignorespaces #1}% \else % Auto section-title: use chapter/section title inside % the square brackets if we have it. \ifdim \wd\printedmanualbox > 0pt % It is in another manual, so we don't have it; use node name. \def\printedrefname{\ignorespaces #1}% \else \ifhavexrefs % We (should) know the real title if we have the xref values. \def\printedrefname{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. \def\printedrefname{\ignorespaces #1}% \fi% \fi \fi \fi % % Make link in pdf output. \ifpdf {\indexnofonts \turnoffactive \makevalueexpandable % This expands tokens, so do it after making catcode changes, so _ % etc. don't get their TeX definitions. This ignores all spaces in % #4, including (wrongly) those in the middle of the filename. \getfilename{#4}% % % This (wrongly) does not take account of leading or trailing % spaces in #1, which should be ignored. \edef\pdfxrefdest{#1}% \ifx\pdfxrefdest\empty \def\pdfxrefdest{Top}% no empty targets \else \txiescapepdf\pdfxrefdest % escape PDF special chars \fi % \leavevmode \startlink attr{/Border [0 0 0]}% \ifnum\filenamelength>0 goto file{\the\filename.pdf} name{\pdfxrefdest}% \else goto name{\pdfmkpgn{\pdfxrefdest}}% \fi }% \setcolor{\linkcolor}% \fi % % Float references are printed completely differently: "Figure 1.2" % instead of "[somenode], p.3". We distinguish them by the % LABEL-title being set to a magic string. {% % Have to otherify everything special to allow the \csname to % include an _ in the xref name, etc. \indexnofonts \turnoffactive \expandafter\global\expandafter\let\expandafter\Xthisreftitle \csname XR#1-title\endcsname }% \iffloat\Xthisreftitle % If the user specified the print name (third arg) to the ref, % print it instead of our usual "Figure 1.2". \ifdim\wd\printedrefnamebox = 0pt \refx{#1-snt}{}% \else \printedrefname \fi % % If the user also gave the printed manual name (fifth arg), append % "in MANUALNAME". \ifdim \wd\printedmanualbox > 0pt \space \putwordin{} \cite{\printedmanual}% \fi \else % node/anchor (non-float) references. % % If we use \unhbox to print the node names, TeX does not insert % empty discretionaries after hyphens, which means that it will not % find a line break at a hyphen in a node names. Since some manuals % are best written with fairly long node names, containing hyphens, % this is a loss. Therefore, we give the text of the node name % again, so it is as if TeX is seeing it for the first time. % \ifdim \wd\printedmanualbox > 0pt % Cross-manual reference with a printed manual name. % \crossmanualxref{\cite{\printedmanual\unskip}}% % \else\ifdim \wd\infofilenamebox > 0pt % Cross-manual reference with only an info filename (arg 4), no % printed manual name (arg 5). This is essentially the same as % the case above; we output the filename, since we have nothing else. % \crossmanualxref{\code{\infofilename\unskip}}% % \else % Reference within this manual. % % _ (for example) has to be the character _ for the purposes of the % control sequence corresponding to the node, but it has to expand % into the usual \leavevmode...\vrule stuff for purposes of % printing. So we \turnoffactive for the \refx-snt, back on for the % printing, back off for the \refx-pg. {\turnoffactive % Only output a following space if the -snt ref is nonempty; for % @unnumbered and @anchor, it won't be. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi }% % output the `[mynode]' via the macro below so it can be overridden. \xrefprintnodename\printedrefname % % But we always want a comma and a space: ,\space % % output the `page 3'. \turnoffactive \putwordpage\tie\refx{#1-pg}{}% \fi\fi \fi \endlink \endgroup} % Output a cross-manual xref to #1. Used just above (twice). % % Only include the text "Section ``foo'' in" if the foo is neither % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply % "see The Foo Manual", the idea being to refer to the whole manual. % % But, this being TeX, we can't easily compare our node name against the % string "Top" while ignoring the possible spaces before and after in % the input. By adding the arbitrary 7sp below, we make it much less % likely that a real node name would have the same width as "Top" (e.g., % in a monospaced font). Hopefully it will never happen in practice. % % For the same basic reason, we retypeset the "Top" at every % reference, since the current font is indeterminate. % \def\crossmanualxref#1{% \setbox\toprefbox = \hbox{Top\kern7sp}% \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}% \ifdim \wd2 > 7sp % nonempty? \ifdim \wd2 = \wd\toprefbox \else % same as Top? \putwordSection{} ``\printedrefname'' \putwordin{}\space \fi \fi #1% } % This macro is called from \xrefX for the `[nodename]' part of xref % output. It's a separate macro only so it can be changed more easily, % since square brackets don't work well in some documents. Particularly % one that Bob is working on :). % \def\xrefprintnodename#1{[#1]} % Things referred to by \setref. % \def\Ynothing{} \def\Yomitfromtoc{} \def\Ynumbered{% \ifnum\secno=0 \putwordChapter@tie \the\chapno \else \ifnum\subsecno=0 \putwordSection@tie \the\chapno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno \else \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } \def\Yappendix{% \ifnum\secno=0 \putwordAppendix@tie @char\the\appendixno{}% \else \ifnum\subsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno \else \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. % If its value is nonempty, SUFFIX is output afterward. % \def\refx#1#2{% {% \indexnofonts \otherbackslash \expandafter\global\expandafter\let\expandafter\thisrefX \csname XR#1\endcsname }% \ifx\thisrefX\relax % If not defined, say something at least. \angleleft un\-de\-fined\angleright \iflinks \ifhavexrefs {\toks0 = {#1}% avoid expansion of possibly-complex value \message{\linenumber Undefined cross reference `\the\toks0'.}}% \else \ifwarnedxrefs\else \global\warnedxrefstrue \message{Cross reference values unknown; you must run TeX again.}% \fi \fi \fi \else % It's defined, so just use it. \thisrefX \fi #2% Output the suffix in any case. } % This is the macro invoked by entries in the aux file. Usually it's % just a \def (we prepend XR to the control sequence name to avoid % collisions). But if this is a float type, we have more work to do. % \def\xrdef#1#2{% {% The node name might contain 8-bit characters, which in our current % implementation are changed to commands like @'e. Don't let these % mess up the control sequence name. \indexnofonts \turnoffactive \xdef\safexrefname{#1}% }% % \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref % % Was that xref control sequence that we just defined for a float? \expandafter\iffloat\csname XR\safexrefname\endcsname % it was a float, and we have the (safe) float type in \iffloattype. \expandafter\let\expandafter\floatlist \csname floatlist\iffloattype\endcsname % % Is this the first time we've seen this float type? \expandafter\ifx\floatlist\relax \toks0 = {\do}% yes, so just \do \else % had it before, so preserve previous elements in list. \toks0 = \expandafter{\floatlist\do}% \fi % % Remember this xref in the control sequence \floatlistFLOATTYPE, % for later use in \listoffloats. \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 {\safexrefname}}% \fi } % Read the last existing aux file, if any. No error if none exists. % \def\tryauxfile{% \openin 1 \jobname.aux \ifeof 1 \else \readdatafile{aux}% \global\havexrefstrue \fi \closein 1 } \def\setupdatafile{% \catcode`\^^@=\other \catcode`\^^A=\other \catcode`\^^B=\other \catcode`\^^C=\other \catcode`\^^D=\other \catcode`\^^E=\other \catcode`\^^F=\other \catcode`\^^G=\other \catcode`\^^H=\other \catcode`\^^K=\other \catcode`\^^L=\other \catcode`\^^N=\other \catcode`\^^P=\other \catcode`\^^Q=\other \catcode`\^^R=\other \catcode`\^^S=\other \catcode`\^^T=\other \catcode`\^^U=\other \catcode`\^^V=\other \catcode`\^^W=\other \catcode`\^^X=\other \catcode`\^^Z=\other \catcode`\^^[=\other \catcode`\^^\=\other \catcode`\^^]=\other \catcode`\^^^=\other \catcode`\^^_=\other % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. % in xref tags, i.e., node names. But since ^^e4 notation isn't % supported in the main text, it doesn't seem desirable. Furthermore, % that is not enough: for node names that actually contain a ^ % character, we would end up writing a line like this: 'xrdef {'hat % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first % argument, and \hat is not an expandable control sequence. It could % all be worked out, but why? Either we support ^^ or we don't. % % The other change necessary for this was to define \auxhat: % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter % and then to call \auxhat in \setq. % \catcode`\^=\other % % Special characters. Should be turned off anyway, but... \catcode`\~=\other \catcode`\[=\other \catcode`\]=\other \catcode`\"=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other \catcode`\%=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % % This is to support \ in node names and titles, since the \ % characters end up in a \csname. It's easier than % leaving it active and making its active definition an actual \ % character. What I don't understand is why it works in the *value* % of the xrdef. Seems like it should be a catcode12 \, and that % should not typeset properly. But it works, so I'm moving on for % now. --karl, 15jan04. \catcode`\\=\other % % Make the characters 128-255 be printing characters. {% \count1=128 \def\loop{% \catcode\count1=\other \advance\count1 by 1 \ifnum \count1<256 \loop \fi }% }% % % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 \catcode`\}=2 \catcode`\@=0 } \def\readdatafile#1{% \begingroup \setupdatafile \input\jobname.#1 \endgroup} \message{insertions,} % including footnotes. \newcount \footnoteno % The trailing space in the following definition for supereject is % vital for proper filling; pages come out unaligned when you do a % pagealignmacro call if that space before the closing brace is % removed. (Generally, numeric constants should always be followed by a % space to prevent strange expansion errors.) \def\supereject{\par\penalty -20000\footnoteno =0 } % @footnotestyle is meaningful for Info output only. \let\footnotestyle=\comment {\catcode `\@=11 % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% \let\indent=\ptexindent \let\noindent=\ptexnoindent \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. \let\@sf\empty \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi % % Remove inadvertent blank space before typesetting the footnote number. \unskip \thisfootno\@sf \dofootnote }% % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % % Oh yes, they do; otherwise, @ifset (and anything else that uses % \parseargline) fails inside footnotes because the tokens are fixed when % the footnote is read. --karl, 16nov96. % \gdef\dofootnote{% \insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. \hsize=\pagewidth \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox \floatingpenalty\@MM \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip \parindent\defaultparindent % \smallfonts \rm % % Because we use hanging indentation in footnotes, a @noindent appears % to exdent this text, so make it be a no-op. makeinfo does not use % hanging indentation so @noindent can still be needed within footnote % text after an @example or the like (not that this is good style). \let\noindent = \relax % % Hang the footnote text off the number. Use \everypar in case the % footnote extends for more than one paragraph. \everypar = {\hang}% \textindent{\thisfootno}% % % Don't crash into the line above the footnote text. Since this % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut % % Invoke rest of plain TeX footnote routine. \futurelet\next\fo@t } }%end \catcode `\@=11 % In case a @footnote appears in a vbox, save the footnote text and create % the real \insert just after the vbox finished. Otherwise, the insertion % would be lost. % Similarly, if a @footnote appears inside an alignment, save the footnote % text to a box and make the \insert when a row of the table is finished. % And the same can be done for other insert classes. --kasal, 16nov03. % Replace the \insert primitive by a cheating macro. % Deeper inside, just make sure that the saved insertions are not spilled % out prematurely. % \def\startsavinginserts{% \ifx \insert\ptexinsert \let\insert\saveinsert \else \let\checkinserts\relax \fi } % This \insert replacement works for both \insert\footins{foo} and % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. % \def\saveinsert#1{% \edef\next{\noexpand\savetobox \makeSAVEname#1}% \afterassignment\next % swallow the left brace \let\temp = } \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} \def\placesaveins#1{% \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname {\box#1}% } % eat @SAVE -- beware, all of them have catcode \other: { \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) \gdef\gobblesave @SAVE{} } % initialization: \def\newsaveins #1{% \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% \next } \def\newsaveinsX #1{% \csname newbox\endcsname #1% \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts \checksaveins #1}% } % initialize: \let\checkinserts\empty \newsaveins\footins \newsaveins\margin % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. % % Check for and read epsf.tex up front. If we read it only at @image % time, we might be inside a group, and then its definitions would get % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else % Do not bother showing banner with epsf.tex v2.7k (available in % doc/epsf.tex and on ctan). \def\epsfannounce{\toks0 = }% \input epsf.tex \fi \closein 1 % % We will only complain once about lack of epsf.tex. \newif\ifwarnednoepsf \newhelp\noepsfhelp{epsf.tex must be installed for images to work. It is also included in the Texinfo distribution, or you can get it from ftp://tug.org/tex/epsf.tex.} % \def\image#1{% \ifx\epsfbox\thisisundefined \ifwarnednoepsf \else \errhelp = \noepsfhelp \errmessage{epsf.tex not found, images will be ignored}% \global\warnednoepsftrue \fi \else \imagexxx #1,,,,,\finish \fi } % % Arguments to @image: % #1 is (mandatory) image filename; we tack on .eps extension. % #2 is (optional) width, #3 is (optional) height. % #4 is (ignored optional) html alt text. % #5 is (ignored optional) extension. % #6 is just the usual extra ignored arg for parsing stuff. \newif\ifimagevmode \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup \catcode`\^^M = 5 % in case we're inside an example \normalturnoffactive % allow _ et al. in names % If the image is by itself, center it. \ifvmode \imagevmodetrue \else \ifx\centersub\centerV % for @center @image, we need a vbox so we can have our vertical space \imagevmodetrue \vbox\bgroup % vbox has better behavior than vtop herev \fi\fi % \ifimagevmode \nobreak\medskip % Usually we'll have text after the image which will insert % \parskip glue, so insert it here too to equalize the space % above and below. \nobreak\vskip\parskip \nobreak \fi % % Leave vertical mode so that indentation from an enclosing % environment such as @quotation is respected. % However, if we're at the top level, we don't want the % normal paragraph indentation. % On the other hand, if we are in the case of @center @image, we don't % want to start a paragraph, which will create a hsize-width box and % eradicate the centering. \ifx\centersub\centerV\else \noindent \fi % % Output the image. \ifpdf \dopdfimage{#1}{#2}{#3}% \else % \epsfbox itself resets \epsf?size at each figure. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi \epsfbox{#1.eps}% \fi % \ifimagevmode \medskip % space after a standalone image \fi \ifx\centersub\centerV \egroup \fi \endgroup} % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, % etc. We don't actually implement floating yet, we always include the % float "here". But it seemed the best name for the future. % \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} % There may be a space before second and/or third parameter; delete it. \def\eatcommaspace#1, {#1,} % #1 is the optional FLOATTYPE, the text label for this float, typically % "Figure", "Table", "Example", etc. Can't contain commas. If omitted, % this float will not be numbered and cannot be referred to. % % #2 is the optional xref label. Also must be present for the float to % be referable. % % #3 is the optional positioning argument; for now, it is ignored. It % will somehow specify the positions allowed to float to (here, top, bottom). % % We keep a separate counter for each FLOATTYPE, which we reset at each % chapter-level command. \let\resetallfloatnos=\empty % \def\dofloat#1,#2,#3,#4\finish{% \let\thiscaption=\empty \let\thisshortcaption=\empty % % don't lose footnotes inside @float. % % BEWARE: when the floats start float, we have to issue warning whenever an % insert appears inside a float which could possibly float. --kasal, 26may04 % \startsavinginserts % % We can't be used inside a paragraph. \par % \vtop\bgroup \def\floattype{#1}% \def\floatlabel{#2}% \def\floatloc{#3}% we do nothing with this yet. % \ifx\floattype\empty \let\safefloattype=\empty \else {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% \fi % % If label is given but no type, we handle that as the empty type. \ifx\floatlabel\empty \else % We want each FLOATTYPE to be numbered separately (Figure 1, % Table 1, Figure 2, ...). (And if no label, no number.) % \expandafter\getfloatno\csname\safefloattype floatno\endcsname \global\advance\floatno by 1 % {% % This magic value for \lastsection is output by \setref as the % XREFLABEL-title value. \xrefX uses it to distinguish float % labels (which have a completely different output format) from % node and anchor labels. And \xrdef uses it to construct the % lists of floats. % \edef\lastsection{\floatmagic=\safefloattype}% \setref{\floatlabel}{Yfloat}% }% \fi % % start with \parskip glue, I guess. \vskip\parskip % % Don't suppress indentation if a float happens to start a section. \restorefirstparagraphindent } % we have these possibilities: % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap % @float Foo,lbl & no caption: Foo 1.1 % @float Foo & @caption{Cap}: Foo: Cap % @float Foo & no caption: Foo % @float ,lbl & Caption{Cap}: 1.1: Cap % @float ,lbl & no caption: 1.1 % @float & @caption{Cap}: Cap % @float & no caption: % \def\Efloat{% \let\floatident = \empty % % In all cases, if we have a float type, it comes first. \ifx\floattype\empty \else \def\floatident{\floattype}\fi % % If we have an xref label, the number comes next. \ifx\floatlabel\empty \else \ifx\floattype\empty \else % if also had float type, need tie first. \appendtomacro\floatident{\tie}% \fi % the number. \appendtomacro\floatident{\chaplevelprefix\the\floatno}% \fi % % Start the printed caption with what we've constructed in % \floatident, but keep it separate; we need \floatident again. \let\captionline = \floatident % \ifx\thiscaption\empty \else \ifx\floatident\empty \else \appendtomacro\captionline{: }% had ident, so need a colon between \fi % % caption text. \appendtomacro\captionline{\scanexp\thiscaption}% \fi % % If we have anything to print, print it, with space before. % Eventually this needs to become an \insert. \ifx\captionline\empty \else \vskip.5\parskip \captionline % % Space below caption. \vskip\parskip \fi % % If have an xref label, write the list of floats info. Do this % after the caption, to avoid chance of it being a breakpoint. \ifx\floatlabel\empty \else % Write the text that goes in the lof to the aux file as % \floatlabel-lof. Besides \floatident, we include the short % caption if specified, else the full caption if specified, else nothing. {% \atdummies % % since we read the caption text in the macro world, where ^^M % is turned into a normal character, we have to scan it back, so % we don't write the literal three characters "^^M" into the aux file. \scanexp{% \xdef\noexpand\gtemp{% \ifx\thisshortcaption\empty \thiscaption \else \thisshortcaption \fi }% }% \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident \ifx\gtemp\empty \else : \gtemp \fi}}% }% \fi \egroup % end of \vtop % % place the captured inserts % % BEWARE: when the floats start floating, we have to issue warning % whenever an insert appears inside a float which could possibly % float. --kasal, 26may04 % \checkinserts } % Append the tokens #2 to the definition of macro #1, not expanding either. % \def\appendtomacro#1#2{% \expandafter\def\expandafter#1\expandafter{#1#2}% } % @caption, @shortcaption % \def\caption{\docaption\thiscaption} \def\shortcaption{\docaption\thisshortcaption} \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} \def\defcaption#1#2{\egroup \def#1{#2}} % The parameter is the control sequence identifying the counter we are % going to use. Create it if it doesn't exist and assign it to \floatno. \def\getfloatno#1{% \ifx#1\relax % Haven't seen this figure type before. \csname newcount\endcsname #1% % % Remember to reset this floatno at the next chap. \expandafter\gdef\expandafter\resetallfloatnos \expandafter{\resetallfloatnos #1=0 }% \fi \let\floatno#1% } % \setref calls this to get the XREFLABEL-snt value. We want an @xref % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we % first read the @float command. % \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% % Magic string used for the XREFLABEL-title value, so \xrefX can % distinguish floats from other xref types. \def\floatmagic{!!float!!} % #1 is the control sequence we are passed; we expand into a conditional % which is true if #1 represents a float ref. That is, the magic % \lastsection value which we \setref above. % \def\iffloat#1{\expandafter\doiffloat#1==\finish} % % #1 is (maybe) the \floatmagic string. If so, #2 will be the % (safe) float type for this float. We set \iffloattype to #2. % \def\doiffloat#1=#2=#3\finish{% \def\temp{#1}% \def\iffloattype{#2}% \ifx\temp\floatmagic } % @listoffloats FLOATTYPE - print a list of floats like a table of contents. % \parseargdef\listoffloats{% \def\floattype{#1}% floattype {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% % % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax \ifhavexrefs % if the user said @listoffloats foo but never @float foo. \message{\linenumber No `\safefloattype' floats to list.}% \fi \else \begingroup \leftskip=\tocindent % indent these entries like a toc \let\do=\listoffloatsdo \csname floatlist\safefloattype\endcsname \endgroup \fi } % This is called on each entry in a list of floats. We're passed the % xref label, in the form LABEL-title, which is how we save it in the % aux file. We strip off the -title and look up \XRLABEL-lof, which % has the text we're supposed to typeset here. % % Figures without xref labels will not be included in the list (since % they won't appear in the aux file). % \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} \def\listoffloatsdoentry#1-title\finish{{% % Can't fully expand XR#1-lof because it can contain anything. Just % pass the control sequence. On the other hand, XR#1-pg is just the % page number, and we want to fully expand that so we can get a link % in pdf output. \toksA = \expandafter{\csname XR#1-lof\endcsname}% % % use the same \entry macro we use to generate the TOC and index. \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% \writeentry }} \message{localization,} % For single-language documents, @documentlanguage is usually given very % early, just after @documentencoding. Single argument is the language % (de) or locale (de_DE) abbreviation. % { \catcode`\_ = \active \globaldefs=1 \parseargdef\documentlanguage{\begingroup \let_=\normalunderscore % normal _ character for filenames \tex % read txi-??.tex file in plain TeX. % Read the file by the name they passed if it exists. \openin 1 txi-#1.tex \ifeof 1 \documentlanguagetrywithoutunderscore{#1_\finish}% \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 \endgroup % end raw TeX \endgroup} % % If they passed de_DE, and txi-de_DE.tex doesn't exist, % try txi-de.tex. % \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% \openin 1 txi-#1.tex \ifeof 1 \errhelp = \nolanghelp \errmessage{Cannot read language file txi-#1.tex}% \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 } }% end of special _ catcode % \newhelp\nolanghelp{The given language definition file cannot be found or is empty. Maybe you need to install it? Putting it in the current directory should work if nowhere else does.} % This macro is called from txi-??.tex files; the first argument is the % \language name to set (without the "\lang@" prefix), the second and % third args are \{left,right}hyphenmin. % % The language names to pass are determined when the format is built. % See the etex.log file created at that time, e.g., % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. % % With TeX Live 2008, etex now includes hyphenation patterns for all % available languages. This means we can support hyphenation in % Texinfo, at least to some extent. (This still doesn't solve the % accented characters problem.) % \catcode`@=11 \def\txisetlanguage#1#2#3{% % do not set the language if the name is undefined in the current TeX. \expandafter\ifx\csname lang@#1\endcsname \relax \message{no patterns for #1}% \else \global\language = \csname lang@#1\endcsname \fi % but there is no harm in adjusting the hyphenmin values regardless. \global\lefthyphenmin = #2\relax \global\righthyphenmin = #3\relax } % Helpers for encodings. % Set the catcode of characters 128 through 255 to the specified number. % \def\setnonasciicharscatcode#1{% \count255=128 \loop\ifnum\count255<256 \global\catcode\count255=#1\relax \advance\count255 by 1 \repeat } \def\setnonasciicharscatcodenonglobal#1{% \count255=128 \loop\ifnum\count255<256 \catcode\count255=#1\relax \advance\count255 by 1 \repeat } % @documentencoding sets the definition of non-ASCII characters % according to the specified encoding. % \parseargdef\documentencoding{% % Encoding being declared for the document. \def\declaredencoding{\csname #1.enc\endcsname}% % % Supported encodings: names converted to tokens in order to be able % to compare them with \ifx. \def\ascii{\csname US-ASCII.enc\endcsname}% \def\latnine{\csname ISO-8859-15.enc\endcsname}% \def\latone{\csname ISO-8859-1.enc\endcsname}% \def\lattwo{\csname ISO-8859-2.enc\endcsname}% \def\utfeight{\csname UTF-8.enc\endcsname}% % \ifx \declaredencoding \ascii \asciichardefs % \else \ifx \declaredencoding \lattwo \setnonasciicharscatcode\active \lattwochardefs % \else \ifx \declaredencoding \latone \setnonasciicharscatcode\active \latonechardefs % \else \ifx \declaredencoding \latnine \setnonasciicharscatcode\active \latninechardefs % \else \ifx \declaredencoding \utfeight \setnonasciicharscatcode\active \utfeightchardefs % \else \message{Unknown document encoding #1, ignoring.}% % \fi % utfeight \fi % latnine \fi % latone \fi % lattwo \fi % ascii } % A message to be logged when using a character that isn't available % the default font encoding (OT1). % \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} % Take account of \c (plain) vs. \, (Texinfo) difference. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} % First, make active non-ASCII characters in order for them to be % correctly categorized when TeX reads the replacement text of % macros containing the character definitions. \setnonasciicharscatcode\active % % Latin1 (ISO-8859-1) character definitions. \def\latonechardefs{% \gdef^^a0{\tie} \gdef^^a1{\exclamdown} \gdef^^a2{\missingcharmsg{CENT SIGN}} \gdef^^a3{{\pounds}} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\missingcharmsg{YEN SIGN}} \gdef^^a6{\missingcharmsg{BROKEN BAR}} \gdef^^a7{\S} \gdef^^a8{\"{}} \gdef^^a9{\copyright} \gdef^^aa{\ordf} \gdef^^ab{\guillemetleft} \gdef^^ac{$\lnot$} \gdef^^ad{\-} \gdef^^ae{\registeredsymbol} \gdef^^af{\={}} % \gdef^^b0{\textdegree} \gdef^^b1{$\pm$} \gdef^^b2{$^2$} \gdef^^b3{$^3$} \gdef^^b4{\'{}} \gdef^^b5{$\mu$} \gdef^^b6{\P} % \gdef^^b7{$^.$} \gdef^^b8{\cedilla\ } \gdef^^b9{$^1$} \gdef^^ba{\ordm} % \gdef^^bb{\guillemetright} \gdef^^bc{$1\over4$} \gdef^^bd{$1\over2$} \gdef^^be{$3\over4$} \gdef^^bf{\questiondown} % \gdef^^c0{\`A} \gdef^^c1{\'A} \gdef^^c2{\^A} \gdef^^c3{\~A} \gdef^^c4{\"A} \gdef^^c5{\ringaccent A} \gdef^^c6{\AE} \gdef^^c7{\cedilla C} \gdef^^c8{\`E} \gdef^^c9{\'E} \gdef^^ca{\^E} \gdef^^cb{\"E} \gdef^^cc{\`I} \gdef^^cd{\'I} \gdef^^ce{\^I} \gdef^^cf{\"I} % \gdef^^d0{\DH} \gdef^^d1{\~N} \gdef^^d2{\`O} \gdef^^d3{\'O} \gdef^^d4{\^O} \gdef^^d5{\~O} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\O} \gdef^^d9{\`U} \gdef^^da{\'U} \gdef^^db{\^U} \gdef^^dc{\"U} \gdef^^dd{\'Y} \gdef^^de{\TH} \gdef^^df{\ss} % \gdef^^e0{\`a} \gdef^^e1{\'a} \gdef^^e2{\^a} \gdef^^e3{\~a} \gdef^^e4{\"a} \gdef^^e5{\ringaccent a} \gdef^^e6{\ae} \gdef^^e7{\cedilla c} \gdef^^e8{\`e} \gdef^^e9{\'e} \gdef^^ea{\^e} \gdef^^eb{\"e} \gdef^^ec{\`{\dotless i}} \gdef^^ed{\'{\dotless i}} \gdef^^ee{\^{\dotless i}} \gdef^^ef{\"{\dotless i}} % \gdef^^f0{\dh} \gdef^^f1{\~n} \gdef^^f2{\`o} \gdef^^f3{\'o} \gdef^^f4{\^o} \gdef^^f5{\~o} \gdef^^f6{\"o} \gdef^^f7{$\div$} \gdef^^f8{\o} \gdef^^f9{\`u} \gdef^^fa{\'u} \gdef^^fb{\^u} \gdef^^fc{\"u} \gdef^^fd{\'y} \gdef^^fe{\th} \gdef^^ff{\"y} } % Latin9 (ISO-8859-15) encoding character definitions. \def\latninechardefs{% % Encoding is almost identical to Latin1. \latonechardefs % \gdef^^a4{\euro} \gdef^^a6{\v S} \gdef^^a8{\v s} \gdef^^b4{\v Z} \gdef^^b8{\v z} \gdef^^bc{\OE} \gdef^^bd{\oe} \gdef^^be{\"Y} } % Latin2 (ISO-8859-2) character definitions. \def\lattwochardefs{% \gdef^^a0{\tie} \gdef^^a1{\ogonek{A}} \gdef^^a2{\u{}} \gdef^^a3{\L} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\v L} \gdef^^a6{\'S} \gdef^^a7{\S} \gdef^^a8{\"{}} \gdef^^a9{\v S} \gdef^^aa{\cedilla S} \gdef^^ab{\v T} \gdef^^ac{\'Z} \gdef^^ad{\-} \gdef^^ae{\v Z} \gdef^^af{\dotaccent Z} % \gdef^^b0{\textdegree} \gdef^^b1{\ogonek{a}} \gdef^^b2{\ogonek{ }} \gdef^^b3{\l} \gdef^^b4{\'{}} \gdef^^b5{\v l} \gdef^^b6{\'s} \gdef^^b7{\v{}} \gdef^^b8{\cedilla\ } \gdef^^b9{\v s} \gdef^^ba{\cedilla s} \gdef^^bb{\v t} \gdef^^bc{\'z} \gdef^^bd{\H{}} \gdef^^be{\v z} \gdef^^bf{\dotaccent z} % \gdef^^c0{\'R} \gdef^^c1{\'A} \gdef^^c2{\^A} \gdef^^c3{\u A} \gdef^^c4{\"A} \gdef^^c5{\'L} \gdef^^c6{\'C} \gdef^^c7{\cedilla C} \gdef^^c8{\v C} \gdef^^c9{\'E} \gdef^^ca{\ogonek{E}} \gdef^^cb{\"E} \gdef^^cc{\v E} \gdef^^cd{\'I} \gdef^^ce{\^I} \gdef^^cf{\v D} % \gdef^^d0{\DH} \gdef^^d1{\'N} \gdef^^d2{\v N} \gdef^^d3{\'O} \gdef^^d4{\^O} \gdef^^d5{\H O} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\v R} \gdef^^d9{\ringaccent U} \gdef^^da{\'U} \gdef^^db{\H U} \gdef^^dc{\"U} \gdef^^dd{\'Y} \gdef^^de{\cedilla T} \gdef^^df{\ss} % \gdef^^e0{\'r} \gdef^^e1{\'a} \gdef^^e2{\^a} \gdef^^e3{\u a} \gdef^^e4{\"a} \gdef^^e5{\'l} \gdef^^e6{\'c} \gdef^^e7{\cedilla c} \gdef^^e8{\v c} \gdef^^e9{\'e} \gdef^^ea{\ogonek{e}} \gdef^^eb{\"e} \gdef^^ec{\v e} \gdef^^ed{\'{\dotless{i}}} \gdef^^ee{\^{\dotless{i}}} \gdef^^ef{\v d} % \gdef^^f0{\dh} \gdef^^f1{\'n} \gdef^^f2{\v n} \gdef^^f3{\'o} \gdef^^f4{\^o} \gdef^^f5{\H o} \gdef^^f6{\"o} \gdef^^f7{$\div$} \gdef^^f8{\v r} \gdef^^f9{\ringaccent u} \gdef^^fa{\'u} \gdef^^fb{\H u} \gdef^^fc{\"u} \gdef^^fd{\'y} \gdef^^fe{\cedilla t} \gdef^^ff{\dotaccent{}} } % UTF-8 character definitions. % % This code to support UTF-8 is based on LaTeX's utf8.def, with some % changes for Texinfo conventions. It is included here under the GPL by % permission from Frank Mittelbach and the LaTeX team. % \newcount\countUTFx \newcount\countUTFy \newcount\countUTFz \gdef\UTFviiiTwoOctets#1#2{\expandafter \UTFviiiDefined\csname u8:#1\string #2\endcsname} % \gdef\UTFviiiThreeOctets#1#2#3{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} % \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} \gdef\UTFviiiDefined#1{% \ifx #1\relax \message{\linenumber Unicode char \string #1 not defined for Texinfo}% \else \expandafter #1% \fi } \begingroup \catcode`\~13 \catcode`\"12 \def\UTFviiiLoop{% \global\catcode\countUTFx\active \uccode`\~\countUTFx \uppercase\expandafter{\UTFviiiTmp}% \advance\countUTFx by 1 \ifnum\countUTFx < \countUTFy \expandafter\UTFviiiLoop \fi} \countUTFx = "C2 \countUTFy = "E0 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiTwoOctets\string~}} \UTFviiiLoop \countUTFx = "E0 \countUTFy = "F0 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiThreeOctets\string~}} \UTFviiiLoop \countUTFx = "F0 \countUTFy = "F4 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiFourOctets\string~}} \UTFviiiLoop \endgroup \begingroup \catcode`\"=12 \catcode`\<=12 \catcode`\.=12 \catcode`\,=12 \catcode`\;=12 \catcode`\!=12 \catcode`\~=13 \gdef\DeclareUnicodeCharacter#1#2{% \countUTFz = "#1\relax %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% \begingroup \parseXMLCharref \def\UTFviiiTwoOctets##1##2{% \csname u8:##1\string ##2\endcsname}% \def\UTFviiiThreeOctets##1##2##3{% \csname u8:##1\string ##2\string ##3\endcsname}% \def\UTFviiiFourOctets##1##2##3##4{% \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% \expandafter\expandafter\expandafter\expandafter \expandafter\expandafter\expandafter \gdef\UTFviiiTmp{#2}% \endgroup} \gdef\parseXMLCharref{% \ifnum\countUTFz < "A0\relax \errhelp = \EMsimple \errmessage{Cannot define Unicode char value < 00A0}% \else\ifnum\countUTFz < "800\relax \parseUTFviiiA,% \parseUTFviiiB C\UTFviiiTwoOctets.,% \else\ifnum\countUTFz < "10000\relax \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% \else \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiA!% \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% \fi\fi\fi } \gdef\parseUTFviiiA#1{% \countUTFx = \countUTFz \divide\countUTFz by 64 \countUTFy = \countUTFz \multiply\countUTFz by 64 \advance\countUTFx by -\countUTFz \advance\countUTFx by 128 \uccode `#1\countUTFx \countUTFz = \countUTFy} \gdef\parseUTFviiiB#1#2#3#4{% \advance\countUTFz by "#10\relax \uccode `#3\countUTFz \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} \endgroup \def\utfeightchardefs{% \DeclareUnicodeCharacter{00A0}{\tie} \DeclareUnicodeCharacter{00A1}{\exclamdown} \DeclareUnicodeCharacter{00A3}{\pounds} \DeclareUnicodeCharacter{00A8}{\"{ }} \DeclareUnicodeCharacter{00A9}{\copyright} \DeclareUnicodeCharacter{00AA}{\ordf} \DeclareUnicodeCharacter{00AB}{\guillemetleft} \DeclareUnicodeCharacter{00AD}{\-} \DeclareUnicodeCharacter{00AE}{\registeredsymbol} \DeclareUnicodeCharacter{00AF}{\={ }} \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} \DeclareUnicodeCharacter{00B4}{\'{ }} \DeclareUnicodeCharacter{00B8}{\cedilla{ }} \DeclareUnicodeCharacter{00BA}{\ordm} \DeclareUnicodeCharacter{00BB}{\guillemetright} \DeclareUnicodeCharacter{00BF}{\questiondown} \DeclareUnicodeCharacter{00C0}{\`A} \DeclareUnicodeCharacter{00C1}{\'A} \DeclareUnicodeCharacter{00C2}{\^A} \DeclareUnicodeCharacter{00C3}{\~A} \DeclareUnicodeCharacter{00C4}{\"A} \DeclareUnicodeCharacter{00C5}{\AA} \DeclareUnicodeCharacter{00C6}{\AE} \DeclareUnicodeCharacter{00C7}{\cedilla{C}} \DeclareUnicodeCharacter{00C8}{\`E} \DeclareUnicodeCharacter{00C9}{\'E} \DeclareUnicodeCharacter{00CA}{\^E} \DeclareUnicodeCharacter{00CB}{\"E} \DeclareUnicodeCharacter{00CC}{\`I} \DeclareUnicodeCharacter{00CD}{\'I} \DeclareUnicodeCharacter{00CE}{\^I} \DeclareUnicodeCharacter{00CF}{\"I} \DeclareUnicodeCharacter{00D0}{\DH} \DeclareUnicodeCharacter{00D1}{\~N} \DeclareUnicodeCharacter{00D2}{\`O} \DeclareUnicodeCharacter{00D3}{\'O} \DeclareUnicodeCharacter{00D4}{\^O} \DeclareUnicodeCharacter{00D5}{\~O} \DeclareUnicodeCharacter{00D6}{\"O} \DeclareUnicodeCharacter{00D8}{\O} \DeclareUnicodeCharacter{00D9}{\`U} \DeclareUnicodeCharacter{00DA}{\'U} \DeclareUnicodeCharacter{00DB}{\^U} \DeclareUnicodeCharacter{00DC}{\"U} \DeclareUnicodeCharacter{00DD}{\'Y} \DeclareUnicodeCharacter{00DE}{\TH} \DeclareUnicodeCharacter{00DF}{\ss} \DeclareUnicodeCharacter{00E0}{\`a} \DeclareUnicodeCharacter{00E1}{\'a} \DeclareUnicodeCharacter{00E2}{\^a} \DeclareUnicodeCharacter{00E3}{\~a} \DeclareUnicodeCharacter{00E4}{\"a} \DeclareUnicodeCharacter{00E5}{\aa} \DeclareUnicodeCharacter{00E6}{\ae} \DeclareUnicodeCharacter{00E7}{\cedilla{c}} \DeclareUnicodeCharacter{00E8}{\`e} \DeclareUnicodeCharacter{00E9}{\'e} \DeclareUnicodeCharacter{00EA}{\^e} \DeclareUnicodeCharacter{00EB}{\"e} \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} \DeclareUnicodeCharacter{00F0}{\dh} \DeclareUnicodeCharacter{00F1}{\~n} \DeclareUnicodeCharacter{00F2}{\`o} \DeclareUnicodeCharacter{00F3}{\'o} \DeclareUnicodeCharacter{00F4}{\^o} \DeclareUnicodeCharacter{00F5}{\~o} \DeclareUnicodeCharacter{00F6}{\"o} \DeclareUnicodeCharacter{00F8}{\o} \DeclareUnicodeCharacter{00F9}{\`u} \DeclareUnicodeCharacter{00FA}{\'u} \DeclareUnicodeCharacter{00FB}{\^u} \DeclareUnicodeCharacter{00FC}{\"u} \DeclareUnicodeCharacter{00FD}{\'y} \DeclareUnicodeCharacter{00FE}{\th} \DeclareUnicodeCharacter{00FF}{\"y} \DeclareUnicodeCharacter{0100}{\=A} \DeclareUnicodeCharacter{0101}{\=a} \DeclareUnicodeCharacter{0102}{\u{A}} \DeclareUnicodeCharacter{0103}{\u{a}} \DeclareUnicodeCharacter{0104}{\ogonek{A}} \DeclareUnicodeCharacter{0105}{\ogonek{a}} \DeclareUnicodeCharacter{0106}{\'C} \DeclareUnicodeCharacter{0107}{\'c} \DeclareUnicodeCharacter{0108}{\^C} \DeclareUnicodeCharacter{0109}{\^c} \DeclareUnicodeCharacter{0118}{\ogonek{E}} \DeclareUnicodeCharacter{0119}{\ogonek{e}} \DeclareUnicodeCharacter{010A}{\dotaccent{C}} \DeclareUnicodeCharacter{010B}{\dotaccent{c}} \DeclareUnicodeCharacter{010C}{\v{C}} \DeclareUnicodeCharacter{010D}{\v{c}} \DeclareUnicodeCharacter{010E}{\v{D}} \DeclareUnicodeCharacter{0112}{\=E} \DeclareUnicodeCharacter{0113}{\=e} \DeclareUnicodeCharacter{0114}{\u{E}} \DeclareUnicodeCharacter{0115}{\u{e}} \DeclareUnicodeCharacter{0116}{\dotaccent{E}} \DeclareUnicodeCharacter{0117}{\dotaccent{e}} \DeclareUnicodeCharacter{011A}{\v{E}} \DeclareUnicodeCharacter{011B}{\v{e}} \DeclareUnicodeCharacter{011C}{\^G} \DeclareUnicodeCharacter{011D}{\^g} \DeclareUnicodeCharacter{011E}{\u{G}} \DeclareUnicodeCharacter{011F}{\u{g}} \DeclareUnicodeCharacter{0120}{\dotaccent{G}} \DeclareUnicodeCharacter{0121}{\dotaccent{g}} \DeclareUnicodeCharacter{0124}{\^H} \DeclareUnicodeCharacter{0125}{\^h} \DeclareUnicodeCharacter{0128}{\~I} \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} \DeclareUnicodeCharacter{012A}{\=I} \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} \DeclareUnicodeCharacter{012C}{\u{I}} \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} \DeclareUnicodeCharacter{0130}{\dotaccent{I}} \DeclareUnicodeCharacter{0131}{\dotless{i}} \DeclareUnicodeCharacter{0132}{IJ} \DeclareUnicodeCharacter{0133}{ij} \DeclareUnicodeCharacter{0134}{\^J} \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} \DeclareUnicodeCharacter{0139}{\'L} \DeclareUnicodeCharacter{013A}{\'l} \DeclareUnicodeCharacter{0141}{\L} \DeclareUnicodeCharacter{0142}{\l} \DeclareUnicodeCharacter{0143}{\'N} \DeclareUnicodeCharacter{0144}{\'n} \DeclareUnicodeCharacter{0147}{\v{N}} \DeclareUnicodeCharacter{0148}{\v{n}} \DeclareUnicodeCharacter{014C}{\=O} \DeclareUnicodeCharacter{014D}{\=o} \DeclareUnicodeCharacter{014E}{\u{O}} \DeclareUnicodeCharacter{014F}{\u{o}} \DeclareUnicodeCharacter{0150}{\H{O}} \DeclareUnicodeCharacter{0151}{\H{o}} \DeclareUnicodeCharacter{0152}{\OE} \DeclareUnicodeCharacter{0153}{\oe} \DeclareUnicodeCharacter{0154}{\'R} \DeclareUnicodeCharacter{0155}{\'r} \DeclareUnicodeCharacter{0158}{\v{R}} \DeclareUnicodeCharacter{0159}{\v{r}} \DeclareUnicodeCharacter{015A}{\'S} \DeclareUnicodeCharacter{015B}{\'s} \DeclareUnicodeCharacter{015C}{\^S} \DeclareUnicodeCharacter{015D}{\^s} \DeclareUnicodeCharacter{015E}{\cedilla{S}} \DeclareUnicodeCharacter{015F}{\cedilla{s}} \DeclareUnicodeCharacter{0160}{\v{S}} \DeclareUnicodeCharacter{0161}{\v{s}} \DeclareUnicodeCharacter{0162}{\cedilla{t}} \DeclareUnicodeCharacter{0163}{\cedilla{T}} \DeclareUnicodeCharacter{0164}{\v{T}} \DeclareUnicodeCharacter{0168}{\~U} \DeclareUnicodeCharacter{0169}{\~u} \DeclareUnicodeCharacter{016A}{\=U} \DeclareUnicodeCharacter{016B}{\=u} \DeclareUnicodeCharacter{016C}{\u{U}} \DeclareUnicodeCharacter{016D}{\u{u}} \DeclareUnicodeCharacter{016E}{\ringaccent{U}} \DeclareUnicodeCharacter{016F}{\ringaccent{u}} \DeclareUnicodeCharacter{0170}{\H{U}} \DeclareUnicodeCharacter{0171}{\H{u}} \DeclareUnicodeCharacter{0174}{\^W} \DeclareUnicodeCharacter{0175}{\^w} \DeclareUnicodeCharacter{0176}{\^Y} \DeclareUnicodeCharacter{0177}{\^y} \DeclareUnicodeCharacter{0178}{\"Y} \DeclareUnicodeCharacter{0179}{\'Z} \DeclareUnicodeCharacter{017A}{\'z} \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} \DeclareUnicodeCharacter{017C}{\dotaccent{z}} \DeclareUnicodeCharacter{017D}{\v{Z}} \DeclareUnicodeCharacter{017E}{\v{z}} \DeclareUnicodeCharacter{01C4}{D\v{Z}} \DeclareUnicodeCharacter{01C5}{D\v{z}} \DeclareUnicodeCharacter{01C6}{d\v{z}} \DeclareUnicodeCharacter{01C7}{LJ} \DeclareUnicodeCharacter{01C8}{Lj} \DeclareUnicodeCharacter{01C9}{lj} \DeclareUnicodeCharacter{01CA}{NJ} \DeclareUnicodeCharacter{01CB}{Nj} \DeclareUnicodeCharacter{01CC}{nj} \DeclareUnicodeCharacter{01CD}{\v{A}} \DeclareUnicodeCharacter{01CE}{\v{a}} \DeclareUnicodeCharacter{01CF}{\v{I}} \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} \DeclareUnicodeCharacter{01D1}{\v{O}} \DeclareUnicodeCharacter{01D2}{\v{o}} \DeclareUnicodeCharacter{01D3}{\v{U}} \DeclareUnicodeCharacter{01D4}{\v{u}} \DeclareUnicodeCharacter{01E2}{\={\AE}} \DeclareUnicodeCharacter{01E3}{\={\ae}} \DeclareUnicodeCharacter{01E6}{\v{G}} \DeclareUnicodeCharacter{01E7}{\v{g}} \DeclareUnicodeCharacter{01E8}{\v{K}} \DeclareUnicodeCharacter{01E9}{\v{k}} \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} \DeclareUnicodeCharacter{01F1}{DZ} \DeclareUnicodeCharacter{01F2}{Dz} \DeclareUnicodeCharacter{01F3}{dz} \DeclareUnicodeCharacter{01F4}{\'G} \DeclareUnicodeCharacter{01F5}{\'g} \DeclareUnicodeCharacter{01F8}{\`N} \DeclareUnicodeCharacter{01F9}{\`n} \DeclareUnicodeCharacter{01FC}{\'{\AE}} \DeclareUnicodeCharacter{01FD}{\'{\ae}} \DeclareUnicodeCharacter{01FE}{\'{\O}} \DeclareUnicodeCharacter{01FF}{\'{\o}} \DeclareUnicodeCharacter{021E}{\v{H}} \DeclareUnicodeCharacter{021F}{\v{h}} \DeclareUnicodeCharacter{0226}{\dotaccent{A}} \DeclareUnicodeCharacter{0227}{\dotaccent{a}} \DeclareUnicodeCharacter{0228}{\cedilla{E}} \DeclareUnicodeCharacter{0229}{\cedilla{e}} \DeclareUnicodeCharacter{022E}{\dotaccent{O}} \DeclareUnicodeCharacter{022F}{\dotaccent{o}} \DeclareUnicodeCharacter{0232}{\=Y} \DeclareUnicodeCharacter{0233}{\=y} \DeclareUnicodeCharacter{0237}{\dotless{j}} \DeclareUnicodeCharacter{02DB}{\ogonek{ }} \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} \DeclareUnicodeCharacter{1E20}{\=G} \DeclareUnicodeCharacter{1E21}{\=g} \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} \DeclareUnicodeCharacter{1E26}{\"H} \DeclareUnicodeCharacter{1E27}{\"h} \DeclareUnicodeCharacter{1E30}{\'K} \DeclareUnicodeCharacter{1E31}{\'k} \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} \DeclareUnicodeCharacter{1E3E}{\'M} \DeclareUnicodeCharacter{1E3F}{\'m} \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} \DeclareUnicodeCharacter{1E54}{\'P} \DeclareUnicodeCharacter{1E55}{\'p} \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} \DeclareUnicodeCharacter{1E7C}{\~V} \DeclareUnicodeCharacter{1E7D}{\~v} \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} \DeclareUnicodeCharacter{1E80}{\`W} \DeclareUnicodeCharacter{1E81}{\`w} \DeclareUnicodeCharacter{1E82}{\'W} \DeclareUnicodeCharacter{1E83}{\'w} \DeclareUnicodeCharacter{1E84}{\"W} \DeclareUnicodeCharacter{1E85}{\"w} \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} \DeclareUnicodeCharacter{1E8C}{\"X} \DeclareUnicodeCharacter{1E8D}{\"x} \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} \DeclareUnicodeCharacter{1E90}{\^Z} \DeclareUnicodeCharacter{1E91}{\^z} \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} \DeclareUnicodeCharacter{1E97}{\"t} \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} \DeclareUnicodeCharacter{1EBC}{\~E} \DeclareUnicodeCharacter{1EBD}{\~e} \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} \DeclareUnicodeCharacter{1EF2}{\`Y} \DeclareUnicodeCharacter{1EF3}{\`y} \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} \DeclareUnicodeCharacter{1EF8}{\~Y} \DeclareUnicodeCharacter{1EF9}{\~y} \DeclareUnicodeCharacter{2013}{--} \DeclareUnicodeCharacter{2014}{---} \DeclareUnicodeCharacter{2018}{\quoteleft} \DeclareUnicodeCharacter{2019}{\quoteright} \DeclareUnicodeCharacter{201A}{\quotesinglbase} \DeclareUnicodeCharacter{201C}{\quotedblleft} \DeclareUnicodeCharacter{201D}{\quotedblright} \DeclareUnicodeCharacter{201E}{\quotedblbase} \DeclareUnicodeCharacter{2022}{\bullet} \DeclareUnicodeCharacter{2026}{\dots} \DeclareUnicodeCharacter{2039}{\guilsinglleft} \DeclareUnicodeCharacter{203A}{\guilsinglright} \DeclareUnicodeCharacter{20AC}{\euro} \DeclareUnicodeCharacter{2192}{\expansion} \DeclareUnicodeCharacter{21D2}{\result} \DeclareUnicodeCharacter{2212}{\minus} \DeclareUnicodeCharacter{2217}{\point} \DeclareUnicodeCharacter{2261}{\equiv} }% end of \utfeightchardefs % US-ASCII character definitions. \def\asciichardefs{% nothing need be done \relax } % Make non-ASCII characters printable again for compatibility with % existing Texinfo documents that may use them, even without declaring a % document encoding. % \setnonasciicharscatcode \other \message{formatting,} \newdimen\defaultparindent \defaultparindent = 15pt \chapheadingskip = 15pt plus 4pt minus 2pt \secheadingskip = 12pt plus 3pt minus 2pt \subsecheadingskip = 9pt plus 2pt minus 2pt % Prevent underfull vbox error messages. \vbadness = 10000 % Don't be very finicky about underfull hboxes, either. \hbadness = 6666 % Following George Bush, get rid of widows and orphans. \widowpenalty=10000 \clubpenalty=10000 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're % using an old version of TeX, don't do anything. We want the amount of % stretch added to depend on the line length, hence the dependence on % \hsize. We call this whenever the paper size is set. % \def\setemergencystretch{% \ifx\emergencystretch\thisisundefined % Allow us to assign to \emergencystretch anyway. \def\emergencystretch{\dimen0}% \else \emergencystretch = .15\hsize \fi } % Parameters in order: 1) textheight; 2) textwidth; % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; % 7) physical page height; 8) physical page width. % % We also call \setleading{\textleading}, so the caller should define % \textleading. The caller should also set \parskip. % \def\internalpagesizes#1#2#3#4#5#6#7#8{% \voffset = #3\relax \topskip = #6\relax \splittopskip = \topskip % \vsize = #1\relax \advance\vsize by \topskip \outervsize = \vsize \advance\outervsize by 2\topandbottommargin \pageheight = \vsize % \hsize = #2\relax \outerhsize = \hsize \advance\outerhsize by 0.5in \pagewidth = \hsize % \normaloffset = #4\relax \bindingoffset = #5\relax % \ifpdf \pdfpageheight #7\relax \pdfpagewidth #8\relax % if we don't reset these, they will remain at "1 true in" of % whatever layout pdftex was dumped with. \pdfhorigin = 1 true in \pdfvorigin = 1 true in \fi % \setleading{\textleading} % \parindent = \defaultparindent \setemergencystretch } % @letterpaper (the default). \def\letterpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % If page is nothing but text, make it come out even. \internalpagesizes{607.2pt}{6in}% that's 46 lines {\voffset}{.25in}% {\bindingoffset}{36pt}% {11in}{8.5in}% }} % Use @smallbook to reset parameters for 7x9.25 trim size. \def\smallbook{{\globaldefs = 1 \parskip = 2pt plus 1pt \textleading = 12pt % \internalpagesizes{7.5in}{5in}% {-.2in}{0in}% {\bindingoffset}{16pt}% {9.25in}{7in}% % \lispnarrowing = 0.3in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .5cm }} % Use @smallerbook to reset parameters for 6x9 trim size. % (Just testing, parameters still in flux.) \def\smallerbook{{\globaldefs = 1 \parskip = 1.5pt plus 1pt \textleading = 12pt % \internalpagesizes{7.4in}{4.8in}% {-.2in}{-.4in}% {0pt}{14pt}% {9in}{6in}% % \lispnarrowing = 0.25in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .4cm }} % Use @afourpaper to print on European A4 paper. \def\afourpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % Double-side printing via postscript on Laserjet 4050 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. % To change the settings for a different printer or situation, adjust % \normaloffset until the front-side and back-side texts align. Then % do the same for \bindingoffset. You can set these for testing in % your texinfo source file like this: % @tex % \global\normaloffset = -6mm % \global\bindingoffset = 10mm % @end tex \internalpagesizes{673.2pt}{160mm}% that's 51 lines {\voffset}{\hoffset}% {\bindingoffset}{44pt}% {297mm}{210mm}% % \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = 5mm }} % Use @afivepaper to print on European A5 paper. % From romildo@urano.iceb.ufop.br, 2 July 2000. % He also recommends making @example and @lisp be small. \def\afivepaper{{\globaldefs = 1 \parskip = 2pt plus 1pt minus 0.1pt \textleading = 12.5pt % \internalpagesizes{160mm}{120mm}% {\voffset}{\hoffset}% {\bindingoffset}{8pt}% {210mm}{148mm}% % \lispnarrowing = 0.2in \tolerance = 800 \hfuzz = 1.2pt \contentsrightmargin = 0pt \defbodyindent = 2mm \tableindent = 12mm }} % A specific text layout, 24x15cm overall, intended for A4 paper. \def\afourlatex{{\globaldefs = 1 \afourpaper \internalpagesizes{237mm}{150mm}% {\voffset}{4.6mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% % % Must explicitly reset to 0 because we call \afourpaper. \globaldefs = 0 }} % Use @afourwide to print on A4 paper in landscape format. \def\afourwide{{\globaldefs = 1 \afourpaper \internalpagesizes{241mm}{165mm}% {\voffset}{-2.95mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% \globaldefs = 0 }} % @pagesizes TEXTHEIGHT[,TEXTWIDTH] % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. % \parseargdef\pagesizes{\pagesizesyyy #1,,\finish} \def\pagesizesyyy#1,#2,#3\finish{{% \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi \globaldefs = 1 % \parskip = 3pt plus 2pt minus 1pt \setleading{\textleading}% % \dimen0 = #1\relax \advance\dimen0 by \voffset % \dimen2 = \hsize \advance\dimen2 by \normaloffset % \internalpagesizes{#1}{\hsize}% {\voffset}{\normaloffset}% {\bindingoffset}{44pt}% {\dimen0}{\dimen2}% }} % Set default to letter. % \letterpaper \message{and turning on texinfo input format.} \def^^L{\par} % remove \outer, so ^L can appear in an @comment % DEL is a comment character, in case @c does not suffice. \catcode`\^^? = 14 % Define macros to output various characters with catcode for normal text. \catcode`\"=\other \def\normaldoublequote{"} \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix \catcode`\+=\other \def\normalplus{+} \catcode`\<=\other \def\normalless{<} \catcode`\>=\other \def\normalgreater{>} \catcode`\^=\other \def\normalcaret{^} \catcode`\_=\other \def\normalunderscore{_} \catcode`\|=\other \def\normalverticalbar{|} \catcode`\~=\other \def\normaltilde{~} % This macro is used to make a character print one way in \tt % (where it can probably be output as-is), and another way in other fonts, % where something hairier probably needs to be done. % % #1 is what to print if we are indeed using \tt; #2 is what to print % otherwise. Since all the Computer Modern typewriter fonts have zero % interword stretch (and shrink), and it is reasonable to expect all % typewriter fonts to have this, we can check that font parameter. % \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} % Same as above, but check for italic font. Actually this also catches % non-italic slanted fonts since it is impossible to distinguish them from % italic fonts. But since this is only used by $ and it uses \sl anyway % this is not a problem. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} % Turn off all special characters except @ % (and those which the user can use as if they were ordinary). % Most of these we simply print from the \tt font, but for some, we can % use math or other variants that look better in normal text. \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote \catcode`\~=\active \def~{{\tt\char126}} \chardef\hat=`\^ \catcode`\^=\active \def^{{\tt \hat}} \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} \let\realunder=_ % Subroutine for the previous macro. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } \catcode`\|=\active \def|{{\tt\char124}} \chardef \less=`\< \catcode`\<=\active \def<{{\tt \less}} \chardef \gtr=`\> \catcode`\>=\active \def>{{\tt \gtr}} \catcode`\+=\active \def+{{\tt \char 43}} \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. % So turn them off again, and have \everyjob (or @setfilename) turn them on. % \otherifyactive is called near the end of this file. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other} % Used sometimes to turn off (effectively) the active characters even after % parsing them. \def\turnoffactive{% \normalturnoffactive \otherbackslash } \catcode`\@=0 % \backslashcurfont outputs one backslash character in current font, % as in \char`\\. \global\chardef\backslashcurfont=`\\ \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work % \realbackslash is an actual character `\' with catcode other, and % \doublebackslash is two of them (for the pdf outlines). {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} % In texinfo, backslash is an active character; it prints the backslash % in fixed width font. \catcode`\\=\active % @ for escape char from now on. % The story here is that in math mode, the \char of \backslashcurfont % ends up printing the roman \ from the math symbol font (because \char % in math mode uses the \mathcode, and plain.tex sets % \mathcode`\\="026E). It seems better for @backslashchar{} to always % print a typewriter backslash, hence we use an explicit \mathchar, % which is the decimal equivalent of "715c (class 7, e.g., use \fam; % ignored family value; char position "5C). We can't use " for the % usual hex value because it has already been made active. @def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} @let@backslashchar = @normalbackslash % @backslashchar{} is for user documents. % On startup, @fixbackslash assigns: % @let \ = @normalbackslash % \rawbackslash defines an active \ to do \backslashcurfont. % \otherbackslash defines an active \ to be a literal `\' character with % catcode other. We switch back and forth between these. @gdef@rawbackslash{@let\=@backslashcurfont} @gdef@otherbackslash{@let\=@realbackslash} % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of % the literal character `\'. Also revert - to its normal character, in % case the active - from code has slipped in. % {@catcode`- = @active @gdef@normalturnoffactive{% @let-=@normaldash @let"=@normaldoublequote @let$=@normaldollar %$ font-lock fix @let+=@normalplus @let<=@normalless @let>=@normalgreater @let\=@normalbackslash @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let~=@normaltilde @markupsetuplqdefault @markupsetuprqdefault @unsepspaces } } % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. @otherifyactive % If a .fmt file is being used, we don't want the `\input texinfo' to show up. % That is what \eatinput is for; after that, the `\' should revert to printing % a backslash. % @gdef@eatinput input texinfo{@fixbackslash} @global@let\ = @eatinput % On the other hand, perhaps the file did not have a `\input texinfo'. Then % the first `\' in the file would cause an error. This macro tries to fix % that, assuming it is called before the first `\' could plausibly occur. % Also turn back on active characters that might appear in the input % file name, in case not using a pre-dumped format. % @gdef@fixbackslash{% @ifx\@eatinput @let\ = @normalbackslash @fi @catcode`+=@active @catcode`@_=@active } % Say @foo, not \foo, in error messages. @escapechar = `@@ % These (along with & and #) are made active for url-breaking, so need % active definitions as the normal characters. @def@normaldot{.} @def@normalquest{?} @def@normalslash{/} % These look ok in all fonts, so just make them not special. % @hashchar{} gets its own user-level command, because of #line. @catcode`@& = @other @def@normalamp{&} @catcode`@# = @other @def@normalhash{#} @catcode`@% = @other @def@normalpercent{%} @let @hashchar = @normalhash @c Finally, make ` and ' active, so that txicodequoteundirected and @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we @c don't make ` and ' active, @code will not get them as active chars. @c Do this last of all since we use ` in the previous @catcode assignments. @catcode`@'=@active @catcode`@`=@active @markupsetuplqdefault @markupsetuprqdefault @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) @c page-delimiter: "^\\\\message" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" @c End: @c vim:sw=2: @ignore arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 @end ignore gnushogi-1.5pre/doc/gnushogi.texi0000644000175000017500000017670712363546414014147 00000000000000\input texinfo @c -*-texinfo-*- @c % ** Start of header. @setfilename gnushogi.info @settitle GNU Shogi manual @c % ** End of header. @dircategory Games @direntry * gnushogi: (gnushogi). Japanese chess @end direntry @setchapternewpage odd @c ================================== @c TeX-specific macros @c ================================== @c None yet! @c ================================== @c info-specific macros @c ================================== @c None yet! @c ================================== @c Summary description and copyright. @c ================================== @ifinfo This file describes how to use GNU shogi, a program which plays Shogi (Japanese chess). Copyright (C) 2013 Yann Dirson and the Free Software Foundation, Inc. Copyright (C) 1999 Michael C. Vanier and the Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. @ignore Permission is granted to process this file through TeX and print the results, provided the printed document carries copying permission notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end ifinfo @c ========================================= @c End of summary description and copyright. @c ========================================= @c ==================== @c Title and copyright. @c ==================== @titlepage @sp 10 @comment The title is printed in a large font. @center @titlefont{GNU Shogi (Japanese chess)} @author Mike Vanier @c The following two commands start the copyright page. @page @vskip 0pt plus 1filll Copyright @copyright{} 2013-2014 Yann Dirson and the Free Software Foundation Copyright @copyright{} 1999 Michael C. Vanier and the Free Software Foundation @end titlepage @c =========================== @c End of title and copyright. @c =========================== @c ========================= @c Top node and master menu. @c ========================= @node Top, (dir), (dir), (dir) @top GNU Shogi (Japanese chess) @ifnottex @menu * Introduction:: What is GNU shogi? * About shogi:: General information, rules, etc. * gnushogi:: How to play GNU shogi (gnushogi). * References and links:: Where to go for more information. * Acknowledgements:: * Bugs:: Where and how to report bugs. * Index:: @end menu @end ifnottex @iftex This document describes GNU shogi, a program which plays Japanese chess (shogi) against a human opponent. @end iftex @c ================================ @c End of top node and master menu. @c ================================ @c ===== @c Body. @c ===== @node Introduction, About shogi, Top, Top @chapter Introduction @cindex Introduction GNU shogi is a program that plays shogi, the Japanese version of chess, against a human (or computer) opponent. This file describes how to use GNU shogi and also gives background information about the game of shogi. In 1994, GNU Shogi 1.2p02, then developed by Matthias Mutz, played in the 5th Computer Shogi Championship, and finished 17th out of 22 opponents. This file describes GNU Shogi version 1.4.1, but most of it was written for version 1.3.2 by Mike Vanier @email{mvanier@@cs.caltech.edu}, maintainer of GNU shogi at that time. GNU Shogi is currently maintained by Yann Dirson @email{ydirson@@free.fr}. GNU Shogi is actually one program, 'gnushogi', the text-based program which also contains the game-playing engine. By default it will play Standard Shogi, but can be built to play Mini Shogi (with GNU Shogi 1.4.x, you will need to do that explicitely using `./configure --enable-minishogi', but 1.5 will make this more straightforward). Most players will just run GNU Shogi through one of the compatible graphical interfaces: @enumerate @item @uref{http://www.gnu.org/software/xboard/, XBoard/Winboard}, a GUI for much more than Shogi, part of the GNU Project. While XBoard has been supporting Shogi for a long time, current version only makes it easy to use a Chessified western-looking set of pieces; upcoming version XBoard 4.8 will allow easy usage of traditional japanese pieces. Supported by GNU Shogi since version 1.5.0 only: 1.4.x and earlier versions cannot talk to it. @item @uref{http://repo.or.cz/w/tagua/yd.git, Tagua}, a KDE-based GUI for Chess and Shogi. Developement stopped several years ago, and it is still somewhat maintained at Debian. Probably the most sophisticated and best-looking free GUI available today. @item @uref{https://alioth.debian.org/projects/omaha/, Omaha}, a generic board-game GUI, supporting Shogi and other games, with currently only a Gtk2-based UI. Still under developement, but already usable for casual games. @item @uref{https://github.com/pcapriotti/kaya, Kaya}, a small KDE-based GUI successor to Tagua, but development of this still young program seem to have stalled. @item @uref{http://ftp.gnu.org/gnu/gnushogi/, XShogi}, an X Window graphical interface to gnushogi, forked off GNU XBoard years ago, and far from today's UI standards. It has barely been maintained recently, while XBoard has grown much and is able to play Shogi; XShogi is now deprecated and will soon be retired. The GNU Shogi distribution used to contain the 'xshogi' program, In future versions, GNU Shogi will be able to use XBoard as a GUI and XShogi will be retired, replaced by XBoard. XShogi is still available as a separate source archive on the GNU project FTP server. @end enumerate Disclaimer: I use the personal pronouns ``him'', ``his'' etc. to refer to a shogi player regardless of gender. That's easier than writing ``his or her'' all over the place. I don't mean to infer that women don't play shogi; in fact shogi is very popular in Japan among women as well as men. @node About shogi, gnushogi, Introduction, Top @chapter About the game of shogi @quotation ``Japanese chess cedes nothing in depth or beauty to the European game... it is at least as interesting.'' --- Alexander Alekhine @* (quoted in David Pritchard, @cite{The Encyclopedia of Chess Variants}) ``... shogi [is] by far the most complex form of chess that has ever achieved widespread popularity.'' --- R. Wayne Schmittberger, @cite{New Rules for Classic Games} @end quotation Shogi is the version of chess played in Japan. It is strikingly different from standard chess (which I shall refer to henceforth as ``international chess'') and also to all other regional variants, because captured pieces can re-enter play on the side of the capturer. This has several interesting effects on the play of the game: @enumerate @item Shogi is much more complex than international chess, at least in terms of the average number of possible moves per turn (estimated at about 35 for chess and at about 80 for shogi). @item There are almost no draws (about 1-2% of all games in professional play). @item Exchanges complicate the play rather than simplifying it. @item There are no ``endgames'' in the standard chess sense; all pieces remain in play throughout the game. Games typically end in a race to checkmate the other player before being checkmated oneself. @item Ownership of a piece is not indicated by the color of the piece; instead, pieces are wedge-shaped and point towards the opponent. The name of the piece is inscribed in Kanji characters on the front of the piece. @item Most importantly: it's more fun than other forms of chess :-) @end enumerate Shogi is extremely popular in Japan; it has been estimated that 20 million Japanese can play shogi, of which perhaps 1 million are active players. It is even more popular there than the game of go, Japan's other favorite board game. There are a number of professional players who make a considerable amount of money playing in shogi tournaments, and the game receives extensive newpaper and television coverage. Despite this, the game has yet to become popular outside of Japan. Part of this is because the Kanji characters on the pieces scare away some people, but mostly it's due, I think, to lack of exposure to the game and to the difficulty of finding opponents. I hope that GNU shogi will help introduce shogi to a wider audience. @ifnottex @menu * The rules of shogi:: * Sample game:: * Mating problems:: * Shogi variants:: * Differences between shogi and chess:: @end menu @end ifnottex @c ------------------------------------------------------- @c @c The rules of shogi. @c @c ------------------------------------------------------- @node The rules of shogi, Sample game, About shogi, About shogi @section The rules of shogi @cindex Rules Shogi is a two-person abstract strategy board game with full information (i.e. all pieces and moves are visible to both players at all times). It is in the chess family, being descended from the same ancestral game as international chess: the Indian game of Chaturanga. The two players are referred to as ``Black'' and ``White'', with Black moving first (unlike in international chess, where White moves first), and with movement alternating between the two players. Note that ``Black'' and ``White'' are just names; the pieces are not colored. Instead, they are flat, wedge-shaped pieces which point towards the opponent. The identity of a given piece is indicated by two Japanese Kanji characters on each piece. In fact, only the top character is needed to identify the piece and thus only the top character is used in shogi diagrams. I will use alphabetical equivalents in the diagrams here; to see what the Kanji characters look like, start up a graphical interface (@pxref{Introduction}) and compare the starting setup there with the starting setup in this file (@pxref{The opening setup}). The object of the game is to capture the opponent's King. The board is a grid of 9x9 uncolored squares, and pieces are placed on the squares. Each player begins with 20 pieces, described in the next section. Capture is by displacement, as in international chess. @ifnottex @menu * The moves of the pieces:: * The opening setup:: * Promotion of pieces:: * Drops:: * Winning the game:: * Draws:: * Handicaps:: * Notes for chess players:: @end menu @end ifnottex @c The moves of the pieces. @node The moves of the pieces, The opening setup, The rules of shogi, The rules of shogi @subsection The moves of the pieces @cindex Piece moves Each player at the beginning of a shogi game has a total of 20 pieces of eight different types. The moves of the shogi pieces can be divided into three classes: ``stepping'' pieces, that only move one square at a time; ``ranging'' pieces that move any number of unobstructed squares in a line, and ``jumping'' pieces that can jump over obstructing pieces to reach their destination squares. Most pieces can also promote to different (usually stronger) pieces under certain circumstances (see the next section). All pieces capture the same way that they move (even pawns). The piece moves and promotions are as follows; each piece name is followed by the standard piece abbreviation: @enumerate @item The king (K). The king can move one square in any horizontal, vertical, or diagonal direction, just like the king in international chess. The king does not promote. @item The rook (R). The rook can move any number of squares in a horizontal or vertical direction. The rook is the same as the rook in international chess (except that it can promote). A rook promotes to a ``dragon king'' or ``dragon'' for short (often just referred to as a ``promoted rook''), which can move as a rook or can move one square in any diagonal direction. @item The bishop (B). The bishop can move any number of squares in a diagonal direction. The bishop is the same as the bishop in international chess (except that it can promote). A bishop promotes to a ``dragon horse'' or ``horse'' for short (often just referred to as a ``promoted bishop''), which can move as a bishop or can move one square in any horizontal or vertical direction. Note: the horse should not be confused with a knight (see below), as they are two completely different pieces. @item The gold general (G). A gold general can move one square in any horizontal or vertical direction, or one square in a forward diagonal direction. Gold generals do not promote. @item The silver general (S). A silver general can move one square in any diagonal direction, or one square straight forward. A silver general promotes to a gold general. @item The knight (N). A knight can move one square straight forward followed by one square to either forward diagonal, jumping over intervening pieces if any. In other words, a knight moves like its international chess counterpart, but forward only. A knight promotes to a gold general. The knight is the only jumping piece, as in chess. @item The lance (L). A lance can move any number of squares straight forward. A lance promotes to a gold general. @item The pawn (P). A pawn can move one square straight forward. The pawn captures the same way that it moves, in contrast to international chess. There is also no initial two-space move for pawns and no @emph{en-passant} capture. A pawn promotes to a gold general; a promoted pawn is usually known as a ``Tokin''. @end enumerate @c The opening setup. @node The opening setup, Promotion of pieces, The moves of the pieces, The rules of shogi @subsection The opening setup @cindex Opening setup The opening setup for shogi is as follows: @ifnottex @verbatim 9 8 7 6 5 4 3 2 1 +--------------------------------------------+ | wL | wN | wS | wG | wK | wG | wS | wN | wL | a +--------------------------------------------+ | | wR | | | | | | wB | | b +--------------------------------------------+ | wP | wP | wP | wP | wP | wP | wP | wP | wP | c +--------------------------------------------+ | | | | | | | | | | d +--------------------------------------------+ | | | | | | | | | | e +--------------------------------------------+ | | | | | | | | | | f +--------------------------------------------+ | bP | bP | bP | bP | bP | bP | bP | bP | bP | g +--------------------------------------------+ | | bB | | | | | | bR | | h +--------------------------------------------+ | bL | bN | bS | bG | bK | bG | bS | bN | bL | i +--------------------------------------------+ @end verbatim @end ifnottex @c The following TeX macros are taken with permission from @c "TeX for the Beginner" by Wynter Snow. @tex \def\startline{\par\nobreak\noindent} {\obeylines\obeyspaces% \gdef\beginVerbatim{\bigbreak% \begingroup% \parskip=0pt% \obeylines\obeyspaces% \let^^M=\startline% \tt}} \gdef\endVerbatim{\endgroup\bigbreak} \beginVerbatim 9 8 7 6 5 4 3 2 1 +--------------------------------------------+ | wL | wN | wS | wG | wK | wG | wS | wN | wL | a +--------------------------------------------+ | | wR | | | | | | wB | | b +--------------------------------------------+ | wP | wP | wP | wP | wP | wP | wP | wP | wP | c +--------------------------------------------+ | | | | | | | | | | d +--------------------------------------------+ | | | | | | | | | | e +--------------------------------------------+ | | | | | | | | | | f +--------------------------------------------+ | bP | bP | bP | bP | bP | bP | bP | bP | bP | g +--------------------------------------------+ | | bB | | | | | | bR | | h +--------------------------------------------+ | bL | bN | bS | bG | bK | bG | bS | bN | bL | i +--------------------------------------------+ \endVerbatim @end tex Here, ``b'' stands for ``black'' and ``w'' stands for ``white'', so that, for instance, ``bL'' means ``black lance''. The numbers above the files and the letters to the right of the ranks represent the most common notation system used for shogi by westerners (the Japanese also use Arabic numerals for the files but use Japanese numerals for the ranks). @c Promotion of pieces. @node Promotion of pieces, Drops, The opening setup, The rules of shogi @subsection Promotion of pieces @cindex Piece promotion In sharp contrast to international chess, where only pawns can promote to higher-ranked pieces, most of the pieces in shogi can promote. The promoted ranks are discussed in the section on piece moves (@pxref{The moves of the pieces}) but are repeated here for reference: @table @asis @item Pawn promotes to gold general (called a `tokin' in this case only). @item Lance promotes to gold general. @item Knight promotes to gold general. @item Silver general promotes to gold general. @item Gold general does not promote. @item Bishop promotes to ``dragon horse'' or just ``horse'' for short. The horse can move as a bishop or can move one square in any orthogonal direction. @item Rook promotes to ``dragon king'' or just ``dragon'' for short. The dragon can move as a rook or can move one square in any diagonal direction. @item King does not promote. @end table The three ranks furthest away from each player constitute his/her ``promotion zone''. A player may, but is not required to, promote a piece after making a move in which the piece begins and/or ends in the promotion zone. Thus you can promote a piece when moving the piece into the promotion zone, out of the promotion zone, or entirely within the promotion zone. Promotion is mandatory in these cases: @enumerate @item You must promote a pawn or a lance after moving it to the last rank. @item You must promote a knight after moving it to either of the last two ranks. @end enumerate These forced promotions ensure that a piece cannot be moved to a square from which it would have no further move. Pieces ``dropped'' onto the board (@pxref{Drops}) always drop in the unpromoted state, even if they drop into the promotion zone. @c Drops. @node Drops, Winning the game, Promotion of pieces, The rules of shogi @subsection Drops @cindex Drops When a player captures a piece, that piece is not removed from play. Instead, it becomes the property of the capturer and can re-enter play by being placed on (almost) any vacant square during the player's move. This is known as a ``drop'' and counts as a full move (in other words, you can either move a piece on the board or drop a piece onto the board during your move, but not both). All pieces drop in the unpromoted state. Pieces may be legally dropped in their promotion zone, but they do not promote on that turn. There are several restrictions on drops: @enumerate @item A pawn may not be dropped onto a file if there is already an unpromoted pawn belonging to the same player on that file. It is legal to drop a pawn on a file which contains a @emph{promoted} pawn belonging to the same player, however. @item A pawn may not be dropped to give immediate checkmate on the move. A pawn is, however, permitted to be moved on the board to give immediate checkmate. This is a curious rule, and if anyone knows the reason for it I would appreciate it if they would contact me and explain it to me :-) @item A pawn or piece may not be dropped onto a square from which they would have no legal move. This means that pawns and lances may not be dropped onto the last rank, and the knight may not be dropped onto the last or second-to-last rank. @end enumerate It is entirely permissible (and often advisable) to drop a piece or pawn between one's King and an attacking ranging piece. For this reason, the final checkmating move is nearly always an attack on the King from an adjacent square (except for an attack by a Knight). Captured pieces are said to be pieces ``in hand''. The drop is the primary distinguishing feature of Japanese chess, shared with no other popular chess-type game. It gives shogi a very aggressive quality, and dramatically increases the number of possible moves once a few pieces have been captured. Another interesting feature of shogi is that exchanges complicate play rather than simplifying it (as in international chess), because of the drop rule. @c Winning. @node Winning the game, Draws, Drops, The rules of shogi @subsection Winning the game @cindex Winning the game A game of shogi is won by capturing the opponent's king. In general, this is done by checkmating the king: attacking the king in such a way that the king cannot be defended no matter what the defending player moves. Note, though, that there is no rule that requires a player to defend a king which is being attacked. However, if he does not defend his king, the opponent is entirely free to capture it on the next move, thus winning the game. As in international chess, in practice most games end by resignation when one player realizes that he cannot escape checkmate. @c Draws. @node Draws, Handicaps, Winning the game, The rules of shogi @subsection Draws @cindex Draws There are very few draws in shogi; only about 1-2% of professional games end in a draw. One reason for this is that material can never be depleted as in chess, because captured pieces are constantly re-entering play as a consequence of the drop rule. In fact, most of the ways a game can be drawn in chess are not allowed in shogi: @itemize @bullet @item Draws cannot be offered. @item There is no fifty-move rule. @item A stalemate counts as a win for the stalemater. Stated otherwise: if you can't move, you lose. @item Perpetual check is illegal (see below). @end itemize There are only two legal ways in which a draw can occur: @enumerate @item A position (including the pieces in hand) occurs 4 times with the same player to move (called ``Sennichite''). However, if this is caused by consecutive checks (direct attacks on the King, threatening to capture it on the next move) by one side, the player giving these checks loses the game. In other words, perpetual check results in a loss for the attacker who recreates the same position the 4th time. @item Both players have moved their King into the the promotion zone (or they cannot be prevented from doing so) and the Kings cannot be checkmated. A King who has entered the promotion zone is known as an ``entering King''; due to the forward orientation of most shogi pieces, it is very hard to mate such a King. In that case the players may decide to count their pieces as follows: the King does not count, the Rook and Bishop count as 5 points, and all other pieces as one point. Promotion is disregarded. If both players have at least 24 points the game is a draw (called ``Jishogi''). If a player has less, he loses the game. Of course, a player can refuse to count pieces when he still has mating chances or chances to gain material which would affect the outcome of the counting. There is no strict rule about what to do if this is not the case, but nonetheless a player refuses to count up (e.g. because he does not have enough points for a draw). It has been generally accepted that in such a case the game ends and the pieces are counted after one player has managed to get all his pieces protected in the promotion zone. @end enumerate @c Handicaps. @node Handicaps, Notes for chess players, Draws, The rules of shogi @subsection Handicaps @cindex Handicaps Unlike international chess, shogi has a well-established handicap system which is used when players of different strengths play against each other. Handicaps range from small to huge, which makes it possible for weak players to play against even very strong players and have an even chance of winning. Shogi players are ranked as follows: the weakest rank is around 15 ``kyu'', which represents a beginner. 14 kyu is higher than 15 kyu, 13 kyu is higher still, and so on until you get to 1 kyu. The next highest rank is 1 ``dan'', followed by 2 dan, 3 dan and so forth. The highest amateur rank is 6 dan; professionals go up to 9 dan. However, professional ranks are not the same as amateur ranks; a professional 1 dan is @emph{much} stronger than an amateur 1 dan. This system is similar to that used by go players (and also other Japanese sports such as karate). A handicap consists of the stronger player playing White and removing one or more pieces from his side of the board at the start of the game. These pieces are permanently removed from play; they are not in hand. The following is a list of the accepted handicaps, from weakest to strongest. The degree of the handicap, represented by the position in the list, represents the difference in rank between the two players for which the handicap is appropriate. These rules are taken from the books ``Shogi for Beginners'' by John Fairbairn and ``The Art of Shogi'' by Tony Hoskings (@pxref{References and links}) and, I believe, represent current Japanese practice. @enumerate @item The stronger player removes his left lance (on 1a). @item The players play a two-game match; in the first game the stronger player removes his left lance (on 1a), while in the second game he removes his bishop. @item The stronger player removes his bishop. @item The stronger player removes his rook. @item The stronger player removes his rook and left lance. @item The players play a two-game match; in the first game the stronger player removes his rook and left lance (on 1a), while in the second game he removes his rook and bishop. @item The stronger player removes his rook and bishop. This is usually called a ``two-piece'' handicap. @item The stronger player removes his rook, bishop, and both lances. This is called a ``four-piece'' handicap. @item The stronger player removes his rook, bishop, both lances, and both knights. This is called a ``six-piece'' handicap. @item The stronger player removes his rook, bishop, both lances, both knights, and both silvers. This is called an ``eight-piece'' handicap. @end enumerate Another advantage of playing handicap games is that the handicaps alter the optimal strategy for both players. For instance, handicaps all have their own opening lines which may bear little or no resemblance to those used in non-handicap shogi. This means that when learning handicap shogi, you are essentially learning completely new games which use the same equipment! The reader may wonder how on earth a player giving an eight-piece handicap, say, could possibly hope to win. Don't forget, though, that in shogi the opponent's pieces can be captured and then become part of one's own army. Thus, if the opponent plays badly enough, the number of pieces will soon even out. @c Notes for chess players. @node Notes for chess players, , Handicaps, The rules of shogi @subsection Notes for chess players Here are a few miscellaneous things that may confuse chess players. Some of these have been mentioned elsewhere, but they bear repeating. @enumerate @item There is no queen. @item Pawns capture the same way they move. There is no initial two-space pawn move and no @emph{en-passant} move. @item There is no special castling move. There @emph{are} a large number of possible defensive formations referred to as ``castles'' (@pxref{Sample game}) but there is no need for special moves to create them. @item A given piece can only promote to @emph{one} other kind of piece. @end enumerate @c @c Sample game. @c @node Sample game, Mating problems, The rules of shogi, About shogi @section Sample game @cindex Sample game @c This will have to be spruced up for the TeX version... This game was annotated by Pieter Stouten (@pxref{References and links}). I have made some minor corrections. Note that captures are denoted by the ``x'' symbol e.g. Rx3f and drops are denoted by the ``*'' symbol e.g. R*3f. Check is indicated by a ``+'' after the move, e.g. R3f+. I recommend you use a graphical interface to play along with this game. In XBoard or XShogi simply hit the ``Force Moves'' button after starting up, while in gnushogi enter the word ``force'' at the prompt. This will allow you to enter moves for both sides. Note also that the move numbering system used here is the chess-type system where one move means one move by each player. The Japanese count one move made by each player as two moves. --------------------------------------------------------------------------- Below you will find (the English translation of) an annotated game which was published in the Dutch Shogi magazine ``81'' and in the Dutch beginners booklet. It has proven to be a very useful game to explain some basic principles of Shogi. Also, it is a rather straightforward game compared to professional games where in most cases very diffuse middle game fights take place. Pieter Stouten, 14th May 1990. --------------------------------------------------------------------------- Black: Michael Trent (1-dan). White: David Murphy (2-dan). 1. P2f P3d 2. P2e B3c @* [ This move is necessary, as otherwise white can exchange pawns: 3. P2d Px2d 4. Rx2d. He would thus get a pawn in hand and open up his rook file. ] 3. P7f P4d @* [ White closes the bishop diagonal again. He plans to play ranging rook (the rook goes to 5b, 4b, 3 or 2b; a defensive strategy) and in that case he'd better avoid an exchange of bishops. One of the reasons is that he will have problems developing his pieces without leaving holes for bishop drops. ] 4. S4h R3b 5. P3f S4b 6. K6h K6b @* [ In general the rook plays an important role in the attacks. It is wise to move the king away from the area where the initial fights will be and both players act according to the Shogi proverb ``keep the rook and king apart''. ] 7. K7h K7b 8. P5f P5d 9. G4i-5h G4a-5b @* [ Both players use their second gold general to build their castle. ] 10. S6h @* [ In itself this move is not bad. However, it will become clear that black plans a quick attack and in that case it is wiser to omit this move. ] 10... S5c 11. P1f P1d @* [ The advance of the edge pawns must be timed very well. The remark at black's tenth move applies here too: this move is good if black wants to play a slow game, because it eliminates a future B1e. ] 12. P4f K8b 13. N3g S7b @* [ Black develops his knight in order to start an attack over the second, third and fourth files. White strengthens his king's position and awaits the attack. He aims at a counterattack as soon as black has broken through into the white camp. Probably white's breakthrough will take place later, but he has good compensation in the form of a stronger castle. This theme occurs very often in static rook versus ranging rook games. ] 14. P4e R4b @* [ Black starts his attack and white puts up a very passive defence. His rook has a hard task now to penetrate the black position. Moreover, he blocks his own bishop. It seems much better to start a counterattack with 14... P3e, later to be followed by B2b, B5a or Bx4d in order to use his rook more actively. ] 15. Px4d Sx4d 16. P*4e S5c @* [ 16... Sx4e is more active. A silver general is normally more valuable than a knight, but white gets two pawns in hand and black none, while the knight might come in handy for white too. ] 17. Bx3c+ Nx3c 18. P2d Px2d @* [ Black threatens to break through and white has to consider taking the pawn on 2d or starting a counterattack with Nx4e. If he chooses the latter, black can play Px2c+ followed by +P3c. The disadvantage is the black ``tokin'' (=promoted pawn) that white will get in his camp; the advantage is that it will cost black two more moves to promote his rook. Because white did not trust that the result after engaging in a ``semeai'' (=mutual attack) with 18...Nx4e would give a positive result, he captured the pawn on 2d. Making the right decision in moments like this often makes the difference between a win and a loss: miss one attacking chance and you will be forced to defend the whole game until the unavoidable defeat; on the other hand, an unsound attack can destroy all ``aji'' (=potential, meaning possibilities, threats) without getting anything in return. ] 19. Rx2d Nx4e 20. Nx4e Rx4e 21. R2a+ P*4g @* [ Now it becomes clear why black's 10. S6h was not good. Had this move been omitted, then white would not have had the time to play 13... S7b and after R2a+ the gold on 6a would hang. Thus black would have kept ``sente'' (=initiative). Instead of 21... P*4g, B*6d is a very good move, because after 22. P*2h black does not have a pawn in hand anymore and he is being threatened with the annoying 22... N*4f 23. G5g N3h+ 24. S4g +N4h also. Black can also counter 21... B*6d with 22. N*3g. White would then reply with 22... R4b 23. B*3c P*4g 24. Bx4b+ Sx4b. The white rook has played its role and instead of spending moves on saving it white starts to scatter black's defences by successive pawn drops on the fourth file: 25. Gx4g P*4f 26. G5g N*6e 27. G5h P4g+ 28. Gx4g P*4f. This analysis was provided by Kato Hifumi, 9-dan professional (the highest regular grade). Destroying the coherence of the enemy pieces (their shape) by dropping pawns is one of the most important Shogi techniques. With the actual move 21... P*4g white missed a good chance. ] 22. Sx4g P*4f 23. B*3g Px4g+ 24. +Rx6a +Px3g @* [ 23. B*3g seems pointless, but a closer look reveals that it is actually quite mean. On move 24 white cannot capture black's ``Ryu'' (=dragon =promoted rook) with his silver: 24... Sx6a 25. N*7d K7b 26. G*8b mate. By attacking the front of the white castle and threatening to mate him there, black has the chance to break down the white defences from the side. ] 25. +Rx5b S*6b @* [ Here 25... B*4d would be much better, because it is defensive and attacking at the same time. After e.g. 26. G*4c Bx9i+ 27. Gx5c black threatens 28. +Rx7b Kx7b 29. S*6a K8b 30. S*7a Kx7a 31. G*7b mate. White is one move quicker, however. He has the following beautiful ``tsume'' (mating sequence where every move is check): 27... N*8f 28. Px8f S*8g 29. Kx8g B*9h 30. K7h Bx8i+ 31. K8g +B8i-8h 32. K9f L*9e mate. This illustrates the sharpness of Shogi: one move can make the difference between winning and losing. ] 26. P*4f Rx4f @* [ This move eliminates white's last chances. 26... R4b 27. +Rx4b Sx4b 28. R*4a seems annoying, but after 28... B*3c 29. S7g B*3b white wins the rook and with his ``tokin'' on 3g there still is some hope. ] 27. N*6e +P4g @* [ White cannot defend anymore, so he starts a desperate attack. Black does not lose the right track, however. ] 28. Nx5c+ +Px5h 29. +Nx6b +Px6h 30. Gx6h N*8f 31. Px8f B*6i 32. Gx6i R4h+ 33. N*6h +Rx6h 34. Gx6h S*8g 35. Kx8g N*9e 36. K7h Resigns @* [ White resigns here, because after 36... B*8g 27. K7g his attack has petered out. ] @page @c @c Mating problems. @c @node Mating problems, Shogi variants, Sample game, About shogi @section Mating problems One good way to improve at shogi is to solve mating problems. There are several types of these problems, but the most common is called a ``tsume-shogi'' problem, or ``tsume'' problem for short. In a tsume problem, all pieces that are not on the board are assumed to be in the opponent's hand (except for your King, which is usually not shown). Every move you make must be check until the final checkmate. Your opponent may play any piece on the board or drop any of his pieces in hand in order to prevent the mate. In a properly constructed tsume problem, all of your pieces on the board and in hand must be essential to the solution. One consequence of this is that all of your pieces in hand must be played during the solution. There should only be one correct solution for the given number of moves. Tsume problems use Japanese-style move numbering; thus, a problem where you move (and give check), your opponent moves, and you move to give checkmate is called a three-mover. Here is a really trivial three-mover: @ifnottex @verbatim 3 2 1 ----------------+ | | | | a ----------------+ | | | wK | b ----------------+ | | | | c ----------------+ | bN | | | d ----------------+ | | | | e ----------------+ | | bN | | f ----------------+ Black in hand: S, G @end verbatim @end ifnottex @tex \def\startline{\par\nobreak\noindent} {\obeylines\obeyspaces% \gdef\beginVerbatim{\bigbreak% \begingroup% \parskip=0pt% \obeylines\obeyspaces% \let^^M=\startline% \tt}} \gdef\endVerbatim{\endgroup\bigbreak} \beginVerbatim 3 2 1 ----------------+ | | | | a ----------------+ | | | wK | b ----------------+ | | | | c ----------------+ | bN | | | d ----------------+ | | | | e ----------------+ | | bN | | f ----------------+ Black in hand: 2G \endVerbatim @end tex Here, Black plays G*2b, White plays K1c, and Black plays G*1d mate. More typical tsume problems range from 5 moves to arbitrarily high numbers of moves, and they can be quite brain-busting. Tsume problems may seem artificial, but in the closing stages of the game where both players have a lot of pieces in hand, it is often necessary to give check at every move, or else your opponent will start a counterattack and will mate you before you mate him. A tsume problem is a worst-case scenario for the attacker: you have to mate your opponent even though he has every piece not on the board in hand, which means you have to develop sharp attacking skills. Many more tsume problems can be found on the internet; I particularly recommend Patrick Davin's ``Shogi Nexus'' (@pxref{References and links}). @page @c @c Shogi variants. @c @node Shogi variants, Differences between shogi and chess, Mating problems, About shogi @section Shogi variants @cindex Shogi variants @cindex Variants @cindex Tori Shogi @cindex Wa Shogi @cindex Chu Shogi @cindex Dai Shogi @cindex Tenjiku Shogi @cindex Dai-dai Shogi @cindex Maka-dai-dai Shogi @cindex Tai Shogi @cindex Kyoku Tai Shogi Several historical variants of shogi exist. Most of these were invented before modern shogi (in some cases hundreds of years before), are much larger than modern shogi and are not played with drops. Thus, in many ways they are really more like giant chess games than like modern shogi. The only one of these games to have survived in Japan is Chu (middle) shogi, which is still played a little bit. Thanks to the efforts of George Hodges and John Fairbairn of the Shogi Association (two British shogi enthusiasts), these games were resurrected and rules and sets for them can still be purchased from George Hodges (@pxref{References and links}). I hope to eventually extend GNU shogi so that it can play at least some of these games. There are also several non-historical variants of shogi; I don't know much about them but you can find information about them on the internet (@pxref{References and links}). The historical variants include: @enumerate @item Tori (bird) shogi, played on a 7x7 board with 32 pieces in all; this is the only variant that is known to have been played with drops. @item Wa shogi, played on an 11x11 board with 54 pieces. This game can be played with or without drops but the historical evidence favors the view that it was played without drops. However, most people who have tried it claim it is a much better game with drops, being even more intricate than standard shogi. @item Chu (middle) shogi, played on a 12x12 board with 92 pieces. This was (and is) by far the most popular of the variants, and has 21 different kinds of pieces in the starting line-up alone (along with several others that appear upon promotion). Unlike modern shogi, there are a tremendous number of ranging pieces and the game is definitely not played with drops. There is also an amazing piece called the Lion which has a double king move and can capture two pieces at once! Chu shogi has a small but fanatical following, some of whom consider it better than modern shogi. @item Dai (great) shogi, played on a 15x15 board with 130 pieces. Other than the larger board, this game is very similar to Chu shogi. @item Tenjiku (exotic) shogi, played on a 16x16 board with 176 pieces. This game is possibly the most complex tactical game in existence. There are many astoundingly powerful pieces, including one (the Fire Demon) that can capture up to eight opposing pieces in a single move! Despite the size of the game, checkmates can occur very suddenly (and often very early on) if one player makes a wrong move. Tenjiku also has a small but fanatical following, one of whom (Colin Adams) has written a book on the game which is available for download at @uref{http://wayback.archive.org/web/20120717085827/http://www.colina.demon.co.uk/tenjiku.html}. @item Dai-dai (great-great) shogi, played on a 17x17 board with 192 pieces. The opening setup alone has 64 different kinds of pieces! This game and the larger ones that follow sound pretty outlandish, but they have actually been played; a game of Dai-dai can supposedly be played in about 12 hours. @item Maka-dai-dai (great-great-great) shogi, played on a 19x19 board with 192 pieces. For those for whom Dai-dai shogi is just too small :-) @item Tai (grand) shogi, played on a 25x25 board with 354 pieces! Until recently, this was thought to be the biggest chess game ever devised, but now there is... @item Kyoku tai (extremely grand?) shogi, played on a 36x36 board with 402 pieces. The rules for this have just been unearthed in an old Japanese book. Hopefully someone will soon organize a postal Kyoku tai shogi championship; maybe their distant ancestors could finish it :-) It is thought that the really huge games (Dai-dai and up) were never really played to any significant extent (gee, wonder why?) and were devised merely so that the creators could have the fun of inventing enormous games, amazing their friends and confounding their enemies. However, the games up to Tenjiku shogi at least appear to be quite playable, assuming one has the time. @end enumerate Many modern variants have also been devised, usually on small boards, and often by western people. Those include: @enumerate @item Mini Shogi, played on a 5x5 board with 12 pieces. Its rules are nearly identical to Standard Shogi, and GNU Shogi has some support for it. @item Judkins Shogi, similar to Mini Shogi on a 6x6 board. @item Cannon Shogi, played on a 9x9 board, adds pieces inspired by the Cannon found in Xiang Qi (chinese chess) @item Sannin Shogi, a 3-player variant on an hexagonal board, with specific rules governing alliance between two players @item Kyoto Shogi, Micro Shogi, and several others are much more different. @end enumerate @c @c Differences between shogi and chess. @c @node Differences between shogi and chess, , Shogi variants, About shogi @section Differences between shogi and chess @cindex Shogi vs. Chess Some differences between shogi and international chess have been mentioned elsewhere in this document; I summarize them here for people who are interested in game comparisons. I won't try to deal with the thorny question of which game is ``better'' although my bias may have already come through :-) In fact, the drop rule makes the two games so different in character that arguing over which game is better is like comparing apples to oranges (you'd be better off comparing chess to Chu shogi (@pxref{Shogi variants}). However, I believe that if you are a chess fan you'll really like shogi as well, and shogi is also popular with many people who don't particularly like chess. Here are the significant differences between chess and shogi: @enumerate @item In shogi, captured pieces become the property of the capturer and can re-enter play by being dropped onto almost any vacant square. In chess, captured pieces are out of the game. Thus, in shogi, piece exchanges complicate the play significantly while in chess they simplify it. @item The shogi board is 9x9; the chess board is 8x8. @item Shogi has five pieces with no counterpart in chess: the gold and silver generals, the lance, the promoted rook and the promoted bishop. Chess has one piece with no counterpart in shogi: the queen. The knight's move in shogi is much more restrictive than in chess. Pieces in shogi generally have a much smaller range of movement than in chess (unless they are in hand). @item In shogi, all pieces except the gold general and the king can promote, but only to one kind of piece. Promotion is easier in shogi because the promotion zone is closer to the starting position of the pieces (especially pawns). In chess, only the pawn can promote, but it can promote to any other piece except the king. @item In shogi, pawns capture the same way they move. There is no initial two-space pawn move and hence no @emph{en-passant} captures. In chess, pawns capture diagonally which means that opposing pawns can block each other. @item In shogi, you only have one rook and one bishop. Note that the bishop is not restricted to only one ``color'' square (squares in shogi aren't colored, but never mind) because promoted bishops can also move one square orthogonally. @item There is no special castling move in shogi. The term ``castle'' is used in shogi to denote a defensive formation consisting of (usually) three generals which protect the king. There are many such castles (about 40 or so have names). @xref{Sample game}. @item Draws are much rarer in shogi than in chess. Perpetual check is not allowed. Stalemate is a virtual impossibility, and is a loss for the stalematee. @item Since pieces are never out of play in shogi, chess-type endgames involving only a few pieces do not occur. @item Shogi games are generally longer than chess games (about 60-70 moves is typical). @item Shogi has a well-developed handicap system which is in general use; chess does not. @end enumerate The effects of all these differences on play include (in my opinion): @enumerate @item Piece/pawn structures in chess are more rigid than in shogi. Pawns block each other and pawns, once advanced, cannot ever retreat. In shogi, you can repair the hole caused by a pawn advance by exchanging the pawn and dropping it back where you want it. Thus shogi is more fluid than chess and less ``structural''. @item Counterattack is MUCH more common in shogi than in chess. Games typically end in mutual mating attacks, where each player is trying to checkmate the other player before being checkmated himself. This makes tempo incredibly important and also makes sacrificial play quite common. @item Attacks involving only ranging pieces are more a feature of chess than of shogi. A shogi attack typically uses a ranging piece or pieces to support an attack by short-range pieces (especially generals). It is very rare to mate a king with a non-adjacent ranging piece in shogi since the player whose king is threatened can almost always interpose by dropping a piece. @end enumerate @c -------------------- @c gnushogi. @c -------------------- @node gnushogi, References and links, About shogi, Top @chapter gnushogi @cindex gnushogi This section describes how to run the ``gnushogi'' program. SYNOPSIS gnushogi [ [[-]a] [-b bookfile] [-B binbookfile] [-C] [-h langfile] [-L langfile] [-r length] [-R] [-s pathname] [-l pathname] [-S binbooksize] [-t] [-c size] [-T size] [-v] [-x] [-X] arg1 arg2 ] DESCRIPTION GNU shogi (gnushogi) plays a game of japanese chess (shogi) against the user or it plays against itself. At startup gnushogi reads the binbook file if it is present. It then looks for a book file. If it is present it adds its contents to the binbook data. If the binbook file is writable a new combined binbook file is written. Gnushogi is a modified version of the gnuchess program. It has a simple alphanumeric board display, or it can be used with a graphical interface like XBoard under X Window, or Winboard under Windows. The program gets its opening moves from the file gnushogi.bbk which is located in a directory specified in the Makefile. To invoke the program type: @table @samp @item gnushogi -C simple curses based version @item gnushogi -X (or just gnushogi) XBoard/XShogi compatible version @item gnushogi -R raw test display version @end table TIME CONTROLS If one argument is given, it is the search time per move in [minutes:]seconds. So gnushogi 30 will generate one move every 30 seconds, while gnushogi 5:00 will generate one move every 5 minutes. If two or more arguments are given, they will be used to set tournament time controls with the first argument of each pair being the number of moves and the second being the total clock time in minutes[:seconds]. Thus, entering gnushogi 60 5 will set the clocks for 5 minutes (300 seconds) for the first 60 moves, and gnushogi 30 3:30 will allow 3 minutes and 30 seconds for 30 moves. gnushogi 30 5 1 :30 will allow 5 minutes for the first 30 moves and 30 seconds for each move after that. Up to 4 pairs of controls may be specified. If no argument is given the program will prompt the user for level of play. @page BOOK The book gnushogi.tbk consists of a sequence of openings. An opening begins with a line starting with a # (the rest of the line is a comment). Following this is a series of moves in algebraic notation alternating between black and white separated by whitespace. A move may have a ? after it indicating this move should never be made in this position. Moves are stored as position:move so transpositions between openings can take place. HASHFILE The hashfile if created should be on the order of 4 megabytes; you can create such a hashfile by typing ``gnushogi -c 22'' (see below). This file contains positions and moves learned from previous games. If a hashfile is used the computer makes use of the experience it gained in past games. Tests run so far show that it plays no worse with the hashfile than without, but it is not clear yet whether it provides a real advantage. LEGAL MOVES Note: Piece letters are determined by the language file. What is specified here is the default (English). Once gnushogi is invoked, the program will display the board and prompt the user for a move. To enter a move, use the notation 7g7f where the first letter-number pair indicates the origin square and the second letter-number pair indicates the destination square. An alternative is to use the notation P7f where the first letter indicates the piece type (P,L,N,S,G,B,R,K). To promote append a + the type of the new piece to the move, as in 2d2c+ or P2c+. Note that you must use capital letters for the pieces by default. COMMAND-LINE OPTIONS @table @samp @item -a Do not search on opponent's time. @item a Do search on opponent's time. @item -b @var{bookfile} Use bookfile for opening book. @item -B @var{binbookfile} Use binbookfile for binary opening book. @item -c @var{size} Create a new HASHFILE. File size is 2^size entries of approximately 65+? bytes. @item -C Use curses-based display mode. @item -h Do not use hashfile. @item h Do use hashfile. @item -l @var{pathname} Pathname of the loadfile used with get or xget. @item -L @var{lang} Use language lang from the file gnushogi.lang. If -L is not specified it uses the first language in the file. @item -P @var{plylevels} Number of plys to include in the binbookfile. For generating a binbookfile. @item -r @var{length} Rehash @emph{length} times in searching entries for position in transposition table. @item -R Use raw text display mode. This can be used for dumb terminals or for systems that don't have curses. @item -s @var{pathname} Pathname of the save file to use with the save command. @item -S @var{size} Size of binbookfile for memory based books. For creating a binbookfile. @item -t Show statistics for HASHFILE. @item -T @var{size} Set the transposition table size to 2^size entries. @item -v Show version and patchlevel. @item -x @var{value} Use value as the evaluation window xwndw. @item -X Use XBoard/XShogi display mode (the default). @end table COMMANDS In addition to legal moves, the following commands can be entered at the gnushogi prompt. Note: command names are determined by the language file and may vary with the implementation. The default language is English. @table @samp @item alg allow algebraic input (not implemented). @item Awindow change Alpha window (default score + 90). @item Bwindow change Beta window (default score - 90). @item beep toggles beeping after each move (default: on). @item bd updates the current board position on the display. @item book turns off use of the opening library. @item both causes the computer to play both sides of a shogi game. @item black causes the computer to play as White, if the computer was to move first. @item bsave saves a game to disk as a book textfile. The program will prompt the user for a file name. @item gamein toggles game mode time control. Assumes the time specified for time control is the time for a complete game. Input with the level command should be the game time and the expected number of moves in a game. go command must be given. @item coords show coordinates on the display (visual only). @item contempt allows the value of @emph{contempt} to be modified. @item debug asks for a piece as color piece, as wb or bn, and shows its calculated value on each square. @item debuglevel sets level of debugging output if compiled with debug options. @item depth allows the user to change the search depth of the program. The maximum depth is 29 ply. Normally the depth is set to 29 and the computer terminates its search based on elapsed time rather than depth. If depth is set to (say) 4 ply, the program will search until all moves have been examined to a depth of 4 ply (with extensions up to 11 additional ply for sequences of checks and captures). If you set a maximum time per move and also use the depth command, the search will stop at the specified time or the specified depth, whichever comes first. @item easy toggles easy mode (thinking on opponents time) on and off. The default is easy mode ON. If easy mode is disabled, the keyboard is polled for input every so often and when input is seen the search is terminated. It may also be terminated with a sigint. @item edit allows the user to set up a board position. @itemize @minus @item # clear the board. @item c toggle piece color. @item . command will exit setup mode. @item p3b place a pawn on 3b @item p3b+ place a promoted pawn on 3b @item p* place a pawn in hand (among the captured pieces) @end itemize Pieces are entered by typing a letter (p,l,n,s,g,b,r,k) for the piece followed by the coordinate. Here, letter case is ignored. The usual warning about the language file applies. @item exit exits gnushogi. @item first tells the computer to move first. Computer begins searching for a move. (same as ``go''). @item force allows the user to enter moves for both sides. To get the program to play after a sequence of moves has been entered use the ``black'' or ``white'' commands. @item get retrieves a game from disk. The program will prompt the user for a file name. @item go tells the computer to move first. Computer begins searching for a move. (same as ``first''). @item hash use/don't use hashfile. @item hashdepth allows the user to change the minimum depth for using the hashfile and the number of moves from the beginning of the game to use it. @item help displays a short description of the commands and the current status of options. @item hint causes the program to supply the user with its predicted move. @item level allows the user to set time controls such as 60 moves in 5 minutes etc. In tournament mode, the program will vary the time it takes for each move depending on the situation. If easy mode is disabled (using the ``easy'' command), the program will often respond with its move immediately, saving time on its clock for use later on. @item list writes the game moves and some statistics on search depth, nodes, and time to the file ``shogi.lst''. @item material toggle material flag - draws on no pawns and both sides < rook. @item new starts a new game. @item p evaluates the board and shows the point score for each piece. The total score for a position is the sum of these individual piece scores. @item post causes the program to display the principal variation and the score during the search. A score of 100 is equivalent to a 1 pawn advantage for the computer. @item quit exits the game. @item random causes the program to randomize its move selection slightly. @item rcptr set recapture mode. @item remove backout the last level for both sides. Equal to 2 undo's. @item reverse causes the board display to be reversed. That is, the Black's pieces will now appear at the top of the board. @item rv reverse board display. @item save saves a game to disk. The program will prompt the user for a file name. @item switch causes the program to switch places with the opponent and begin searching. @item test performs some speed tests for MoveList and CaptureList generation, and ScorePosition position scoring for the current board. @item time set computer's time remaining, intended for synchronizing clocks among multiple players. @item tsume toggle tsume mode. In tsume mode, not all possible moves will be generated. If a king is in check, only moves that get the king out of check are generated. If the king is not in check, only moves that give check to the opponent's king are generated. @item undo undoes the last move whether it was the computer's or the human's. You may also type ``remove''. This is equivalent to two ``undo'''s (e.g. retract one move for each side). @item white causes the computer to play as Black; if the computer is to move first the go command must be given. @item xget read an XShogi position file. @item xsave save as an XShogi position file. @item xwndw change X window. The window around alpha/beta used to determine whether the position should be scored or just estimated. Note: this has @emph{nothing} to do with XBoard, XShogi or X Window; the terms are completely separate. @end table @c --------------------- @c References and links. @c --------------------- @node References and links, Acknowledgements, gnushogi, Top @chapter References and links @cindex References @cindex Books @cindex Mailing lists @cindex Web sites There are very few English-language books for people learning shogi. The two I recommend are: @enumerate @item @cite{Shogi for Beginners, 2nd. Edition}, by John Fairbairn. This is a superb beginner's book in every way, covering all phases of the game. It was out of print for a long time, but has now been reprinted and is available either from Kiseido (@uref{http://www.labnet.or.jp/~kiseido}) or from George Hodges (see below). @item @cite{The Art of Shogi}, by Tony Hoskings. This is one step up from the Fairbairn book. It covers a lot of ground, and is especially noteworthy for its detailed treatment of opening lines. You can order this book from Amazon.com's UK branch (@uref{http://www.amazon.co.uk}). @end enumerate Another book you may find is @cite{Shogi: Japan's Game of Strategy} by Trevor Leggett. This book is very elementary and is somewhat outdated, having been published first in 1966. However, it does feature a paper shogi board and punch-out pieces, so if you want a really cheap shogi set you might pick this book up. It is still in print. Two books that are no longer in print but are definitely worth getting if you find them are @cite{Guide to Shogi Openings} and @cite{Better Moves for Better Shogi}, both by Aono Teriuchi. They are published in a bilingual edition (English/Japanese) and are the only books on shogi in English written by a Japanese professional shogi player. John Fairbairn did the translation from Japanese to English. Shogi sets are available from: @quotation George F. Hodges @* P.O. Box 77 @* Bromley, Kent @* United Kingdom BR1 2WT @end quotation George also sells equipment for all the historical shogi variants (@pxref{Shogi variants}) (except for Kyoku tai shogi) and also sells back issues of the magazine ``Shogi'' which he published for 70 issues in the late 70's to late 80's. This magazine is STRONGLY recommended; it contains more information about shogi in English than you will ever find anywhere else. Here are some useful URLs: @table @asis @item Pieter Stouten's shogi page: @uref{http://www.shogi.net} This is the main shogi-related site on the internet, with links to almost all the other sites. @item Roger Hare's shogi page: @uref{http://www.ed.ac.uk/~rjhare/shogi} This has lots of information, including full rules to most of the shogi variants. @item Patrick Davin's Shogi Nexus: @uref{http://www.vega.or.jp/~patrick/shogi/} There's lots of cool stuff on this site; my favorite is the extensive collection of Tsume-shogi (mating) problems, both for beginners and more advanced players. @item Steve Evans' shogi page: @uref{http://www.netspace.net.au/~trout/index.html} Steve has written a program that plays almost all of the shogi variants, unfortunately it only runs on Windows :-( @item Hans Bodlaender's chess variant pages: @uref{http://www.cs.ruu.nl/~hansb/d.chessvar} This page has an almost unimaginable variety of rules for different chess variants, including many shogi variants (historical and non-historical). @item Wikipedia's shogi variant pages: @uref{http://en.wikipedia.org/wiki/Category:Shogi_variants} Those pages contain a large number of variant rules, both ancient and modern. @end table @c ----------------- @c Acknowledgements. @c ----------------- @node Acknowledgements, Bugs, References and links, Top @chapter Acknowledgements @cindex Acknowledgements I would like to thank the following people: @itemize @bullet @item Matthias Mutz, who originally developed GNU shogi as a spin-off of GNU chess and who very kindly let me take over the maintenance of this very interesting project. @item Richard Stallman and the Free Software Foundation, for creating an organization where anyone can contribute software for the common good of all, for making GNU/Linux possible, and especially for writing emacs and gcc, without which my working life would be intolerable. @item Georges Hodges, for starting the Shogi Association in England, without which I would probably never have heard of shogi, for supplying shogi equipment, for publishing the excellent magazine ``Shogi'' (now sadly defunct), for personally answering all my silly questions by mail, and for being the ambassador of shogi to the West. @item Pieter Stouten, for having the most comprehensive shogi site on the World Wide Web (@uref{http://www.shogi.net}), and for maintaining the shogi-l mailing list. Go to Pieter's web site for more information on subscribing to the list. Also thanks to everyone who contributes and has contributed to that list. @item Matt Casters, for testing GNU shogi. Matt and I will be working together on improving the solution engine in future versions of this program. @end itemize @c ----- @c Bugs. @c ----- @node Bugs, Index, Acknowledgements, Top @chapter Bugs The motto of GNU shogi is ``100% bug-free or you don't pay!'' :-) In the extremely unlikely case (*ahem*) that you do find a bug, please report it to the bug tracker at @uref{https://savannah.gnu.org/projects/gnushogi/}. Also, feel free to post comments, complaints, out-and-out raves, suggestions and such to one of the mailing lists at @uref{https://savannah.gnu.org/mail/?group=gnushogi}. @c ============ @c End of body. @c ============ @c ==== @c End. @c ==== @node Index, , Bugs, Top @chapter Index @printindex cp @contents @bye gnushogi-1.5pre/doc/tutorial1.gam0000644000175000017500000001454212363540323014020 00000000000000# Shogi Game 1 (amateur game, amateur comment): introductory game. # # Below you find (the English translation of) an annotated game which was # published in the Dutch Shogi magazine "81" and in the Dutch beginners # booklet. It has proven to be a very useful game to explain some basic # principles of Shogi. Also, it is a rather straight forward game compared # to professional games where in most cases very diffuse middle game fights # take place. # # Pieter Stouten, 14-th May 1990. # # --------------------------------------------------------------------------- # # Black: Michael Trent (1-dan). White: David Murphy (2-dan). 1.P2f P3d 2.P2e B3c [ This move is necessary, otherwise white can exchange pawns: 3.P2d Px2d 4.Rx2d. He would thus get a pawn in hand and open up his rook file. ] 3.P7f P4d [ White closes the bishop diagonal again. He plans to play ranging rook (the rook goes to 5, 4, 3 of 2b; a defensive strategy) and in that case he'd better avoid an exchange of bishops. One of the reasons is that he will have problems developing his pieces without leaving holes for bishop drops. ] 4.S4h R3b 5.P3f S4b 6.K6h K6b [ In general the rook plays an important role in the attacks. It is wise to move the king away from the area where the initial fights will be and both players act according to the Shogi proverb "keep the rook and king apart". ] 7.K7h K7b 8.P5f P5d 9.G4i-5h G4a-5b [ Both players use their second gold general to build their castle. ] 10.S6h [ In itself this move is not bad. However, it will become clear that black plans a quick attack and in that case it is wiser to omit this move. ] 10... S5c 11.P1f P1d [ The advance of the edge pawns must be timed very well. The remark at black's tenth move applies here too: this move is good if black wants to play a slow game, because it eliminates a future B1e. ] 12. P4f K8b 13.N3g S7b [ Black develops his knight in order to start an attack over the second, third and fourth files. White strengthens his king's position and awaits the attack. He aims at a counter attack as soon as black has broken through into the white camp. Probably white's breakthrough will take place later, but he has good compensation in the form of a stronger castle. This theme occurs very often in static rook versus ranging rook games. ] 14.P4e R4b [ Black starts his attack and white puts up a very passive defence. His rook has a hard task now to penetrate the black position. Moreover, he blocks his own bishop. It seems much better to start a counter attack with 14... P3e, later to be followed by B2b, B5a or Bx4d in order to use his rook more actively. ] 15.Px4d Sx4d 16.P*4e S5c [ 16... Sx4e is more active. A silver general is normally more valuable than a knight, but white gets two pawns in hand and black none, while the knight might come in handy for white too. ] 17.Bx3c+ Nx3c 18.P2d Px2d [ Black threatens to break through and white had to consider taking the pawn on 2d or starting a counter attack with Nx4e. If he choses the latter, black can play Px2c+ followed by +P3c. The disadvantage is the black "tokin" (=promoted pawn) that white will get in his camp; the advantage is that it will cost black two more moves to promote his rook. Because white did not trust that the result after engaging in a "semeai" (=mutual attack) with 18...N4e would to give a positive result, he captured the pawn on 2d. Making the right decision in moments like this often makes the difference between a win and a loss: miss one attacking chance and you will be forced to defend the whole game until the unavoidable defeat; on the other hand, an unsound attack can destroy all "aji" (=potential, meaning possibilities, threats) without getting anything in return. ] 19.Rx2d Nx4e 20.Nx4e Rx4e 21.R2a+ P*4g [ Now it becomes clear why black's 10.S6h was not good. Had this move been omitted, then white would not have had the time to play 13... S7b and after R2a+ the gold on 6a would hang. Thus black would have kept "sente" (=initiative). Instead of 21... P*4g B*6d is a very good move, because after 22.P*2h black does not have a pawn in hand anymore and he is being threatened with the annoying 22... N*4f 23.G5g N3h+ 24.S4g +N4h also. Black can also counter 21... B*6d with 22.N*3g. White would then reply with 22... R4b 23.B*3c P*4g 24.Bx4b+ Sx4b. The white rook has played its role and instead of spending moves on saving it white starts to scatter black*s defences by successive pawn drops on the fourth file: 25.Gx4g P*4f 26.G5g N*6e 27.G5h P4g+ 28.Gx4g P*4f. This analysis was provided by Kato Hifumi, 9-dan professional (the highest regular grade). Destroying the coherence of the enemy pieces (their shape) by dropping pawns is one of the most important Shogi techniques. With the actual move 21... P*4g white missed a good chance. ] 22.Sx4g P*4f 23.B*3g Px4g+ 24.+Rx6a +Px3g [ 23.B*3g seems pointless, but a closer look reveals that it is actually quite mean. On move 24 white cannot capture blacks "Ryu" (=dragon =promoted rook) with his silver: 24... Sx6a 25.N*7d K7b 26.G*8b mate. By attacking the front of the white castle and threatening to mate him there, black has the chance to break down the white defences from the side. ] 25.+Rx5b S*6b [ Here 25... B*4d would be much better, because it is defensive and attacking at the same time. After e.g. 26.G*4c Bx9i+ 27.Gx5c black threatens 28.+Rx7b Kx7b 29.S*6a K8b 30.S*7a Kx7a 31.G*7b mate. White is one move quicker, however. He has the following beautiful "tsume" (mating sequence where every move is check): 27... N*8f 28.Px8f S*8g 29.Kx8g B*9h 30.K7h Bx8i+ 31.K8g +b8i-8h 32.K9f L*9e mate. This illustrates the sharpness of Shogi: one move can make the difference between winning and losing. ] 26.P*4f Rx4f [ This move eliminates white's last chances. 26... R4b 27.+Rx4b Sx4b 28.R*4a seems annoying, but after 28... B*3c 29.S7g B*3b white wins the rook and with his "tokin" on 3g there still is some hope. ] 27.N*6e +P4g [ White cannot defend anymore, so he starts a desperate attack. Black does not lose the right track, however. ] 28.Nx5c+ +Px5h 29.+Nx6b +Px6h 30.Gx6h N*8f 31.Px8f B*6i 32.Gx6i R4h+ 33.N*6h +Rx6h 34.Gx6h S*8g 35.Kx8g N*9e 36.K7h Resigns [ White resigns here, because after 36... B*8g 27.K7g his attack has petered out. ] gnushogi-1.5pre/doc/Makefile.in0000644000175000017500000006440012364540713013455 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # # Documentation Makefile for GNU Shogi # # Copyright (c) 2013 Yann Dirson and the Free Software Foundation # # This file is part of GNU Shogi. # # GNU Shogi is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 1, or (at your option) # any later version. # # GNU Shogi is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Shogi; see the file COPYING. If not, write to # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. # VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am texinfo.tex \ $(dist_man_MANS) $(dist_doc_DATA) $(dist_noinst_DATA) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = AM_V_DVIPS = $(am__v_DVIPS_@AM_V@) am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@) am__v_DVIPS_0 = @echo " DVIPS " $@; am__v_DVIPS_1 = AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@) am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@) am__v_MAKEINFO_0 = @echo " MAKEINFO" $@; am__v_MAKEINFO_1 = AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@) am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@) am__v_INFOHTML_0 = @echo " INFOHTML" $@; am__v_INFOHTML_1 = AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@) am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@) am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@; am__v_TEXI2DVI_1 = AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@) am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@) am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@; am__v_TEXI2PDF_1 = AM_V_texinfo = $(am__v_texinfo_@AM_V@) am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@) am__v_texinfo_0 = -q am__v_texinfo_1 = AM_V_texidevnull = $(am__v_texidevnull_@AM_V@) am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@) am__v_texidevnull_0 = > /dev/null am__v_texidevnull_1 = INFO_DEPS = $(srcdir)/gnushogi.info am__TEXINFO_TEX_DIR = $(srcdir) DVIS = gnushogi.dvi PDFS = gnushogi.pdf PSS = gnushogi.ps HTMLS = gnushogi.html TEXINFOS = gnushogi.texi TEXI2DVI = texi2dvi TEXI2PDF = $(TEXI2DVI) --pdf --batch MAKEINFOHTML = $(MAKEINFO) --html DVIPS = dvips am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__installdirs = "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man6dir)" \ "$(DESTDIR)$(docdir)" am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man6dir = $(mandir)/man6 NROFF = nroff MANS = $(dist_man_MANS) DATA = $(dist_doc_DATA) $(dist_noinst_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CEXTRAFLAGS = @CEXTRAFLAGS@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURSESDSP = @CURSESDSP@ CURSESDSPMINI = @CURSESDSPMINI@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBCURSES = @LIBCURSES@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAT2INC = @PAT2INC@ PAT2INCEXE = @PAT2INCEXE@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WARNINGS = @WARNINGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ info_TEXINFOS = gnushogi.texi AM_MAKEINFOHTMLFLAGS = --split=section dist_man_MANS = gnushogi.6 dist_doc_DATA = \ BOOKFILES \ shogi.rules \ tutorial1.gam \ tutorial2.gam dist_noinst_DATA = \ PORTING all: all-am .SUFFIXES: .SUFFIXES: .dvi .html .info .pdf .ps .texi $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): .texi.info: $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $@ $<; \ then \ rc=0; \ $(am__cd) $(srcdir); \ else \ rc=$$?; \ $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc .texi.dvi: $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ $< .texi.pdf: $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ $< .texi.html: $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $(@:.html=.htp) $<; \ then \ rm -rf $@ && mv $(@:.html=.htp) $@; \ else \ rm -rf $(@:.html=.htp); exit 1; \ fi $(srcdir)/gnushogi.info: gnushogi.texi gnushogi.dvi: gnushogi.texi gnushogi.pdf: gnushogi.texi gnushogi.html: gnushogi.texi .dvi.ps: $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) $(AM_V_texinfo) -o $@ $< uninstall-dvi-am: @$(NORMAL_UNINSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ rm -f "$(DESTDIR)$(dvidir)/$$f"; \ done uninstall-html-am: @$(NORMAL_UNINSTALL) @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ done uninstall-info-am: @$(PRE_UNINSTALL) @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done uninstall-pdf-am: @$(NORMAL_UNINSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ done uninstall-ps-am: @$(NORMAL_UNINSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ rm -f "$(DESTDIR)$(psdir)/$$f"; \ done dist-info: $(INFO_DEPS) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ case $$base in \ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ if test -f $$file; then \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ test -f "$(distdir)/$$relfile" || \ cp -p $$file "$(distdir)/$$relfile"; \ else :; fi; \ done; \ done mostlyclean-aminfo: -rm -rf gnushogi.t2d gnushogi.t2p clean-aminfo: -test -z "gnushogi.dvi gnushogi.pdf gnushogi.ps gnushogi.html" \ || rm -rf gnushogi.dvi gnushogi.pdf gnushogi.ps gnushogi.html maintainer-clean-aminfo: @list='$(INFO_DEPS)'; for i in $$list; do \ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done install-man6: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man6dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man6dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man6dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.6[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^6][0-9a-z]*$$,6,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man6dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man6dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man6dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man6dir)" || exit $$?; }; \ done; } uninstall-man6: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man6dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.6[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^6][0-9a-z]*$$,6,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man6dir)'; $(am__uninstall_files_from_dir) install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-info check-am: all-am check: check-am all-am: Makefile $(INFO_DEPS) $(MANS) $(DATA) installdirs: for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man6dir)" "$(DESTDIR)$(docdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-aminfo clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: $(DVIS) html: html-am html-am: $(HTMLS) info: info-am info-am: $(INFO_DEPS) install-data-am: install-dist_docDATA install-info-am install-man install-dvi: install-dvi-am install-dvi-am: $(DVIS) @$(NORMAL_INSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \ $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ done install-exec-am: install-html: install-html-am install-html-am: $(HTMLS) @$(NORMAL_INSTALL) @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ d2=$$d$$p; \ if test -d "$$d2"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \ $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ else \ list2="$$list2 $$d2"; \ fi; \ done; \ test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ done; } install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \ $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \ fi; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ if test -f $$ifile; then \ echo "$$ifile"; \ else : ; fi; \ done; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done @$(POST_INSTALL) @if $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ done; \ else : ; fi install-man: install-man6 install-pdf: install-pdf-am install-pdf-am: $(PDFS) @$(NORMAL_INSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done install-ps: install-ps-am install-ps-am: $(PSS) @$(NORMAL_INSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-aminfo mostlyclean-generic pdf: pdf-am pdf-am: $(PDFS) ps: ps-am ps-am: $(PSS) uninstall-am: uninstall-dist_docDATA uninstall-dvi-am \ uninstall-html-am uninstall-info-am uninstall-man \ uninstall-pdf-am uninstall-ps-am uninstall-man: uninstall-man6 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-aminfo clean-generic \ cscopelist-am ctags-am dist-info distclean distclean-generic \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dist_docDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-man6 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-aminfo \ maintainer-clean-generic mostlyclean mostlyclean-aminfo \ mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dist_docDATA uninstall-dvi-am \ uninstall-html-am uninstall-info-am uninstall-man \ uninstall-man6 uninstall-pdf-am uninstall-ps-am spell: tr '[A-Z]' '[a-z]' < $(srcdir)/gnushogi.texi | tr -cd '[A-Za-z0-9_ \012]' | \ tr -s '[ ]' '\012' | sort | uniq -c | sort -nr | spell | sort | uniq # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gnushogi-1.5pre/doc/gnushogi.info0000644000175000017500000017460212363550577014126 00000000000000This is gnushogi.info, produced by makeinfo version 5.2 from gnushogi.texi. INFO-DIR-SECTION Games START-INFO-DIR-ENTRY * gnushogi: (gnushogi). Japanese chess END-INFO-DIR-ENTRY This file describes how to use GNU shogi, a program which plays Shogi (Japanese chess). Copyright (C) 2013 Yann Dirson and the Free Software Foundation, Inc. Copyright (C) 1999 Michael C. Vanier and the Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation.  File: gnushogi.info, Node: Top, Next: (dir), Prev: (dir), Up: (dir) GNU Shogi (Japanese chess) ************************** * Menu: * Introduction:: What is GNU shogi? * About shogi:: General information, rules, etc. * gnushogi:: How to play GNU shogi (gnushogi). * References and links:: Where to go for more information. * Acknowledgements:: * Bugs:: Where and how to report bugs. * Index::  File: gnushogi.info, Node: Introduction, Next: About shogi, Prev: Top, Up: Top 1 Introduction ************** GNU shogi is a program that plays shogi, the Japanese version of chess, against a human (or computer) opponent. This file describes how to use GNU shogi and also gives background information about the game of shogi. In 1994, GNU Shogi 1.2p02, then developed by Matthias Mutz, played in the 5th Computer Shogi Championship, and finished 17th out of 22 opponents. This file describes GNU Shogi version 1.4.1, but most of it was written for version 1.3.2 by Mike Vanier , maintainer of GNU shogi at that time. GNU Shogi is currently maintained by Yann Dirson . GNU Shogi is actually one program, 'gnushogi', the text-based program which also contains the game-playing engine. By default it will play Standard Shogi, but can be built to play Mini Shogi (with GNU Shogi 1.4.x, you will need to do that explicitely using './configure -enable-minishogi', but 1.5 will make this more straightforward). Most players will just run GNU Shogi through one of the compatible graphical interfaces: 1. XBoard/Winboard (http://www.gnu.org/software/xboard/), a GUI for much more than Shogi, part of the GNU Project. While XBoard has been supporting Shogi for a long time, current version only makes it easy to use a Chessified western-looking set of pieces; upcoming version XBoard 4.8 will allow easy usage of traditional japanese pieces. Supported by GNU Shogi since version 1.5.0 only: 1.4.x and earlier versions cannot talk to it. 2. Tagua (http://repo.or.cz/w/tagua/yd.git), a KDE-based GUI for Chess and Shogi. Developement stopped several years ago, and it is still somewhat maintained at Debian. Probably the most sophisticated and best-looking free GUI available today. 3. Omaha (https://alioth.debian.org/projects/omaha/), a generic board-game GUI, supporting Shogi and other games, with currently only a Gtk2-based UI. Still under developement, but already usable for casual games. 4. Kaya (https://github.com/pcapriotti/kaya), a small KDE-based GUI successor to Tagua, but development of this still young program seem to have stalled. 5. XShogi (http://ftp.gnu.org/gnu/gnushogi/), an X Window graphical interface to gnushogi, forked off GNU XBoard years ago, and far from today's UI standards. It has barely been maintained recently, while XBoard has grown much and is able to play Shogi; XShogi is now deprecated and will soon be retired. The GNU Shogi distribution used to contain the 'xshogi' program, In future versions, GNU Shogi will be able to use XBoard as a GUI and XShogi will be retired, replaced by XBoard. XShogi is still available as a separate source archive on the GNU project FTP server. Disclaimer: I use the personal pronouns "him", "his" etc. to refer to a shogi player regardless of gender. That's easier than writing "his or her" all over the place. I don't mean to infer that women don't play shogi; in fact shogi is very popular in Japan among women as well as men.  File: gnushogi.info, Node: About shogi, Next: gnushogi, Prev: Introduction, Up: Top 2 About the game of shogi ************************* "Japanese chess cedes nothing in depth or beauty to the European game... it is at least as interesting." -- Alexander Alekhine (quoted in David Pritchard, 'The Encyclopedia of Chess Variants') "... shogi [is] by far the most complex form of chess that has ever achieved widespread popularity." -- R. Wayne Schmittberger, 'New Rules for Classic Games' Shogi is the version of chess played in Japan. It is strikingly different from standard chess (which I shall refer to henceforth as "international chess") and also to all other regional variants, because captured pieces can re-enter play on the side of the capturer. This has several interesting effects on the play of the game: 1. Shogi is much more complex than international chess, at least in terms of the average number of possible moves per turn (estimated at about 35 for chess and at about 80 for shogi). 2. There are almost no draws (about 1-2% of all games in professional play). 3. Exchanges complicate the play rather than simplifying it. 4. There are no "endgames" in the standard chess sense; all pieces remain in play throughout the game. Games typically end in a race to checkmate the other player before being checkmated oneself. 5. Ownership of a piece is not indicated by the color of the piece; instead, pieces are wedge-shaped and point towards the opponent. The name of the piece is inscribed in Kanji characters on the front of the piece. 6. Most importantly: it's more fun than other forms of chess :-) Shogi is extremely popular in Japan; it has been estimated that 20 million Japanese can play shogi, of which perhaps 1 million are active players. It is even more popular there than the game of go, Japan's other favorite board game. There are a number of professional players who make a considerable amount of money playing in shogi tournaments, and the game receives extensive newpaper and television coverage. Despite this, the game has yet to become popular outside of Japan. Part of this is because the Kanji characters on the pieces scare away some people, but mostly it's due, I think, to lack of exposure to the game and to the difficulty of finding opponents. I hope that GNU shogi will help introduce shogi to a wider audience. * Menu: * The rules of shogi:: * Sample game:: * Mating problems:: * Shogi variants:: * Differences between shogi and chess::  File: gnushogi.info, Node: The rules of shogi, Next: Sample game, Prev: About shogi, Up: About shogi 2.1 The rules of shogi ====================== Shogi is a two-person abstract strategy board game with full information (i.e. all pieces and moves are visible to both players at all times). It is in the chess family, being descended from the same ancestral game as international chess: the Indian game of Chaturanga. The two players are referred to as "Black" and "White", with Black moving first (unlike in international chess, where White moves first), and with movement alternating between the two players. Note that "Black" and "White" are just names; the pieces are not colored. Instead, they are flat, wedge-shaped pieces which point towards the opponent. The identity of a given piece is indicated by two Japanese Kanji characters on each piece. In fact, only the top character is needed to identify the piece and thus only the top character is used in shogi diagrams. I will use alphabetical equivalents in the diagrams here; to see what the Kanji characters look like, start up a graphical interface (*note Introduction::) and compare the starting setup there with the starting setup in this file (*note The opening setup::). The object of the game is to capture the opponent's King. The board is a grid of 9x9 uncolored squares, and pieces are placed on the squares. Each player begins with 20 pieces, described in the next section. Capture is by displacement, as in international chess. * Menu: * The moves of the pieces:: * The opening setup:: * Promotion of pieces:: * Drops:: * Winning the game:: * Draws:: * Handicaps:: * Notes for chess players::  File: gnushogi.info, Node: The moves of the pieces, Next: The opening setup, Prev: The rules of shogi, Up: The rules of shogi 2.1.1 The moves of the pieces ----------------------------- Each player at the beginning of a shogi game has a total of 20 pieces of eight different types. The moves of the shogi pieces can be divided into three classes: "stepping" pieces, that only move one square at a time; "ranging" pieces that move any number of unobstructed squares in a line, and "jumping" pieces that can jump over obstructing pieces to reach their destination squares. Most pieces can also promote to different (usually stronger) pieces under certain circumstances (see the next section). All pieces capture the same way that they move (even pawns). The piece moves and promotions are as follows; each piece name is followed by the standard piece abbreviation: 1. The king (K). The king can move one square in any horizontal, vertical, or diagonal direction, just like the king in international chess. The king does not promote. 2. The rook (R). The rook can move any number of squares in a horizontal or vertical direction. The rook is the same as the rook in international chess (except that it can promote). A rook promotes to a "dragon king" or "dragon" for short (often just referred to as a "promoted rook"), which can move as a rook or can move one square in any diagonal direction. 3. The bishop (B). The bishop can move any number of squares in a diagonal direction. The bishop is the same as the bishop in international chess (except that it can promote). A bishop promotes to a "dragon horse" or "horse" for short (often just referred to as a "promoted bishop"), which can move as a bishop or can move one square in any horizontal or vertical direction. Note: the horse should not be confused with a knight (see below), as they are two completely different pieces. 4. The gold general (G). A gold general can move one square in any horizontal or vertical direction, or one square in a forward diagonal direction. Gold generals do not promote. 5. The silver general (S). A silver general can move one square in any diagonal direction, or one square straight forward. A silver general promotes to a gold general. 6. The knight (N). A knight can move one square straight forward followed by one square to either forward diagonal, jumping over intervening pieces if any. In other words, a knight moves like its international chess counterpart, but forward only. A knight promotes to a gold general. The knight is the only jumping piece, as in chess. 7. The lance (L). A lance can move any number of squares straight forward. A lance promotes to a gold general. 8. The pawn (P). A pawn can move one square straight forward. The pawn captures the same way that it moves, in contrast to international chess. There is also no initial two-space move for pawns and no _en-passant_ capture. A pawn promotes to a gold general; a promoted pawn is usually known as a "Tokin".  File: gnushogi.info, Node: The opening setup, Next: Promotion of pieces, Prev: The moves of the pieces, Up: The rules of shogi 2.1.2 The opening setup ----------------------- The opening setup for shogi is as follows: 9 8 7 6 5 4 3 2 1 +--------------------------------------------+ | wL | wN | wS | wG | wK | wG | wS | wN | wL | a +--------------------------------------------+ | | wR | | | | | | wB | | b +--------------------------------------------+ | wP | wP | wP | wP | wP | wP | wP | wP | wP | c +--------------------------------------------+ | | | | | | | | | | d +--------------------------------------------+ | | | | | | | | | | e +--------------------------------------------+ | | | | | | | | | | f +--------------------------------------------+ | bP | bP | bP | bP | bP | bP | bP | bP | bP | g +--------------------------------------------+ | | bB | | | | | | bR | | h +--------------------------------------------+ | bL | bN | bS | bG | bK | bG | bS | bN | bL | i +--------------------------------------------+ Here, "b" stands for "black" and "w" stands for "white", so that, for instance, "bL" means "black lance". The numbers above the files and the letters to the right of the ranks represent the most common notation system used for shogi by westerners (the Japanese also use Arabic numerals for the files but use Japanese numerals for the ranks).  File: gnushogi.info, Node: Promotion of pieces, Next: Drops, Prev: The opening setup, Up: The rules of shogi 2.1.3 Promotion of pieces ------------------------- In sharp contrast to international chess, where only pawns can promote to higher-ranked pieces, most of the pieces in shogi can promote. The promoted ranks are discussed in the section on piece moves (*note The moves of the pieces::) but are repeated here for reference: Pawn promotes to gold general (called a 'tokin' in this case only). Lance promotes to gold general. Knight promotes to gold general. Silver general promotes to gold general. Gold general does not promote. Bishop promotes to "dragon horse" or just "horse" for short. The horse can move as a bishop or can move one square in any orthogonal direction. Rook promotes to "dragon king" or just "dragon" for short. The dragon can move as a rook or can move one square in any diagonal direction. King does not promote. The three ranks furthest away from each player constitute his/her "promotion zone". A player may, but is not required to, promote a piece after making a move in which the piece begins and/or ends in the promotion zone. Thus you can promote a piece when moving the piece into the promotion zone, out of the promotion zone, or entirely within the promotion zone. Promotion is mandatory in these cases: 1. You must promote a pawn or a lance after moving it to the last rank. 2. You must promote a knight after moving it to either of the last two ranks. These forced promotions ensure that a piece cannot be moved to a square from which it would have no further move. Pieces "dropped" onto the board (*note Drops::) always drop in the unpromoted state, even if they drop into the promotion zone.  File: gnushogi.info, Node: Drops, Next: Winning the game, Prev: Promotion of pieces, Up: The rules of shogi 2.1.4 Drops ----------- When a player captures a piece, that piece is not removed from play. Instead, it becomes the property of the capturer and can re-enter play by being placed on (almost) any vacant square during the player's move. This is known as a "drop" and counts as a full move (in other words, you can either move a piece on the board or drop a piece onto the board during your move, but not both). All pieces drop in the unpromoted state. Pieces may be legally dropped in their promotion zone, but they do not promote on that turn. There are several restrictions on drops: 1. A pawn may not be dropped onto a file if there is already an unpromoted pawn belonging to the same player on that file. It is legal to drop a pawn on a file which contains a _promoted_ pawn belonging to the same player, however. 2. A pawn may not be dropped to give immediate checkmate on the move. A pawn is, however, permitted to be moved on the board to give immediate checkmate. This is a curious rule, and if anyone knows the reason for it I would appreciate it if they would contact me and explain it to me :-) 3. A pawn or piece may not be dropped onto a square from which they would have no legal move. This means that pawns and lances may not be dropped onto the last rank, and the knight may not be dropped onto the last or second-to-last rank. It is entirely permissible (and often advisable) to drop a piece or pawn between one's King and an attacking ranging piece. For this reason, the final checkmating move is nearly always an attack on the King from an adjacent square (except for an attack by a Knight). Captured pieces are said to be pieces "in hand". The drop is the primary distinguishing feature of Japanese chess, shared with no other popular chess-type game. It gives shogi a very aggressive quality, and dramatically increases the number of possible moves once a few pieces have been captured. Another interesting feature of shogi is that exchanges complicate play rather than simplifying it (as in international chess), because of the drop rule.  File: gnushogi.info, Node: Winning the game, Next: Draws, Prev: Drops, Up: The rules of shogi 2.1.5 Winning the game ---------------------- A game of shogi is won by capturing the opponent's king. In general, this is done by checkmating the king: attacking the king in such a way that the king cannot be defended no matter what the defending player moves. Note, though, that there is no rule that requires a player to defend a king which is being attacked. However, if he does not defend his king, the opponent is entirely free to capture it on the next move, thus winning the game. As in international chess, in practice most games end by resignation when one player realizes that he cannot escape checkmate.  File: gnushogi.info, Node: Draws, Next: Handicaps, Prev: Winning the game, Up: The rules of shogi 2.1.6 Draws ----------- There are very few draws in shogi; only about 1-2% of professional games end in a draw. One reason for this is that material can never be depleted as in chess, because captured pieces are constantly re-entering play as a consequence of the drop rule. In fact, most of the ways a game can be drawn in chess are not allowed in shogi: * Draws cannot be offered. * There is no fifty-move rule. * A stalemate counts as a win for the stalemater. Stated otherwise: if you can't move, you lose. * Perpetual check is illegal (see below). There are only two legal ways in which a draw can occur: 1. A position (including the pieces in hand) occurs 4 times with the same player to move (called "Sennichite"). However, if this is caused by consecutive checks (direct attacks on the King, threatening to capture it on the next move) by one side, the player giving these checks loses the game. In other words, perpetual check results in a loss for the attacker who recreates the same position the 4th time. 2. Both players have moved their King into the the promotion zone (or they cannot be prevented from doing so) and the Kings cannot be checkmated. A King who has entered the promotion zone is known as an "entering King"; due to the forward orientation of most shogi pieces, it is very hard to mate such a King. In that case the players may decide to count their pieces as follows: the King does not count, the Rook and Bishop count as 5 points, and all other pieces as one point. Promotion is disregarded. If both players have at least 24 points the game is a draw (called "Jishogi"). If a player has less, he loses the game. Of course, a player can refuse to count pieces when he still has mating chances or chances to gain material which would affect the outcome of the counting. There is no strict rule about what to do if this is not the case, but nonetheless a player refuses to count up (e.g. because he does not have enough points for a draw). It has been generally accepted that in such a case the game ends and the pieces are counted after one player has managed to get all his pieces protected in the promotion zone.  File: gnushogi.info, Node: Handicaps, Next: Notes for chess players, Prev: Draws, Up: The rules of shogi 2.1.7 Handicaps --------------- Unlike international chess, shogi has a well-established handicap system which is used when players of different strengths play against each other. Handicaps range from small to huge, which makes it possible for weak players to play against even very strong players and have an even chance of winning. Shogi players are ranked as follows: the weakest rank is around 15 "kyu", which represents a beginner. 14 kyu is higher than 15 kyu, 13 kyu is higher still, and so on until you get to 1 kyu. The next highest rank is 1 "dan", followed by 2 dan, 3 dan and so forth. The highest amateur rank is 6 dan; professionals go up to 9 dan. However, professional ranks are not the same as amateur ranks; a professional 1 dan is _much_ stronger than an amateur 1 dan. This system is similar to that used by go players (and also other Japanese sports such as karate). A handicap consists of the stronger player playing White and removing one or more pieces from his side of the board at the start of the game. These pieces are permanently removed from play; they are not in hand. The following is a list of the accepted handicaps, from weakest to strongest. The degree of the handicap, represented by the position in the list, represents the difference in rank between the two players for which the handicap is appropriate. These rules are taken from the books "Shogi for Beginners" by John Fairbairn and "The Art of Shogi" by Tony Hoskings (*note References and links::) and, I believe, represent current Japanese practice. 1. The stronger player removes his left lance (on 1a). 2. The players play a two-game match; in the first game the stronger player removes his left lance (on 1a), while in the second game he removes his bishop. 3. The stronger player removes his bishop. 4. The stronger player removes his rook. 5. The stronger player removes his rook and left lance. 6. The players play a two-game match; in the first game the stronger player removes his rook and left lance (on 1a), while in the second game he removes his rook and bishop. 7. The stronger player removes his rook and bishop. This is usually called a "two-piece" handicap. 8. The stronger player removes his rook, bishop, and both lances. This is called a "four-piece" handicap. 9. The stronger player removes his rook, bishop, both lances, and both knights. This is called a "six-piece" handicap. 10. The stronger player removes his rook, bishop, both lances, both knights, and both silvers. This is called an "eight-piece" handicap. Another advantage of playing handicap games is that the handicaps alter the optimal strategy for both players. For instance, handicaps all have their own opening lines which may bear little or no resemblance to those used in non-handicap shogi. This means that when learning handicap shogi, you are essentially learning completely new games which use the same equipment! The reader may wonder how on earth a player giving an eight-piece handicap, say, could possibly hope to win. Don't forget, though, that in shogi the opponent's pieces can be captured and then become part of one's own army. Thus, if the opponent plays badly enough, the number of pieces will soon even out.  File: gnushogi.info, Node: Notes for chess players, Prev: Handicaps, Up: The rules of shogi 2.1.8 Notes for chess players ----------------------------- Here are a few miscellaneous things that may confuse chess players. Some of these have been mentioned elsewhere, but they bear repeating. 1. There is no queen. 2. Pawns capture the same way they move. There is no initial two-space pawn move and no _en-passant_ move. 3. There is no special castling move. There _are_ a large number of possible defensive formations referred to as "castles" (*note Sample game::) but there is no need for special moves to create them. 4. A given piece can only promote to _one_ other kind of piece.  File: gnushogi.info, Node: Sample game, Next: Mating problems, Prev: The rules of shogi, Up: About shogi 2.2 Sample game =============== This game was annotated by Pieter Stouten (*note References and links::). I have made some minor corrections. Note that captures are denoted by the "x" symbol e.g. Rx3f and drops are denoted by the "*" symbol e.g. R*3f. Check is indicated by a "+" after the move, e.g. R3f+. I recommend you use a graphical interface to play along with this game. In XBoard or XShogi simply hit the "Force Moves" button after starting up, while in gnushogi enter the word "force" at the prompt. This will allow you to enter moves for both sides. Note also that the move numbering system used here is the chess-type system where one move means one move by each player. The Japanese count one move made by each player as two moves. -------------------------------------------------- Below you will find (the English translation of) an annotated game which was published in the Dutch Shogi magazine "81" and in the Dutch beginners booklet. It has proven to be a very useful game to explain some basic principles of Shogi. Also, it is a rather straightforward game compared to professional games where in most cases very diffuse middle game fights take place. Pieter Stouten, 14th May 1990. -------------------------------------------------- Black: Michael Trent (1-dan). White: David Murphy (2-dan). 1. P2f P3d 2. P2e B3c [ This move is necessary, as otherwise white can exchange pawns: 3. P2d Px2d 4. Rx2d. He would thus get a pawn in hand and open up his rook file. ] 3. P7f P4d [ White closes the bishop diagonal again. He plans to play ranging rook (the rook goes to 5b, 4b, 3 or 2b; a defensive strategy) and in that case he'd better avoid an exchange of bishops. One of the reasons is that he will have problems developing his pieces without leaving holes for bishop drops. ] 4. S4h R3b 5. P3f S4b 6. K6h K6b [ In general the rook plays an important role in the attacks. It is wise to move the king away from the area where the initial fights will be and both players act according to the Shogi proverb "keep the rook and king apart". ] 7. K7h K7b 8. P5f P5d 9. G4i-5h G4a-5b [ Both players use their second gold general to build their castle. ] 10. S6h [ In itself this move is not bad. However, it will become clear that black plans a quick attack and in that case it is wiser to omit this move. ] 10... S5c 11. P1f P1d [ The advance of the edge pawns must be timed very well. The remark at black's tenth move applies here too: this move is good if black wants to play a slow game, because it eliminates a future B1e. ] 12. P4f K8b 13. N3g S7b [ Black develops his knight in order to start an attack over the second, third and fourth files. White strengthens his king's position and awaits the attack. He aims at a counterattack as soon as black has broken through into the white camp. Probably white's breakthrough will take place later, but he has good compensation in the form of a stronger castle. This theme occurs very often in static rook versus ranging rook games. ] 14. P4e R4b [ Black starts his attack and white puts up a very passive defence. His rook has a hard task now to penetrate the black position. Moreover, he blocks his own bishop. It seems much better to start a counterattack with 14... P3e, later to be followed by B2b, B5a or Bx4d in order to use his rook more actively. ] 15. Px4d Sx4d 16. P*4e S5c [ 16... Sx4e is more active. A silver general is normally more valuable than a knight, but white gets two pawns in hand and black none, while the knight might come in handy for white too. ] 17. Bx3c+ Nx3c 18. P2d Px2d [ Black threatens to break through and white has to consider taking the pawn on 2d or starting a counterattack with Nx4e. If he chooses the latter, black can play Px2c+ followed by +P3c. The disadvantage is the black "tokin" (=promoted pawn) that white will get in his camp; the advantage is that it will cost black two more moves to promote his rook. Because white did not trust that the result after engaging in a "semeai" (=mutual attack) with 18...Nx4e would give a positive result, he captured the pawn on 2d. Making the right decision in moments like this often makes the difference between a win and a loss: miss one attacking chance and you will be forced to defend the whole game until the unavoidable defeat; on the other hand, an unsound attack can destroy all "aji" (=potential, meaning possibilities, threats) without getting anything in return. ] 19. Rx2d Nx4e 20. Nx4e Rx4e 21. R2a+ P*4g [ Now it becomes clear why black's 10. S6h was not good. Had this move been omitted, then white would not have had the time to play 13... S7b and after R2a+ the gold on 6a would hang. Thus black would have kept "sente" (=initiative). Instead of 21... P*4g, B*6d is a very good move, because after 22. P*2h black does not have a pawn in hand anymore and he is being threatened with the annoying 22... N*4f 23. G5g N3h+ 24. S4g +N4h also. Black can also counter 21... B*6d with 22. N*3g. White would then reply with 22... R4b 23. B*3c P*4g 24. Bx4b+ Sx4b. The white rook has played its role and instead of spending moves on saving it white starts to scatter black's defences by successive pawn drops on the fourth file: 25. Gx4g P*4f 26. G5g N*6e 27. G5h P4g+ 28. Gx4g P*4f. This analysis was provided by Kato Hifumi, 9-dan professional (the highest regular grade). Destroying the coherence of the enemy pieces (their shape) by dropping pawns is one of the most important Shogi techniques. With the actual move 21... P*4g white missed a good chance. ] 22. Sx4g P*4f 23. B*3g Px4g+ 24. +Rx6a +Px3g [ 23. B*3g seems pointless, but a closer look reveals that it is actually quite mean. On move 24 white cannot capture black's "Ryu" (=dragon =promoted rook) with his silver: 24... Sx6a 25. N*7d K7b 26. G*8b mate. By attacking the front of the white castle and threatening to mate him there, black has the chance to break down the white defences from the side. ] 25. +Rx5b S*6b [ Here 25... B*4d would be much better, because it is defensive and attacking at the same time. After e.g. 26. G*4c Bx9i+ 27. Gx5c black threatens 28. +Rx7b Kx7b 29. S*6a K8b 30. S*7a Kx7a 31. G*7b mate. White is one move quicker, however. He has the following beautiful "tsume" (mating sequence where every move is check): 27... N*8f 28. Px8f S*8g 29. Kx8g B*9h 30. K7h Bx8i+ 31. K8g +B8i-8h 32. K9f L*9e mate. This illustrates the sharpness of Shogi: one move can make the difference between winning and losing. ] 26. P*4f Rx4f [ This move eliminates white's last chances. 26... R4b 27. +Rx4b Sx4b 28. R*4a seems annoying, but after 28... B*3c 29. S7g B*3b white wins the rook and with his "tokin" on 3g there still is some hope. ] 27. N*6e +P4g [ White cannot defend anymore, so he starts a desperate attack. Black does not lose the right track, however. ] 28. Nx5c+ +Px5h 29. +Nx6b +Px6h 30. Gx6h N*8f 31. Px8f B*6i 32. Gx6i R4h+ 33. N*6h +Rx6h 34. Gx6h S*8g 35. Kx8g N*9e 36. K7h Resigns [ White resigns here, because after 36... B*8g 27. K7g his attack has petered out. ]  File: gnushogi.info, Node: Mating problems, Next: Shogi variants, Prev: Sample game, Up: About shogi 2.3 Mating problems =================== One good way to improve at shogi is to solve mating problems. There are several types of these problems, but the most common is called a "tsume-shogi" problem, or "tsume" problem for short. In a tsume problem, all pieces that are not on the board are assumed to be in the opponent's hand (except for your King, which is usually not shown). Every move you make must be check until the final checkmate. Your opponent may play any piece on the board or drop any of his pieces in hand in order to prevent the mate. In a properly constructed tsume problem, all of your pieces on the board and in hand must be essential to the solution. One consequence of this is that all of your pieces in hand must be played during the solution. There should only be one correct solution for the given number of moves. Tsume problems use Japanese-style move numbering; thus, a problem where you move (and give check), your opponent moves, and you move to give checkmate is called a three-mover. Here is a really trivial three-mover: 3 2 1 ----------------+ | | | | a ----------------+ | | | wK | b ----------------+ | | | | c ----------------+ | bN | | | d ----------------+ | | | | e ----------------+ | | bN | | f ----------------+ Black in hand: S, G Here, Black plays G*2b, White plays K1c, and Black plays G*1d mate. More typical tsume problems range from 5 moves to arbitrarily high numbers of moves, and they can be quite brain-busting. Tsume problems may seem artificial, but in the closing stages of the game where both players have a lot of pieces in hand, it is often necessary to give check at every move, or else your opponent will start a counterattack and will mate you before you mate him. A tsume problem is a worst-case scenario for the attacker: you have to mate your opponent even though he has every piece not on the board in hand, which means you have to develop sharp attacking skills. Many more tsume problems can be found on the internet; I particularly recommend Patrick Davin's "Shogi Nexus" (*note References and links::).  File: gnushogi.info, Node: Shogi variants, Next: Differences between shogi and chess, Prev: Mating problems, Up: About shogi 2.4 Shogi variants ================== Several historical variants of shogi exist. Most of these were invented before modern shogi (in some cases hundreds of years before), are much larger than modern shogi and are not played with drops. Thus, in many ways they are really more like giant chess games than like modern shogi. The only one of these games to have survived in Japan is Chu (middle) shogi, which is still played a little bit. Thanks to the efforts of George Hodges and John Fairbairn of the Shogi Association (two British shogi enthusiasts), these games were resurrected and rules and sets for them can still be purchased from George Hodges (*note References and links::). I hope to eventually extend GNU shogi so that it can play at least some of these games. There are also several non-historical variants of shogi; I don't know much about them but you can find information about them on the internet (*note References and links::). The historical variants include: 1. Tori (bird) shogi, played on a 7x7 board with 32 pieces in all; this is the only variant that is known to have been played with drops. 2. Wa shogi, played on an 11x11 board with 54 pieces. This game can be played with or without drops but the historical evidence favors the view that it was played without drops. However, most people who have tried it claim it is a much better game with drops, being even more intricate than standard shogi. 3. Chu (middle) shogi, played on a 12x12 board with 92 pieces. This was (and is) by far the most popular of the variants, and has 21 different kinds of pieces in the starting line-up alone (along with several others that appear upon promotion). Unlike modern shogi, there are a tremendous number of ranging pieces and the game is definitely not played with drops. There is also an amazing piece called the Lion which has a double king move and can capture two pieces at once! Chu shogi has a small but fanatical following, some of whom consider it better than modern shogi. 4. Dai (great) shogi, played on a 15x15 board with 130 pieces. Other than the larger board, this game is very similar to Chu shogi. 5. Tenjiku (exotic) shogi, played on a 16x16 board with 176 pieces. This game is possibly the most complex tactical game in existence. There are many astoundingly powerful pieces, including one (the Fire Demon) that can capture up to eight opposing pieces in a single move! Despite the size of the game, checkmates can occur very suddenly (and often very early on) if one player makes a wrong move. Tenjiku also has a small but fanatical following, one of whom (Colin Adams) has written a book on the game which is available for download at . 6. Dai-dai (great-great) shogi, played on a 17x17 board with 192 pieces. The opening setup alone has 64 different kinds of pieces! This game and the larger ones that follow sound pretty outlandish, but they have actually been played; a game of Dai-dai can supposedly be played in about 12 hours. 7. Maka-dai-dai (great-great-great) shogi, played on a 19x19 board with 192 pieces. For those for whom Dai-dai shogi is just too small :-) 8. Tai (grand) shogi, played on a 25x25 board with 354 pieces! Until recently, this was thought to be the biggest chess game ever devised, but now there is... 9. Kyoku tai (extremely grand?) shogi, played on a 36x36 board with 402 pieces. The rules for this have just been unearthed in an old Japanese book. Hopefully someone will soon organize a postal Kyoku tai shogi championship; maybe their distant ancestors could finish it :-) It is thought that the really huge games (Dai-dai and up) were never really played to any significant extent (gee, wonder why?) and were devised merely so that the creators could have the fun of inventing enormous games, amazing their friends and confounding their enemies. However, the games up to Tenjiku shogi at least appear to be quite playable, assuming one has the time. Many modern variants have also been devised, usually on small boards, and often by western people. Those include: 1. Mini Shogi, played on a 5x5 board with 12 pieces. Its rules are nearly identical to Standard Shogi, and GNU Shogi has some support for it. 2. Judkins Shogi, similar to Mini Shogi on a 6x6 board. 3. Cannon Shogi, played on a 9x9 board, adds pieces inspired by the Cannon found in Xiang Qi (chinese chess) 4. Sannin Shogi, a 3-player variant on an hexagonal board, with specific rules governing alliance between two players 5. Kyoto Shogi, Micro Shogi, and several others are much more different.  File: gnushogi.info, Node: Differences between shogi and chess, Prev: Shogi variants, Up: About shogi 2.5 Differences between shogi and chess ======================================= Some differences between shogi and international chess have been mentioned elsewhere in this document; I summarize them here for people who are interested in game comparisons. I won't try to deal with the thorny question of which game is "better" although my bias may have already come through :-) In fact, the drop rule makes the two games so different in character that arguing over which game is better is like comparing apples to oranges (you'd be better off comparing chess to Chu shogi (*note Shogi variants::). However, I believe that if you are a chess fan you'll really like shogi as well, and shogi is also popular with many people who don't particularly like chess. Here are the significant differences between chess and shogi: 1. In shogi, captured pieces become the property of the capturer and can re-enter play by being dropped onto almost any vacant square. In chess, captured pieces are out of the game. Thus, in shogi, piece exchanges complicate the play significantly while in chess they simplify it. 2. The shogi board is 9x9; the chess board is 8x8. 3. Shogi has five pieces with no counterpart in chess: the gold and silver generals, the lance, the promoted rook and the promoted bishop. Chess has one piece with no counterpart in shogi: the queen. The knight's move in shogi is much more restrictive than in chess. Pieces in shogi generally have a much smaller range of movement than in chess (unless they are in hand). 4. In shogi, all pieces except the gold general and the king can promote, but only to one kind of piece. Promotion is easier in shogi because the promotion zone is closer to the starting position of the pieces (especially pawns). In chess, only the pawn can promote, but it can promote to any other piece except the king. 5. In shogi, pawns capture the same way they move. There is no initial two-space pawn move and hence no _en-passant_ captures. In chess, pawns capture diagonally which means that opposing pawns can block each other. 6. In shogi, you only have one rook and one bishop. Note that the bishop is not restricted to only one "color" square (squares in shogi aren't colored, but never mind) because promoted bishops can also move one square orthogonally. 7. There is no special castling move in shogi. The term "castle" is used in shogi to denote a defensive formation consisting of (usually) three generals which protect the king. There are many such castles (about 40 or so have names). *Note Sample game::. 8. Draws are much rarer in shogi than in chess. Perpetual check is not allowed. Stalemate is a virtual impossibility, and is a loss for the stalematee. 9. Since pieces are never out of play in shogi, chess-type endgames involving only a few pieces do not occur. 10. Shogi games are generally longer than chess games (about 60-70 moves is typical). 11. Shogi has a well-developed handicap system which is in general use; chess does not. The effects of all these differences on play include (in my opinion): 1. Piece/pawn structures in chess are more rigid than in shogi. Pawns block each other and pawns, once advanced, cannot ever retreat. In shogi, you can repair the hole caused by a pawn advance by exchanging the pawn and dropping it back where you want it. Thus shogi is more fluid than chess and less "structural". 2. Counterattack is MUCH more common in shogi than in chess. Games typically end in mutual mating attacks, where each player is trying to checkmate the other player before being checkmated himself. This makes tempo incredibly important and also makes sacrificial play quite common. 3. Attacks involving only ranging pieces are more a feature of chess than of shogi. A shogi attack typically uses a ranging piece or pieces to support an attack by short-range pieces (especially generals). It is very rare to mate a king with a non-adjacent ranging piece in shogi since the player whose king is threatened can almost always interpose by dropping a piece.  File: gnushogi.info, Node: gnushogi, Next: References and links, Prev: About shogi, Up: Top 3 gnushogi ********** This section describes how to run the "gnushogi" program. SYNOPSIS gnushogi [ [[-]a] [-b bookfile] [-B binbookfile] [-C] [-h langfile] [-L langfile] [-r length] [-R] [-s pathname] [-l pathname] [-S binbooksize] [-t] [-c size] [-T size] [-v] [-x] [-X] arg1 arg2 ] DESCRIPTION GNU shogi (gnushogi) plays a game of japanese chess (shogi) against the user or it plays against itself. At startup gnushogi reads the binbook file if it is present. It then looks for a book file. If it is present it adds its contents to the binbook data. If the binbook file is writable a new combined binbook file is written. Gnushogi is a modified version of the gnuchess program. It has a simple alphanumeric board display, or it can be used with a graphical interface like XBoard under X Window, or Winboard under Windows. The program gets its opening moves from the file gnushogi.bbk which is located in a directory specified in the Makefile. To invoke the program type: 'gnushogi -C' simple curses based version 'gnushogi -X (or just gnushogi)' XBoard/XShogi compatible version 'gnushogi -R' raw test display version TIME CONTROLS If one argument is given, it is the search time per move in [minutes:]seconds. So gnushogi 30 will generate one move every 30 seconds, while gnushogi 5:00 will generate one move every 5 minutes. If two or more arguments are given, they will be used to set tournament time controls with the first argument of each pair being the number of moves and the second being the total clock time in minutes[:seconds]. Thus, entering gnushogi 60 5 will set the clocks for 5 minutes (300 seconds) for the first 60 moves, and gnushogi 30 3:30 will allow 3 minutes and 30 seconds for 30 moves. gnushogi 30 5 1 :30 will allow 5 minutes for the first 30 moves and 30 seconds for each move after that. Up to 4 pairs of controls may be specified. If no argument is given the program will prompt the user for level of play. BOOK The book gnushogi.tbk consists of a sequence of openings. An opening begins with a line starting with a # (the rest of the line is a comment). Following this is a series of moves in algebraic notation alternating between black and white separated by whitespace. A move may have a ? after it indicating this move should never be made in this position. Moves are stored as position:move so transpositions between openings can take place. HASHFILE The hashfile if created should be on the order of 4 megabytes; you can create such a hashfile by typing "gnushogi -c 22" (see below). This file contains positions and moves learned from previous games. If a hashfile is used the computer makes use of the experience it gained in past games. Tests run so far show that it plays no worse with the hashfile than without, but it is not clear yet whether it provides a real advantage. LEGAL MOVES Note: Piece letters are determined by the language file. What is specified here is the default (English). Once gnushogi is invoked, the program will display the board and prompt the user for a move. To enter a move, use the notation 7g7f where the first letter-number pair indicates the origin square and the second letter-number pair indicates the destination square. An alternative is to use the notation P7f where the first letter indicates the piece type (P,L,N,S,G,B,R,K). To promote append a + the type of the new piece to the move, as in 2d2c+ or P2c+. Note that you must use capital letters for the pieces by default. COMMAND-LINE OPTIONS '-a' Do not search on opponent's time. 'a' Do search on opponent's time. '-b BOOKFILE' Use bookfile for opening book. '-B BINBOOKFILE' Use binbookfile for binary opening book. '-c SIZE' Create a new HASHFILE. File size is 2^size entries of approximately 65+? bytes. '-C' Use curses-based display mode. '-h' Do not use hashfile. 'h' Do use hashfile. '-l PATHNAME' Pathname of the loadfile used with get or xget. '-L LANG' Use language lang from the file gnushogi.lang. If -L is not specified it uses the first language in the file. '-P PLYLEVELS' Number of plys to include in the binbookfile. For generating a binbookfile. '-r LENGTH' Rehash _length_ times in searching entries for position in transposition table. '-R' Use raw text display mode. This can be used for dumb terminals or for systems that don't have curses. '-s PATHNAME' Pathname of the save file to use with the save command. '-S SIZE' Size of binbookfile for memory based books. For creating a binbookfile. '-t' Show statistics for HASHFILE. '-T SIZE' Set the transposition table size to 2^size entries. '-v' Show version and patchlevel. '-x VALUE' Use value as the evaluation window xwndw. '-X' Use XBoard/XShogi display mode (the default). COMMANDS In addition to legal moves, the following commands can be entered at the gnushogi prompt. Note: command names are determined by the language file and may vary with the implementation. The default language is English. 'alg' allow algebraic input (not implemented). 'Awindow' change Alpha window (default score + 90). 'Bwindow' change Beta window (default score - 90). 'beep' toggles beeping after each move (default: on). 'bd' updates the current board position on the display. 'book' turns off use of the opening library. 'both' causes the computer to play both sides of a shogi game. 'black' causes the computer to play as White, if the computer was to move first. 'bsave' saves a game to disk as a book textfile. The program will prompt the user for a file name. 'gamein' toggles game mode time control. Assumes the time specified for time control is the time for a complete game. Input with the level command should be the game time and the expected number of moves in a game. go command must be given. 'coords' show coordinates on the display (visual only). 'contempt' allows the value of _contempt_ to be modified. 'debug' asks for a piece as color piece, as wb or bn, and shows its calculated value on each square. 'debuglevel' sets level of debugging output if compiled with debug options. 'depth' allows the user to change the search depth of the program. The maximum depth is 29 ply. Normally the depth is set to 29 and the computer terminates its search based on elapsed time rather than depth. If depth is set to (say) 4 ply, the program will search until all moves have been examined to a depth of 4 ply (with extensions up to 11 additional ply for sequences of checks and captures). If you set a maximum time per move and also use the depth command, the search will stop at the specified time or the specified depth, whichever comes first. 'easy' toggles easy mode (thinking on opponents time) on and off. The default is easy mode ON. If easy mode is disabled, the keyboard is polled for input every so often and when input is seen the search is terminated. It may also be terminated with a sigint. 'edit' allows the user to set up a board position. - # clear the board. - c toggle piece color. - . command will exit setup mode. - p3b place a pawn on 3b - p3b+ place a promoted pawn on 3b - p* place a pawn in hand (among the captured pieces) Pieces are entered by typing a letter (p,l,n,s,g,b,r,k) for the piece followed by the coordinate. Here, letter case is ignored. The usual warning about the language file applies. 'exit' exits gnushogi. 'first' tells the computer to move first. Computer begins searching for a move. (same as "go"). 'force' allows the user to enter moves for both sides. To get the program to play after a sequence of moves has been entered use the "black" or "white" commands. 'get' retrieves a game from disk. The program will prompt the user for a file name. 'go' tells the computer to move first. Computer begins searching for a move. (same as "first"). 'hash' use/don't use hashfile. 'hashdepth' allows the user to change the minimum depth for using the hashfile and the number of moves from the beginning of the game to use it. 'help' displays a short description of the commands and the current status of options. 'hint' causes the program to supply the user with its predicted move. 'level' allows the user to set time controls such as 60 moves in 5 minutes etc. In tournament mode, the program will vary the time it takes for each move depending on the situation. If easy mode is disabled (using the "easy" command), the program will often respond with its move immediately, saving time on its clock for use later on. 'list' writes the game moves and some statistics on search depth, nodes, and time to the file "shogi.lst". 'material' toggle material flag - draws on no pawns and both sides < rook. 'new' starts a new game. 'p' evaluates the board and shows the point score for each piece. The total score for a position is the sum of these individual piece scores. 'post' causes the program to display the principal variation and the score during the search. A score of 100 is equivalent to a 1 pawn advantage for the computer. 'quit' exits the game. 'random' causes the program to randomize its move selection slightly. 'rcptr' set recapture mode. 'remove' backout the last level for both sides. Equal to 2 undo's. 'reverse' causes the board display to be reversed. That is, the Black's pieces will now appear at the top of the board. 'rv' reverse board display. 'save' saves a game to disk. The program will prompt the user for a file name. 'switch' causes the program to switch places with the opponent and begin searching. 'test' performs some speed tests for MoveList and CaptureList generation, and ScorePosition position scoring for the current board. 'time' set computer's time remaining, intended for synchronizing clocks among multiple players. 'tsume' toggle tsume mode. In tsume mode, not all possible moves will be generated. If a king is in check, only moves that get the king out of check are generated. If the king is not in check, only moves that give check to the opponent's king are generated. 'undo' undoes the last move whether it was the computer's or the human's. You may also type "remove". This is equivalent to two "undo"'s (e.g. retract one move for each side). 'white' causes the computer to play as Black; if the computer is to move first the go command must be given. 'xget' read an XShogi position file. 'xsave' save as an XShogi position file. 'xwndw' change X window. The window around alpha/beta used to determine whether the position should be scored or just estimated. Note: this has _nothing_ to do with XBoard, XShogi or X Window; the terms are completely separate.  File: gnushogi.info, Node: References and links, Next: Acknowledgements, Prev: gnushogi, Up: Top 4 References and links ********************** There are very few English-language books for people learning shogi. The two I recommend are: 1. 'Shogi for Beginners, 2nd. Edition', by John Fairbairn. This is a superb beginner's book in every way, covering all phases of the game. It was out of print for a long time, but has now been reprinted and is available either from Kiseido () or from George Hodges (see below). 2. 'The Art of Shogi', by Tony Hoskings. This is one step up from the Fairbairn book. It covers a lot of ground, and is especially noteworthy for its detailed treatment of opening lines. You can order this book from Amazon.com's UK branch (). Another book you may find is 'Shogi: Japan's Game of Strategy' by Trevor Leggett. This book is very elementary and is somewhat outdated, having been published first in 1966. However, it does feature a paper shogi board and punch-out pieces, so if you want a really cheap shogi set you might pick this book up. It is still in print. Two books that are no longer in print but are definitely worth getting if you find them are 'Guide to Shogi Openings' and 'Better Moves for Better Shogi', both by Aono Teriuchi. They are published in a bilingual edition (English/Japanese) and are the only books on shogi in English written by a Japanese professional shogi player. John Fairbairn did the translation from Japanese to English. Shogi sets are available from: George F. Hodges P.O. Box 77 Bromley, Kent United Kingdom BR1 2WT George also sells equipment for all the historical shogi variants (*note Shogi variants::) (except for Kyoku tai shogi) and also sells back issues of the magazine "Shogi" which he published for 70 issues in the late 70's to late 80's. This magazine is STRONGLY recommended; it contains more information about shogi in English than you will ever find anywhere else. Here are some useful URLs: Pieter Stouten's shogi page: This is the main shogi-related site on the internet, with links to almost all the other sites. Roger Hare's shogi page: This has lots of information, including full rules to most of the shogi variants. Patrick Davin's Shogi Nexus: There's lots of cool stuff on this site; my favorite is the extensive collection of Tsume-shogi (mating) problems, both for beginners and more advanced players. Steve Evans' shogi page: Steve has written a program that plays almost all of the shogi variants, unfortunately it only runs on Windows :-( Hans Bodlaender's chess variant pages: This page has an almost unimaginable variety of rules for different chess variants, including many shogi variants (historical and non-historical). Wikipedia's shogi variant pages: Those pages contain a large number of variant rules, both ancient and modern.  File: gnushogi.info, Node: Acknowledgements, Next: Bugs, Prev: References and links, Up: Top 5 Acknowledgements ****************** I would like to thank the following people: * Matthias Mutz, who originally developed GNU shogi as a spin-off of GNU chess and who very kindly let me take over the maintenance of this very interesting project. * Richard Stallman and the Free Software Foundation, for creating an organization where anyone can contribute software for the common good of all, for making GNU/Linux possible, and especially for writing emacs and gcc, without which my working life would be intolerable. * Georges Hodges, for starting the Shogi Association in England, without which I would probably never have heard of shogi, for supplying shogi equipment, for publishing the excellent magazine "Shogi" (now sadly defunct), for personally answering all my silly questions by mail, and for being the ambassador of shogi to the West. * Pieter Stouten, for having the most comprehensive shogi site on the World Wide Web (), and for maintaining the shogi-l mailing list. Go to Pieter's web site for more information on subscribing to the list. Also thanks to everyone who contributes and has contributed to that list. * Matt Casters, for testing GNU shogi. Matt and I will be working together on improving the solution engine in future versions of this program.  File: gnushogi.info, Node: Bugs, Next: Index, Prev: Acknowledgements, Up: Top 6 Bugs ****** The motto of GNU shogi is "100% bug-free or you don't pay!" :-) In the extremely unlikely case (*ahem*) that you do find a bug, please report it to the bug tracker at . Also, feel free to post comments, complaints, out-and-out raves, suggestions and such to one of the mailing lists at .  File: gnushogi.info, Node: Index, Prev: Bugs, Up: Top 7 Index ******* [index] * Menu: * Acknowledgements: Acknowledgements. (line 6) * Books: References and links. (line 6) * Chu Shogi: Shogi variants. (line 6) * Dai Shogi: Shogi variants. (line 6) * Dai-dai Shogi: Shogi variants. (line 6) * Draws: Draws. (line 6) * Drops: Drops. (line 6) * gnushogi: gnushogi. (line 6) * Handicaps: Handicaps. (line 6) * Introduction: Introduction. (line 6) * Kyoku Tai Shogi: Shogi variants. (line 6) * Mailing lists: References and links. (line 6) * Maka-dai-dai Shogi: Shogi variants. (line 6) * Opening setup: The opening setup. (line 6) * Piece moves: The moves of the pieces. (line 6) * Piece promotion: Promotion of pieces. (line 6) * References: References and links. (line 6) * Rules: The rules of shogi. (line 6) * Sample game: Sample game. (line 6) * Shogi variants: Shogi variants. (line 6) * Shogi vs. Chess: Differences between shogi and chess. (line 6) * Tai Shogi: Shogi variants. (line 6) * Tenjiku Shogi: Shogi variants. (line 6) * Tori Shogi: Shogi variants. (line 6) * Variants: Shogi variants. (line 6) * Wa Shogi: Shogi variants. (line 6) * Web sites: References and links. (line 6) * Winning the game: Winning the game. (line 6)  Tag Table: Node: Top1095 Node: Introduction1549 Node: About shogi4758 Node: The rules of shogi7359 Node: The moves of the pieces9046 Node: The opening setup12213 Node: Promotion of pieces13753 Node: Drops15599 Node: Winning the game17859 Node: Draws18582 Node: Handicaps20992 Node: Notes for chess players24424 Node: Sample game25149 Node: Mating problems32505 Node: Shogi variants34769 Node: Differences between shogi and chess39834 Node: gnushogi44238 Node: References and links55693 Node: Acknowledgements59011 Node: Bugs60518 Node: Index61000  End Tag Table gnushogi-1.5pre/doc/Makefile.am0000644000175000017500000000224712363546414013450 00000000000000# # Documentation Makefile for GNU Shogi # # Copyright (c) 2013 Yann Dirson and the Free Software Foundation # # This file is part of GNU Shogi. # # GNU Shogi is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 1, or (at your option) # any later version. # # GNU Shogi is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Shogi; see the file COPYING. If not, write to # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. # info_TEXINFOS = gnushogi.texi AM_MAKEINFOHTMLFLAGS = --split=section dist_man_MANS = gnushogi.6 dist_doc_DATA = \ BOOKFILES \ shogi.rules \ tutorial1.gam \ tutorial2.gam dist_noinst_DATA = \ PORTING spell: tr '[A-Z]' '[a-z]' < $(srcdir)/gnushogi.texi | tr -cd '[A-Za-z0-9_ \012]' | \ tr -s '[ ]' '\012' | sort | uniq -c | sort -nr | spell | sort | uniq gnushogi-1.5pre/doc/shogi.rules0000644000175000017500000001272212363540323013571 00000000000000S H O G I R U L E S ==================== These are the rules of Shogi (Japanese chess), as distributed by the Shogi-l listserver. I have edited it slightly for clarity. -- Mike Shogi is a Japanese board game played by two players. The object of the game is to capture the opponent's King. Shogi is played on a nine-by-nine board. The vertical rows are called files, the horizontal ones ranks or just rows. Each player has twenty pieces: one King, two Gold Generals, two Silver Generals, two kNights, two Lances, one Rook, one Bishop and nine Pawns. The player moving up the board and making the first move is referred to as black and his opponent white, although in Shogi sets all pieces have the same colour. They are differentiated only in direction: pieces pointing away from a player are his. The pieces lie flat on the board and have their Japanese name written on them. THE MOVES --------- King: one step in any direction per move Gold General: one step per move any way except diagnoally backward (as a king but not diagonally backward) Silver General: one step per move forwards or diagonally (as a king but not sideways or vertically backward) Knight: one step to left or right, and two steps forward (the only piece which may jump over other pieces) Rook: moves vertically or horizontally any distance Bishop: moves diagonally any distance Lance: moves forward any distance Pawn: one step forward Apart from the King and the Gold General all pieces can promote. After promotion their moves are as follows: + Promoted Silver, promoted kNight, promoted Lance and promoted Pawn all move as a Gold. + The promoted Rook in addition to the moves of the unpromoted Rook can move one step in the diagonal directions. It either moves like a Rook or like a King. + The promoted Bishop in addition to the moves of the unpromoted Bishop can move one step horizontally or vertically. It either moves like a Bishop or like a King. PROMOTION --------- The three rows furthest away from a player are called the promotion zone. Apart from the King and the Gold, any piece can be promoted to a more powerful piece when it makes a move completely or partly in the promotion zone. So, when a piece moves into, out of or fully inside the promotion zone it may be promoted upon completion of its move. Promotion is optional, provided that the piece still can make a legal move in case it is not promoted: if a Pawn or a Lance move to the last row, or a Knight moves to either of the last two rows, it must be promoted. In Shogi sets promoting a piece is done by turning this piece upside down. Its promoted name is written on its other side. CAPTURING AND DROPPING PIECES ----------------------------- When one piece moves onto the same square as an opponent's piece, the opponent's piece is captured. All pieces capture in the same way that they move. Captured pieces become part of the capturer's force. In a later move, instead of moving a piece on the board, a player may put a piece that he has captured from his opponent back onto the board, in an empty square. This is called dropping a piece. Pieces are always dropped unpromoted: if a promoted piece is captured, it reverts to its unpromoted rank. Pieces may be dropped on any empty square on the board with only three restrictions: 1) After dropping a piece it must be able to make a legal move. This applies to Pawns, Knights or Lances. They may not be dropped onto a square from which they will never be able to move. 2) Attacking the King by dropping a Pawn on the square in front of him is not allowed if the King cannot prevent being captured on the following move. To use the Chess expression: checkmating the King with a Pawn drop is prohibited. 3) A pawn may only be dropped on a file (vertical row) if there is no other unpromoted pawn of the same player on that file. DRAWS ----- The game of Shogi has very few draws (roughly 1 percent), mainly because of the ability to drop pieces. Draws cannot be offered and can arise from two situations: 1) A position (including the pieces in hand) occurs 4 times with the same player to move ("Sennichite"). However, if this is caused by consecutive checks (direct attacks on the King, threatening to capture it on the next move) by one side, the player giving these checks loses the game. 2) Both players have moved their King into the the promotion zone (or they cannot be prevented to do so) and the Kings cannot be checkmated. In that case the players may decide to count their pieces where the King does not count, the Rook and Bishop count as 5 points, and all other pieces as one point. Promotion is disregarded. If both players have at least 24 points the game is a draw ("Jishogi"). If a player has less, he loses the game. Of course, a player can refuse to count pieces when he still has mating chances or chances to gain material which would affect the outcome of the counting. There is no strict rule about what to do if this is not the case, but nonetheless a player refuses to count up (e.g. because he does not have enough points for a draw). It has been generally accepted that in such a case the game ends and the pieces are counted after one player has managed to get all his pieces protected in the promotion zone. Chris Sterritt and Pieter Stouten, 12-th June 1990. Last revision 9-th October 1991 - Draws (Jishogi rule). gnushogi-1.5pre/ChangeLog0000644000175000017500000010615012363540323012410 000000000000002014-02-16 Yann Dirson * TODO: Note remaining known bugs 2014-02-16 Yann Dirson * NEWS, gnushogi/commondsp.c: Ensure the player names are refreshed after a switch (impacts Curses mode). 2014-02-16 Yann Dirson * gnushogi/rawdsp.c: EditBoard: use printf for conciseness 2014-02-16 Yann Dirson * NEWS, gnushogi/cursesdsp.c: Curses: parametrize hardcoded values for captures pieces, fixing minishogi display. 2014-02-16 Yann Dirson * NEWS, gnushogi/cursesdsp.c: Curses: shift board one char to the right to leave enough space for captures. There was not really enough space to display top player's captures correctly. 2014-02-16 Yann Dirson * NEWS, gnushogi/cursesdsp.c, gnushogi/rawdsp.c: EditBoard: display message on wrong input. 2014-02-16 Yann Dirson * NEWS, gnushogi/cursesdsp.c, gnushogi/rawdsp.c: EditBoard: fix error handling in piece setting. On invalid piece name, the code was anyway destroying any piece in the target location, and the whole logic was diluted. 2014-02-16 Yann Dirson * gnushogi/cursesdsp.c: Curses: move things around in EditBoard to free the message line. 2014-02-16 Yann Dirson * NEWS, gnushogi/cursesdsp.c: Curses: fix position of lower clock for minishogi. The hunt for hardcoded values goes on... 2014-02-16 Yann Dirson * NEWS, gnushogi/cursesdsp.c: Curses: avoid getting out of 80 columns when editing board. Now print user-provided chars on line following the long prompt. 2014-02-16 Yann Dirson * NEWS, gnushogi/cursesdsp.c: Curses: fix inverted column numbers display for minishogi. 2014-02-16 Yann Dirson * gnushogi/cursesdsp.c: Curses: use a macro for left margin of display 2014-02-15 Yann Dirson * gnushogi/cursesdsp.c, gnushogi/rawdsp.c: EditBoard: simplify loop logic by ending iterations early. 2014-02-15 Yann Dirson * gnushogi/cursesdsp.c, gnushogi/rawdsp.c: EditBoard: restructure loop for consistency. 2014-02-16 Yann Dirson * gnushogi/cursesdsp.c: EditBoard: resync Curses implementation with the Raw one. 2014-02-15 Yann Dirson * NEWS, gnushogi/commondsp.c, gnushogi/cursesdsp.c, gnushogi/gnushogi.h, gnushogi/rawdsp.c, gnushogi/util.c: Fix use of (COL|ROW)_NAME macros to compute numbers from names. The formula is reversible for the somewhat-standard default position notation, but that does not mean we should write silly things. As a proof, if that was needed, the formula necessary to support the xboard protocol is not reversible. 2014-02-05 Yann Dirson * doc/gnushogi.texi: Remove XShogi doc from the manual, and add information about available GUIs. 2014-02-05 Yann Dirson * Makefile.in, NEWS, configure.ac, doc/xshogi.6, xshogi/BUGS, xshogi/Makefile.in, xshogi/NEWS, xshogi/README, xshogi/README.xboard, xshogi/REMOTEHOSTS, xshogi/bitmaps.h, xshogi/eastern_bitmaps/bigblank.xbm, xshogi/eastern_bitmaps/bigblankR.xbm, xshogi/eastern_bitmaps/biglight.xbm, xshogi/eastern_bitmaps/bigsolid.xbm, xshogi/eastern_bitmaps/bigsolidR.xbm, xshogi/eastern_bitmaps/bigsolidR_l.xbm, xshogi/eastern_bitmaps/bigsolidR_m.xbm, xshogi/eastern_bitmaps/bigsolid_l.xbm, xshogi/eastern_bitmaps/bigsolid_m.xbm, xshogi/eastern_bitmaps/bishop.xbm, xshogi/eastern_bitmaps/bishopP.top.xbm, xshogi/eastern_bitmaps/bishopP.xbm, xshogi/eastern_bitmaps/bishopPR.top.xbm, xshogi/eastern_bitmaps/bishopPR.xbm, xshogi/eastern_bitmaps/bishopPR_l.top.xbm, xshogi/eastern_bitmaps/bishopPR_l.xbm, xshogi/eastern_bitmaps/bishopPR_m.top.xbm, xshogi/eastern_bitmaps/bishopPR_m.xbm, xshogi/eastern_bitmaps/bishopP_l.top.xbm, xshogi/eastern_bitmaps/bishopP_l.xbm, xshogi/eastern_bitmaps/bishopP_m.top.xbm, xshogi/eastern_bitmaps/bishopP_m.xbm, xshogi/eastern_bitmaps/bishopR.xbm, xshogi/eastern_bitmaps/bishopR_l.xbm, xshogi/eastern_bitmaps/bishopR_m.xbm, xshogi/eastern_bitmaps/bishop_l.xbm, xshogi/eastern_bitmaps/bishop_m.xbm, xshogi/eastern_bitmaps/gold.xbm, xshogi/eastern_bitmaps/goldR.xbm, xshogi/eastern_bitmaps/goldR_l.xbm, xshogi/eastern_bitmaps/goldR_m.xbm, xshogi/eastern_bitmaps/gold_l.xbm, xshogi/eastern_bitmaps/gold_m.xbm, xshogi/eastern_bitmaps/icon.xbm, xshogi/eastern_bitmaps/king.xbm, xshogi/eastern_bitmaps/kingR.xbm, xshogi/eastern_bitmaps/kingR_l.xbm, xshogi/eastern_bitmaps/kingR_m.xbm, xshogi/eastern_bitmaps/king_l.xbm, xshogi/eastern_bitmaps/king_m.xbm, xshogi/eastern_bitmaps/knight.xbm, xshogi/eastern_bitmaps/knightP.xbm, xshogi/eastern_bitmaps/knightPR.xbm, xshogi/eastern_bitmaps/knightPR_l.xbm, xshogi/eastern_bitmaps/knightPR_m.xbm, xshogi/eastern_bitmaps/knightP_l.xbm, xshogi/eastern_bitmaps/knightP_m.xbm, xshogi/eastern_bitmaps/knightR.xbm, xshogi/eastern_bitmaps/knightR_l.xbm, xshogi/eastern_bitmaps/knightR_m.xbm, xshogi/eastern_bitmaps/knight_l.xbm, xshogi/eastern_bitmaps/knight_m.xbm, xshogi/eastern_bitmaps/lance.xbm, xshogi/eastern_bitmaps/lanceP.xbm, xshogi/eastern_bitmaps/lancePR.xbm, xshogi/eastern_bitmaps/lancePR_l.xbm, xshogi/eastern_bitmaps/lancePR_m.xbm, xshogi/eastern_bitmaps/lanceP_l.xbm, xshogi/eastern_bitmaps/lanceP_m.xbm, xshogi/eastern_bitmaps/lanceR.xbm, xshogi/eastern_bitmaps/lanceR_l.xbm, xshogi/eastern_bitmaps/lanceR_m.xbm, xshogi/eastern_bitmaps/lance_l.xbm, xshogi/eastern_bitmaps/lance_m.xbm, xshogi/eastern_bitmaps/none.xbm, xshogi/eastern_bitmaps/none_l.xbm, xshogi/eastern_bitmaps/none_m.xbm, xshogi/eastern_bitmaps/pawn.xbm, xshogi/eastern_bitmaps/pawnP.xbm, xshogi/eastern_bitmaps/pawnPR.xbm, xshogi/eastern_bitmaps/pawnPR_l.xbm, xshogi/eastern_bitmaps/pawnPR_m.xbm, xshogi/eastern_bitmaps/pawnP_l.xbm, xshogi/eastern_bitmaps/pawnP_m.xbm, xshogi/eastern_bitmaps/pawnR.xbm, xshogi/eastern_bitmaps/pawnR_l.xbm, xshogi/eastern_bitmaps/pawnR_m.xbm, xshogi/eastern_bitmaps/pawn_l.xbm, xshogi/eastern_bitmaps/pawn_m.xbm, xshogi/eastern_bitmaps/rook.xbm, xshogi/eastern_bitmaps/rookP.top.xbm, xshogi/eastern_bitmaps/rookP.xbm, xshogi/eastern_bitmaps/rookPR.top.xbm, xshogi/eastern_bitmaps/rookPR.xbm, xshogi/eastern_bitmaps/rookPR_l.top.xbm, xshogi/eastern_bitmaps/rookPR_l.xbm, xshogi/eastern_bitmaps/rookPR_m.top.xbm, xshogi/eastern_bitmaps/rookPR_m.xbm, xshogi/eastern_bitmaps/rookP_l.top.xbm, xshogi/eastern_bitmaps/rookP_l.xbm, xshogi/eastern_bitmaps/rookP_m.top.xbm, xshogi/eastern_bitmaps/rookP_m.xbm, xshogi/eastern_bitmaps/rookR.xbm, xshogi/eastern_bitmaps/rookR_l.xbm, xshogi/eastern_bitmaps/rookR_m.xbm, xshogi/eastern_bitmaps/rook_l.xbm, xshogi/eastern_bitmaps/rook_m.xbm, xshogi/eastern_bitmaps/silver.xbm, xshogi/eastern_bitmaps/silverP.xbm, xshogi/eastern_bitmaps/silverPR.xbm, xshogi/eastern_bitmaps/silverPR_l.xbm, xshogi/eastern_bitmaps/silverPR_m.xbm, xshogi/eastern_bitmaps/silverP_l.xbm, xshogi/eastern_bitmaps/silverP_m.xbm, xshogi/eastern_bitmaps/silverR.xbm, xshogi/eastern_bitmaps/silverR_l.xbm, xshogi/eastern_bitmaps/silverR_m.xbm, xshogi/eastern_bitmaps/silver_l.xbm, xshogi/eastern_bitmaps/silver_m.xbm, xshogi/eastern_bitmaps/smallblank.xbm, xshogi/eastern_bitmaps/smallblankR.xbm, xshogi/eastern_bitmaps/smalllight.xbm, xshogi/eastern_bitmaps/smallsolid.xbm, xshogi/eastern_bitmaps/smallsolidR.xbm, xshogi/eastern_bitmaps/smallsolidR_l.xbm, xshogi/eastern_bitmaps/smallsolidR_m.xbm, xshogi/eastern_bitmaps/smallsolid_l.xbm, xshogi/eastern_bitmaps/smallsolid_m.xbm, xshogi/new_eastern_bitmaps/bigsolidR_l.xbm, xshogi/new_eastern_bitmaps/bigsolid_l.xbm, xshogi/new_eastern_bitmaps/bishopPR_l.xbm, xshogi/new_eastern_bitmaps/bishopP_l.xbm, xshogi/new_eastern_bitmaps/bishopR_l.xbm, xshogi/new_eastern_bitmaps/bishop_l.xbm, xshogi/new_eastern_bitmaps/goldR_l.xbm, xshogi/new_eastern_bitmaps/gold_l.xbm, xshogi/new_eastern_bitmaps/kingR_l.xbm, xshogi/new_eastern_bitmaps/king_l.xbm, xshogi/new_eastern_bitmaps/knightPR_l.xbm, xshogi/new_eastern_bitmaps/knightP_l.xbm, xshogi/new_eastern_bitmaps/knightR_l.xbm, xshogi/new_eastern_bitmaps/knight_l.xbm, xshogi/new_eastern_bitmaps/lancePR_l.xbm, xshogi/new_eastern_bitmaps/lanceP_l.xbm, xshogi/new_eastern_bitmaps/lanceR_l.xbm, xshogi/new_eastern_bitmaps/lance_l.xbm, xshogi/new_eastern_bitmaps/none_l.xbm, xshogi/new_eastern_bitmaps/pawnPR_l.xbm, xshogi/new_eastern_bitmaps/pawnP_l.xbm, xshogi/new_eastern_bitmaps/pawnR_l.xbm, xshogi/new_eastern_bitmaps/pawn_l.xbm, xshogi/new_eastern_bitmaps/rookPR_l.xbm, xshogi/new_eastern_bitmaps/rookP_l.xbm, xshogi/new_eastern_bitmaps/rookR_l.xbm, xshogi/new_eastern_bitmaps/rook_l.xbm, xshogi/new_eastern_bitmaps/silverPR_l.xbm, xshogi/new_eastern_bitmaps/silverP_l.xbm, xshogi/new_eastern_bitmaps/silverR_l.xbm, xshogi/new_eastern_bitmaps/silver_l.xbm, xshogi/new_eastern_bitmaps/smallsolidR_l.xbm, xshogi/new_eastern_bitmaps/smallsolid_l.xbm, xshogi/new_western_bitmaps/bishopPRW.xbm, xshogi/new_western_bitmaps/bishopPW.xbm, xshogi/new_western_bitmaps/bishopRW.xbm, xshogi/new_western_bitmaps/bishopW.xbm, xshogi/new_western_bitmaps/goldRW.xbm, xshogi/new_western_bitmaps/goldW.xbm, xshogi/new_western_bitmaps/kingRW.xbm, xshogi/new_western_bitmaps/kingW.xbm, xshogi/new_western_bitmaps/knightPRW.xbm, xshogi/new_western_bitmaps/knightPW.xbm, xshogi/new_western_bitmaps/knightRW.xbm, xshogi/new_western_bitmaps/knightW.xbm, xshogi/new_western_bitmaps/lancePRW.xbm, xshogi/new_western_bitmaps/lancePW.xbm, xshogi/new_western_bitmaps/lanceRW.xbm, xshogi/new_western_bitmaps/lanceW.xbm, xshogi/new_western_bitmaps/noneW.xbm, xshogi/new_western_bitmaps/pawnPRW.xbm, xshogi/new_western_bitmaps/pawnPW.xbm, xshogi/new_western_bitmaps/pawnRW.xbm, xshogi/new_western_bitmaps/pawnW.xbm, xshogi/new_western_bitmaps/rookPRW.xbm, xshogi/new_western_bitmaps/rookPW.xbm, xshogi/new_western_bitmaps/rookRW.xbm, xshogi/new_western_bitmaps/rookW.xbm, xshogi/new_western_bitmaps/silverPRW.xbm, xshogi/new_western_bitmaps/silverPW.xbm, xshogi/new_western_bitmaps/silverRW.xbm, xshogi/new_western_bitmaps/silverW.xbm, xshogi/parser.y, xshogi/scanner.l, xshogi/sysdeps.h, xshogi/western_bitmaps/bishopPRW.xbm, xshogi/western_bitmaps/bishopPW.xbm, xshogi/western_bitmaps/bishopRW.xbm, xshogi/western_bitmaps/bishopW.xbm, xshogi/western_bitmaps/goldRW.xbm, xshogi/western_bitmaps/goldW.xbm, xshogi/western_bitmaps/kingRW.xbm, xshogi/western_bitmaps/kingW.xbm, xshogi/western_bitmaps/knightPRW.xbm, xshogi/western_bitmaps/knightPW.xbm, xshogi/western_bitmaps/knightRW.xbm, xshogi/western_bitmaps/knightW.xbm, xshogi/western_bitmaps/lancePRW.xbm, xshogi/western_bitmaps/lancePW.xbm, xshogi/western_bitmaps/lanceRW.xbm, xshogi/western_bitmaps/lanceW.xbm, xshogi/western_bitmaps/noneW.xbm, xshogi/western_bitmaps/pawnPRW.xbm, xshogi/western_bitmaps/pawnPW.xbm, xshogi/western_bitmaps/pawnRW.xbm, xshogi/western_bitmaps/pawnW.xbm, xshogi/western_bitmaps/rookPRW.xbm, xshogi/western_bitmaps/rookPW.xbm, xshogi/western_bitmaps/rookRW.xbm, xshogi/western_bitmaps/rookW.xbm, xshogi/western_bitmaps/silverPRW.xbm, xshogi/western_bitmaps/silverPW.xbm, xshogi/western_bitmaps/silverRW.xbm, xshogi/western_bitmaps/silverW.xbm, xshogi/xshogi.c, xshogi/xshogi.h, xshogi/xshogifn.h: Remove XShogi from the source tree 2014-01-16 Yann Dirson * configure.ac: Bump version to "1.4.1+". 2014-01-14 Yann Dirson * ChangeLog, NEWS, README, configure.ac: Prepare v1.4.1 2014-01-14 Yann Dirson * AUTHORS: Update maintainership info in AUTHORS. 2014-01-14 Yann Dirson * Makefile.in, gnushogi/Makefile.in, gnushogi/attacks.c, gnushogi/book.c, gnushogi/book.h, gnushogi/commondsp.c, gnushogi/cursesdsp.c, gnushogi/cursesdsp.h, gnushogi/debug.h, gnushogi/dspwrappers.c, gnushogi/dspwrappers.h, gnushogi/eval.c, gnushogi/eval.h, gnushogi/genmove.c, gnushogi/globals.c, gnushogi/gnushogi.h, gnushogi/init.c, gnushogi/main.c, gnushogi/makepattern.c, gnushogi/opts.h, gnushogi/pat2inc.c, gnushogi/pattern.c, gnushogi/pattern.h, gnushogi/rawdsp.c, gnushogi/rawdsp.h, gnushogi/search.c, gnushogi/sizetest.c, gnushogi/tcontrl.c, gnushogi/util.c: Update copyright info for 2008 (minishogi patches) and recent developments. 2014-01-14 Yann Dirson * gnushogi/init-common.c, gnushogi/pattern-common.c: Add missing copyright info to *-common.c, added by the minishogi patches. 2014-01-14 Yann Dirson * gnushogi/pattern.c: Adjust comment to prevent licensecheck from considering pattern.c as generated 2014-01-14 Yann Dirson * doc/gnushogi.texi: Doc: mention 1.4.1 2014-01-14 Yann Dirson * doc/gnushogi.texi: Doc: more on shogi variants in general, and Mini Shogi in particular. 2014-01-12 Yann Dirson * configure.ac: Bump version to "1.4.1-rc1+". 2013-12-18 Yann Dirson * Makefile.in: Fix "make distclean" when there is no editor backup file to remove. 2013-12-18 Yann Dirson * NEWS, configure.ac: Prepare v1.4.1rc1. 2013-12-17 Yann Dirson * .gitignore, Makefile.in, configure.ac, misc/mkmakefile.mingw-on-cygwin, win32/config.h.in: Add build support for win32 on cygwin (gcc3). 2013-12-17 Yann Dirson * README.maint, TODO, configure.ac, gnushogi/Makefile.profile.in: Get rid of Makefile.profile, document flags to use in README.maint instead. We don't want to maintain Makefile.profile as a quasi-copy of main Makefile, that's not a good practice at all. 2013-12-17 Yann Dirson * gnushogi/pat2inc.c: Kill dead code in pat2inc. 2013-12-17 Yann Dirson * gnushogi/makepattern.c, gnushogi/pat2inc.c, gnushogi/pattern.c: Minor pat2inc code cleanups 2013-12-17 Yann Dirson * gnushogi/Makefile.in: Drop useless defines for pat2inc build. 2013-12-17 Yann Dirson * doc/Makefile.in, doc/{gnushogi.texinfo => gnushogi.texi}: Use .texi suffix, preferred to .texinfo. 2013-12-16 Yann Dirson * gnushogi/Makefile.in: Fix ordering of include dirs. Local headers first, then build dir, then src dir. 2013-12-16 Yann Dirson * Makefile.in: Minor makefile improvements 2013-12-15 Yann Dirson * gnushogi/opts.h: Move into opts.h the "mostly for hacking" remark from INSTALL file. 2013-12-05 Yann Dirson * .gitignore: Update .gitignore for doc/ dir. 2013-12-05 Yann Dirson * gnushogi/commondsp.c, gnushogi/cursesdsp.c, gnushogi/dspwrappers.c: #define _POSIX_C_SOURCE to get proper access to snprintf and vsnprintf. 2013-12-05 Yann Dirson * configure.ac, gnushogi/rawdsp.c: Use POSIX setvbuf in preference to BSD setlinebuf. This avoids implicit declaration of setlinebuf with GNU libc, which would have required to define _BSD_SOURCE just to get rid of, and is not an innocuous setting. Drop call to no-op AC_FUNC_SETVBUF_REVERSED at the same time. 2013-12-05 Yann Dirson * configure.ac: Fully quote autoconf macro arguments, as they should. 2013-12-05 Yann Dirson * configure.ac: Bump version to "1.4.1-rc0+". 2013-12-05 Yann Dirson * doc/Makefile.in: Generate HTML doc using makeinfo, instead of obsolecent texi2html 2013-11-07 Yann Dirson * NEWS, README, configure.ac: Prepare v1.4.1rc0. 2013-11-07 Yann Dirson * doc/gnushogi.texinfo: Update manual for maintainer, project communication, and plans. 2013-11-07 Yann Dirson * TODO: Update TODO: there are plans for v1.5, and things have been done. 2013-11-05 Yann Dirson * Makefile.in: Fix "make dist" not to include a recursive copy of the dist. 2013-11-05 Yann Dirson * doc/gnushogi.texinfo: Fix formatting of boards in texinfo doc. 2013-11-05 Yann Dirson * NEWS: Update NEWS file for upcoming 1.4.1. 2013-11-05 Yann Dirson * doc/gnushogi.6: Remove version number from manpage. It was not very useful there, and has been out of sync with the software version anyway. 2013-11-05 Yann Dirson * Makefile.in, gnushogi/Makefile.in, gnushogi/Makefile.profile.in, xshogi/Makefile.in: Remove unused obsolete version numbers from Makefiles. 2013-10-20 Yann Dirson * TODO: Take note of more cleanups to do. 2013-10-20 Yann Dirson * configure.ac, gnushogi/Makefile.in: Move hashfile definition from configure.ac into Makefile.in Like other similar defs... 2013-10-20 Yann Dirson * .gitignore, Makefile.in, configure.ac, gnushogi/Makefile.in, misc/gnuminishogi.tbk: Use configure --enable-minishogi to select build of gnuminishogi. At the same time, provide an empty gnuminishogi.tbk so things work more as they should. Only the patterns are still necessary to specify manually at this point. 2013-09-27 H.G. Muller * gnushogi/eval.c: Fix mini-Shogi out-of-bounds acces of board 2011-09-29 Yann Dirson * gnushogi/eval.c: Avoid looking at the game type to determine minishogi piece values. We don't know how to determine the game type anyway, and a previous patch disables its computation, but no need to compile dead code in this case. Another problem to look at is that "in_opening_stage" is surely badly tuned for MiniShogi, but the program seems to score better with current code that by telling there is opening stage. Flag FIXME's where applicable so some willing soul would know where to find things to improve for MiniShogi. 2011-09-28 Yann Dirson * gnushogi/eval.c: Disable GuessGameType() for MiniShogi. Game types for MiniShogi are surely different from the ones in Shogi, so this would require serious thought to get it right. Just pretend we don't know. 2011-09-28 Yann Dirson * gnushogi/eval.c: Fix ScorePosition() for MiniShogi. Gcc's stack-smashing protection combined with glibc's -D_FORTIFY_SOURCE detected with a segfault that we were using 9x9-board offsets on our 5x5 board. This patch abstracts the relevant hardcoded constants and provides correct values for MiniShogi. 2008-02-11 Yann Dirson * TODO, gnushogi/Makefile.in, gnushogi/init-common.c, gnushogi/init.c, gnushogi/makepattern.c, gnushogi/pat2inc.c, gnushogi/pattern-common.c, gnushogi/pattern.c, gnushogi/pattern.inc, misc/gnuminishogi.pat: Generate patterns.inc at build time. 2008-02-11 Yann Dirson * TODO, gnushogi/attacks.c, gnushogi/commondsp.c, gnushogi/cursesdsp.c, gnushogi/eval.c, gnushogi/genmove.c, gnushogi/globals.c, gnushogi/gnushogi.h, gnushogi/init.c: Initial attempt at minishogi. This preliminar minishogi takes the approach of conditional compilation, so I can focus on differences between shogi and minishogi. Those ifdef's are expected to progressively disappear as the support code is made generic enough to support the needs of both variants. 2013-10-20 Yann Dirson * Makefile.in, configure.ac, doc/{Makefile => Makefile.in}, gnushogi/Makefile.in: Fix various regression for building out of tree. Most notably, doc was never buildable out of tree, but the recent build enhancements did not take that into account. 2013-09-27 H.G. Muller * gnushogi/gnushogi.h, gnushogi/init.c, gnushogi/rawdsp.c: Windows port This patch makes GNU Shogi compilable with gcc under Cygwin, using the -mno-cygwin flag, so that it can run as a native Windows application, independent of Cygwin1.dll. The patch is fully conditional, based on defined(WIN32). YD: rebased onto recent refactorings 2013-11-03 Yann Dirson * configure.ac: Normalize configure --help using AS_HELP_STRING. 2013-11-03 Yann Dirson * configure.ac: Don't bail out if configure (without --with-curses) does not find libcurses. Only fail when --with-curses was requested and libcurses cannot be found. 2013-11-03 Yann Dirson * gnushogi/Makefile.in, gnushogi/Makefile.profile.in: Fix funny search-and-replace copyright typo. 2013-11-03 Yann Dirson * configure.ac, gnushogi/Makefile.in, gnushogi/commondsp.c, gnushogi/cursesdsp.c, gnushogi/gnushogi.h, gnushogi/main.c, gnushogi/pat2inc.c, gnushogi/rawdsp.c, gnushogi/sizetest.c, version.h, xshogi/Makefile.in, xshogi/xshogi.c: Use centralized version from configure.ac, drop use of separate patchlevel. 2013-11-03 Yann Dirson * gnushogi/Makefile.in, gnushogi/book.c, gnushogi/commondsp.c, gnushogi/cursesdsp.c, gnushogi/globals.c, gnushogi/gnushogi.h, gnushogi/init.c, gnushogi/main.c, gnushogi/pat2inc.c, gnushogi/rawdsp.c, gnushogi/search.c, gnushogi/util.c, misc/gnushogi.lng: Move strings back into source code, from .lng support. * there is no point in translating the protocol * if someone wants to translate the curses UI, this should be done with gettext 2013-10-23 Yann Dirson * gnushogi/cursesdsp.c, gnushogi/cursesdsp.h, gnushogi/dspwrappers.c, gnushogi/dspwrappers.h, gnushogi/gnushogi.h, gnushogi/rawdsp.c, gnushogi/rawdsp.h, gnushogi/tcontrl.c: Move ElapsedTime to tcontrl.c, now that there is a single implementation. 2013-10-23 Yann Dirson * gnushogi/cursesdsp.c, gnushogi/cursesdsp.h, gnushogi/dspwrappers.c, gnushogi/dspwrappers.h, gnushogi/rawdsp.c, gnushogi/rawdsp.h, gnushogi/search.c: Make UpdateClocks and input-polling dspwrappers-based too. Those things are the only thing called from ElapsedTime() to be different between Curses and Raw/X, and were not abstracted yet. The poll-based polling code was not called from within ElapsedTime(), which made it less frequently called, but that did not seem to be a problem. And it was redundant in Curses mode with the FIONREAD call. 2013-10-22 Yann Dirson * gnushogi/cursesdsp.c, gnushogi/cursesdsp.h, gnushogi/dspwrappers.c, gnushogi/dspwrappers.h, gnushogi/rawdsp.c, gnushogi/rawdsp.h: Fix regression with stdarg dspwrappers. 1be442641b610fa1b6172a38d9acffe2d22797b6 and 3f589711eb3ecc7644378d6a0f2f29bc4b4c7db9 are both broken, passing the va_list inside another va_list to poor unsuspecting backend implementations. 2013-10-19 Yann Dirson * gnushogi/makepattern.c: Fixed minor regression in makepatter. In 6cdb4afe21c8d0eb740a6a22a02a0adf922fddfc, I messed up a conditional causing an error message to be written even when we did find a pattern file. 2013-10-19 Yann Dirson * gnushogi/cursesdsp.c, gnushogi/gnushogi.h: Fix build of --with-curses mode. Broken by 6030715dffdadf4402dccf6a8bf9966cfab2be1d and not checked soon enough :( 2013-10-19 Yann Dirson * gnushogi/cursesdsp.c: Drop non-curses support from Curses_ElapsedTime. Similar to 58e443e7ec0d834fe75a9eda53f4cfaf7f8b106c, was a remnant from before 4a9acd2e4d21586f2af629ec44cd78c237dcd702. 2013-10-19 Yann Dirson * gnushogi/makepattern.c: Drop NOT_CURSES occurences from makepattern. Why on earth are we supposing that pat2inc would run in Curses mode one day ? 2013-10-19 Yann Dirson * gnushogi/commondsp.c, gnushogi/cursesdsp.c, gnushogi/cursesdsp.h, gnushogi/dspwrappers.c, gnushogi/dspwrappers.h, gnushogi/rawdsp.c, gnushogi/rawdsp.h: Convert more stuff from #ifdef to dspwrappers: SetupBoard. Not a very big problem since that function is not curses-only this time, but raw-only. But this is the natural continuation of the "nuke NOT_CURSES" movement. 2013-10-19 Yann Dirson * gnushogi/cursesdsp.c, gnushogi/cursesdsp.h, gnushogi/gnushogi.h: Stop exporting Curses-internal functions to everyone. Possible since cursesdsp is now self-contained. 2013-10-19 Yann Dirson * configure.ac, gnushogi/Makefile.in: Finish the --without-curses support. Now that all the silly problems refering to Curses-specific functions from unrelated places are all solved, we can spare linking cursesdsp when not required. 2013-10-19 Yann Dirson * gnushogi/rawdsp.c: Remove dead Curses-specific code from Raw_ElapsedTime() 2013-10-19 Yann Dirson * gnushogi/search.c: Remove useless explicit prototype for pow(). 2013-10-19 Yann Dirson * gnushogi/Makefile.in, gnushogi/Makefile.profile.in, gnushogi/cursesdsp.c, gnushogi/cursesdsp.h, gnushogi/dspwrappers.c, gnushogi/dspwrappers.h, gnushogi/gnushogi.h, gnushogi/rawdsp.c, gnushogi/rawdsp.h, gnushogi/sysdeps.c: Change ElapsedTime to a normal display function. The FIONREAD version is clearly tied to Curses, and the NOFIONREAD works corectly with xshogi/xboard as well as Raw. No reason for a separate mechanism. --without-curses now builds as expected. 2013-10-19 Yann Dirson * gnushogi/cursesdsp.c, gnushogi/rawdsp.c: Make spacing consistent in *dsp.c, kill unused global hidden between funcs. 2013-10-19 Yann Dirson * gnushogi/sysdeps.c: Factorize ElapsedTime implementations by restricting HAVE_GETTIMEOFDAY #ifdef's. (and take the best-looking one on cosmetic differences) 2013-10-19 Yann Dirson * gnushogi/commondsp.c, gnushogi/cursesdsp.c, gnushogi/cursesdsp.h, gnushogi/dspwrappers.c, gnushogi/dspwrappers.h, gnushogi/gnushogi.h, gnushogi/rawdsp.c, gnushogi/rawdsp.h: Fix ShowPrompt implementation across display drivers. 2013-10-17 Yann Dirson * gnushogi/commondsp.c, gnushogi/cursesdsp.c, gnushogi/cursesdsp.h, gnushogi/dspwrappers.c, gnushogi/dspwrappers.h, gnushogi/rawdsp.c, gnushogi/rawdsp.h: Convert more stuff from #ifdef to dspwrappers: GetString. Thin function is the first non-void one and shows the limits of the current macro set. Let's consider this stuff to be temporary. At least it finally allows to drop #include from commondsp. 2013-10-16 Yann Dirson * gnushogi/commondsp.c, gnushogi/cursesdsp.c, gnushogi/cursesdsp.h, gnushogi/dspwrappers.c, gnushogi/dspwrappers.h, gnushogi/rawdsp.c, gnushogi/rawdsp.h: Convert more stuff from #ifdef to dspwrappers: AlwaysShowMessage. 2013-10-16 Yann Dirson * gnushogi/commondsp.c, gnushogi/cursesdsp.c, gnushogi/cursesdsp.h, gnushogi/dspwrappers.c, gnushogi/dspwrappers.h, gnushogi/rawdsp.c, gnushogi/rawdsp.h: Provide a Raw version of ShowNodeCnt to avoid more #ifdef's. At the same time, nuking "#ifdef DYNAMIC_ZNODES" (dead code). 2013-10-16 Yann Dirson * gnushogi/commondsp.c: When in check, complain with the requested move. Looks like in xshogi mode we were complaining by explicitly using the algebraic notation, but apparently noone forces us to do so. 2013-10-15 Yann Dirson * gnushogi/commondsp.c, gnushogi/cursesdsp.c, gnushogi/cursesdsp.h, gnushogi/dspwrappers.c, gnushogi/dspwrappers.h, gnushogi/rawdsp.c, gnushogi/rawdsp.h: Add safeguard against buffer overflow when calling scanf. 2013-10-15 Yann Dirson * gnushogi/commondsp.c, gnushogi/cursesdsp.c, gnushogi/cursesdsp.h, gnushogi/dspwrappers.c, gnushogi/dspwrappers.h, gnushogi/rawdsp.c, gnushogi/rawdsp.h: Convert more stuff from #ifdef to dspwrappers. 2013-10-19 Yann Dirson * configure.ac: Configure: stop abusing AC_MSG_CHECKING, use correct idioms. 2013-10-14 Yann Dirson * gnushogi/commondsp.c, gnushogi/init.c, gnushogi/rawdsp.c, xshogi/xshogi.c: Finally get rid of that highly non-standard use of SIGINT. People will at last be able to Ctrl-C gnushogi :) 2013-10-14 Yann Dirson * gnushogi/search.c: Regularly check for user input when searching, to have a chance to catch EOF from engine. When an engine quits without terminating a searching gnushogi, it would continue to search and never realize there was no reason to continue. This is a poll-based implementation of what H.G.Muller wrote for WIN32 to circumvent the lack of UNIX signals there. 2013-10-14 Yann Dirson * gnushogi/commondsp.c, gnushogi/rawdsp.c: Detect EOF waiting for user input in xshogi and raw modes, and trigger exit. No idea why the raw implementation of ExitShogi() did not call exit(). Even after detecting EOF, we were thrown into a tight loop... 2013-10-13 Yann Dirson * gnushogi/commondsp.c, gnushogi/init.c, gnushogi/rawdsp.c, xshogi/xshogi.c: Restore SIGINT for stopping gnushogi when thinking. SIGINT is unfortunately part of the protocol inherited from gnuchess4, and is used by xboard as such. So this was not a proper fix for the original issue. This reverts commit 00e10bc4a760150665436b17c50abf264f28d435, "Don't intercept INT and QUIT signals, and use USR1 instead of QUIT for". 2013-10-14 Yann Dirson * configure.ac: Rename configure --with-xshogi to --enable-xshogi for correctness. 2013-10-08 Yann Dirson * Makefile.in, configure.ac: Start of a "make dist" target. The old one uses a script that was never published... 2013-10-08 Yann Dirson * .gitignore, Makefile.in, doc/Makefile, doc/gnushogi.html, doc/gnushogi.info, doc/gnushogi.info-1, doc/gnushogi.info-2, doc/gnushogi.ps, doc/gnushogi_1.html, doc/gnushogi_10.html, doc/gnushogi_11.html, doc/gnushogi_12.html, doc/gnushogi_13.html, doc/gnushogi_14.html, doc/gnushogi_15.html, doc/gnushogi_16.html, doc/gnushogi_17.html, doc/gnushogi_18.html, doc/gnushogi_19.html, doc/gnushogi_2.html, doc/gnushogi_20.html, doc/gnushogi_21.html, doc/gnushogi_22.html, doc/gnushogi_23.html, doc/gnushogi_24.html, doc/gnushogi_3.html, doc/gnushogi_4.html, doc/gnushogi_5.html, doc/gnushogi_6.html, doc/gnushogi_7.html, doc/gnushogi_8.html, doc/gnushogi_9.html, doc/gnushogi_abt.html, doc/gnushogi_ovr.html, doc/gnushogi_toc.html, doc/texinfo.tex: Rework doc-handing make rules and remove generated files from version control. Newer texinfo.tex was imported from texinfo 5.1. 2013-10-08 Yann Dirson * doc/Makefile, doc/make_fig1, doc/make_fig2: Remove hack previously used to insert diags into generated HTML. Useless since db5c540ff7e9dd176f797b50031141e2c2059456. 2013-10-08 Yann Dirson * autogen.sh: Don't cause autogen.sh to run configure. 2013-10-08 Yann Dirson * ChangeLog, README.maint: Initiate new ChangeLog using git2cl. 2013-10-08 Yann Dirson * ChangeLog => ChangeLog.old, NEWS: Start to fill NEWS, rotate pre-git logs to ChangeLog.old. 2013-10-08 Yann Dirson * doc/gnushogi.texinfo: Critical texinfo doc formatting fixes. * "@sp 1" everywhere look ugly today * ASCII rendering of boards requires @verbatim 2013-10-08 Yann Dirson * doc/gnushogi.texinfo: Use @ifnotex and not @ifinfo, or HTML does not get its ToC. 2013-10-08 Yann Dirson * doc/gnushogi.texinfo: Remove text of the GPL (v2) from texinfo doc, it did not format any more though TeX. 2013-09-30 Yann Dirson * gnushogi/Makefile.in, xshogi/Makefile.in: Honor LDFLAGS at link-time. 2013-09-29 Yann Dirson * configure.ac, gnushogi/dspwrappers.c, gnushogi/gnushogi.h, gnushogi/main.c: Allow configure --without-curses. Not finding libcurses was surely causing problems, we now also proceed cleanly in that case. 2013-09-29 Yann Dirson * gnushogi/dspwrappers.c: Remove excessive boilerplate duplication from dspwrappers. 2013-09-29 Yann Dirson * .gitignore: Add .gitignore file 2013-09-29 Yann Dirson * configure.ac: Clarify configure options that only relate to xshogi 2013-10-03 Yann Dirson * gnushogi/Makefile.in, gnushogi/Makefile.profile.in, gnushogi/attacks.c, gnushogi/book.c, gnushogi/book.h, gnushogi/commondsp.c, gnushogi/cursesdsp.c, gnushogi/cursesdsp.h, gnushogi/debug.h, gnushogi/dspwrappers.c, gnushogi/dspwrappers.h, gnushogi/eval.c, gnushogi/eval.h, gnushogi/genmove.c, gnushogi/globals.c, gnushogi/gnushogi.h, gnushogi/init.c, gnushogi/main.c, gnushogi/makepattern.c, gnushogi/opts.h, gnushogi/pat2inc.c, gnushogi/pattern.c, gnushogi/pattern.h, gnushogi/rawdsp.c, gnushogi/rawdsp.h, gnushogi/search.c, gnushogi/sizetest.c, gnushogi/sysdeps.c, gnushogi/tcontrl.c, gnushogi/util.c, version.h: Restore previous copyright information that got removed by error. This reverts part of commit 82b026e6376b640a4d3409a461dd6bd83708e33e, which changed too much of the copyright headers when changing license to GPL3. 2011-09-29 Yann Dirson * gnushogi/eval.c: Fix another hardcored 9x9-board hardcoded value. 2008-02-11 Yann Dirson * gnushogi/commondsp.c, gnushogi/gnushogi.h, gnushogi/init.c: Document internal APIs. 2008-02-11 Yann Dirson * gnushogi/commondsp.c, gnushogi/cursesdsp.c, gnushogi/eval.c, gnushogi/genmove.c, gnushogi/gnushogi.h, gnushogi/init.c, gnushogi/rawdsp.c, gnushogi/util.c: Parametrize more hardcoded contants. 2008-02-11 Yann Dirson * gnushogi/gnushogi.h: Use enums. 2008-02-11 Yann Dirson * gnushogi/Makefile.in, gnushogi/gnushogi.h, xshogi/Makefile.in: Add support for building gnushogi and xshogi out of source tree. 2011-09-27 Yann Dirson * gnushogi/book.c, gnushogi/commondsp.c, gnushogi/main.c, gnushogi/rawdsp.c: Deal with warnings raised by -Wformat-security. 2009-08-03 Stijn van Drongelen * gnushogi/rawdsp.c: Fixes segfault in gnushogi when asking for help. Closes Debian Bug#434139. 2008-02-11 Yann Dirson * gnushogi/pattern.c, gnushogi/pattern.h: Statify functions not used outside their compilation unit. 2008-02-11 Yann Dirson * gnushogi/commondsp.c, gnushogi/init.c, gnushogi/rawdsp.c, xshogi/xshogi.c: Don't intercept INT and QUIT signals, and use USR1 instead of QUIT for communication. This braindead use of SIGINT causes problem when a frontend is interrupted with Ctrl-C: if gnushogi is waiting for input, it would enter a tight loop trying to read stdin, eating 100% CPU. 2008-01-18 Yann Dirson * gnushogi/eval.c, gnushogi/search.c: Fix integer overflow caused by bad use of binary operator. Guess this may make the AI more accurate :) Problem caught by gcc: ../../gnushogi/search.c: In function 'search': ../../gnushogi/search.c:887: warning: overflow in implicit constant conversion A quick audit only revealed a place where another logical AND was tested using a curious idiom, so let's make it consistent at the same time. 2008-01-18 Yann Dirson * gnushogi/sysdeps.c: Do not attempt to outguess system headers by (re)defining errno. Recent glibc define error as a cpp macro expanding to a function call. Thus, "extern int errno" should cause a link-time undefined symbol when errno.h is not included. Here it is, and gcc complains with the following cryptic warning: ../../gnushogi/sysdeps.c: In function 'ElapsedTime_FIONREAD': ../../gnushogi/sysdeps.c:97: warning: function declaration isn't a prototype 2008-01-18 Yann Dirson * gnushogi/pat2inc.c: Fix a function prototype. 2012-05-20 Yann Dirson * Add missing info headers gnushogi-1.5pre/NEWS0000644000175000017500000000655012364540030011334 00000000000000GNU shogi news -------------- Changes in version 1.5.0 (unreleased): * XBoard protocol support, enabling the use of XBoard as a graphical interface, officially deprecating XShogi. * The gnuminishogi binary is now built by alongside gnushogi, no need to play with --enable-minishogi any more. * Build system switched from pure autoconf to automake * Support for cross-compilation using standard "./configure --host=...", including building windows binaries (both 32bit and 64bit) using the gcc-mingw toolchain Changes in version 1.4.3 (unreleased): * Fixed a bug with forced promotion of pawns in minishogi. * Fix support for parallel build. * Minor code cleanups. Changes in version 1.4.2 (02/2014): * XShogi is no longer included in the GNU Shogi source, it is available as a separate source archive. * Fixes for edit mode: - fixed clobbering of board on invalid input - display a message on wrong input * Fixed Curses mode display: - reversed column number for MiniShogi - clock and captures position for MiniShogi - refresh display after "switch" to get player names updated - layout fixes, notably when using only 80 columns * Minor code cleanups. Changes in version 1.4.1 (01/2014): * Initial support for the MiniShogi variant, for now as a separate executable built using "./configure --enable-minishogi". * Support for building without the curses UI. * Preliminary win32 support: can be built on cygwin with gcc3, in the win32 directory. * Build system enhancements. * Bug fixes. Changes in version 1.4.0 (03/2012): * Main change is the license switch to GPL3. * Project is now being maintained on a git repository. * Bug fixes. Changes in version 1.3.2 (07/2004): * configure.in has been renamed to configure.ac * A number of small fixes were added to make the program compile and run correctly on modern Linuxes. Changes in version 1.3.1 (07/2001): * New piece bitmaps for both westernized and Japanese piece sets, courtesy of Bernhard Maerz. Changes in version 1.3 (07/1999): * xshogi has been merged into the gnushogi source tree and build process. * gnushogi is now only one executable, instead of three (one each for the raw text interface, the xshogi interface, and the curses interface). The three interfaces are still there; you select between them using a command-line option: "gnushogi -C" for the curses interface, "gnushogi -R" for the raw text interface, and "gnushogi -X" or just "gnushogi" for the xshogi interface. Making the xshogi interface the default makes it easier for xshogi to invoke gnushogi (translation: I couldn't be bothered figuring out why this was the case, so I just left it that way). * The gnushogi and xshogi source code has been thoroughly cleaned up and ANSIfied. Several files have been renamed. Makefiles have also been cleaned up considerably, but you don't need to care about this, because... * Building GNU shogi and xshogi now uses a configure script generated by autoconf. This should increase portability and make compilation much easier. * There is now fairly extensive documentation in texinfo form, which has been used to generate info, postscript, and html versions of the documentation. The man page is included in the texinfo file. The (separate) man pages have been updated to deal with the new command-line options for gnushogi. This file starts with GNU Shogi 1.3 (07/01/1999). gnushogi-1.5pre/ChangeLog.old0000644000175000017500000000467212363540323013173 00000000000000This ChangeLog covers the pre-git era, from GNU Shogi 1.0 patchlevel 11 (04/07/1993) up to 1.4.0. version 1.4.0 03/2012 License change to GPL3. version 1.3.2 07/2004 Numerous little fixes to keep the program working on modern Linuxes. version 1.3.1 07/2001 New piece bitmaps (westernized and Japanese). version 1.3 06/1999 gnushogi is now only one executable. Merged xshogi into the gnushogi source tree. Renamed several files. Cleaned up the source code and Makefile. Added a configure script. Added texinfo documentation. version 1.2 patchlevel 2 -> version 1.2 patchlevel 3 ../05/1995 correct connection to xshogi correct creation of binary book file better support of unsigned characters version 1.1 patchlevel 2 -> version 1.2 patchlevel 1 version 1.2 patchlevel 1 -> version 1.2 patchlevel 2 13/09/1994 change 'reachedGameCnt' from small_short to short in "pattern.h" change "dspcom.c" for Illegal move support of xshogi 24/09/1994 change "genmove.c" in order to allow "stupid" non-promotion moves change "dspcom.c" in order to protocol "stupid" moves version 1.1 patchlevel 2 -> version 1.2 patchlevel 1 ../09/1994 several changes to evaluation functions and move generation; language file and pattern file are made internal version 1.1 patchlevel 1 -> version 1.1 patchlevel 2 10/06/1993 correcting bug: MakeMove no longer destroys the node->flags 07/11/1993 changes according to GnuChess 4.0pl62; introducing "IsCheckmate" in order to forbid checkmates by dropping a pawn (illegal move); correcting bug: UnmakeMove no longer destroys the node->flags (especially the "exact" flag) 05/11/1993 enabling draw by repetition detection 04/29/1993 correcting "save game" and "get game"; introducing a "tsume" mode, which allows gnushogi especially search for forced checkmates version 1.0 patchlevel 11 -> version 1.1 patchlevel 1 04/22/1993 deep search cut in genmoves.c 04/20/1993 enable pattern related scoring in opening stage 04/15/1993 tuning "eval.c" 04/14/1993 correction for the "abs" function in "init.c" 04/10/1993 switches SAVE_PTYPE_DISTDATA and SAVE_DISTDATA for optional space reductions. gnushogi-1.5pre/config.sub0000755000175000017500000010563412363550544012635 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-05-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: gnushogi-1.5pre/configure.ac0000644000175000017500000000502012364540501013115 00000000000000# ------------------------------------------------------------ # GNU shogi and xshogi configuration script. # ------------------------------------------------------------ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) AC_INIT([gnushogi],[1.5pre],[https://savannah.gnu.org/bugs/?group=gnushogi]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([gnushogi/gnushogi.h]) AC_CONFIG_HEADERS(config.h) AM_MAINTAINER_MODE ########## AC_MSG_NOTICE([C compiler]) AC_PROG_CC AC_CANONICAL_BUILD AC_PROG_INSTALL AM_PROG_CC_C_O ########## AC_MSG_NOTICE([libs]) # curses AC_ARG_WITH([curses], [AS_HELP_STRING([--with-curses], [enable curses UI (default: yes if available)])], [], [with_curses=check]) LIBCURSES= AS_IF([test "x$with_curses" != xno], [AC_CHECK_LIB([curses], [clrtoeol], [AC_SUBST([LIBCURSES], [-lcurses]) AC_SUBST([CURSESDSP], [gnushogi-cursesdsp.o]) AC_SUBST([CURSESDSPMINI], [gnuminishogi-cursesdsp.o]) AC_DEFINE([HAVE_LIBCURSES], [1], [Define if you have lib]) ], [AS_IF([test "x$with_curses" = xyes], [AC_MSG_ERROR( [--with-curses was given, but test for curses failed])])], [-ltermcap])]) # other libraries. AC_CHECK_LIB([m], [pow]) AC_CHECK_LIB([termcap], [tgoto]) ########## # C compiler warnings. if [[ $ac_cv_c_compiler_gnu = yes ]] then WARNINGS="-Wall -Wno-implicit-int -Wstrict-prototypes" CEXTRAFLAGS="-fsigned-char -funroll-loops" else # Who knows what warnings your compiler uses? WARNINGS= CEXTRAFLAGS= fi AC_SUBST(WARNINGS) AC_SUBST(CEXTRAFLAGS) ########## AC_MSG_NOTICE([header files]) AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/file.h sys/ioctl.h]) AC_CHECK_HEADERS([sys/param.h sys/time.h unistd.h]) AC_CHECK_HEADERS(errno.h) AC_HEADER_TIME ########## AC_MSG_NOTICE([typedefs]) AC_C_CONST AC_HEADER_STDBOOL AC_C_INLINE AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM ########## AC_MSG_NOTICE([compiler characteristics]) AC_CHECK_SIZEOF(long) ########## AC_MSG_NOTICE([library functions]) AC_PROG_GCC_TRADITIONAL AC_TYPE_SIGNAL AC_CHECK_FUNCS([gettimeofday memset pow]) AC_CHECK_FUNCS([strchr strerror strrchr strstr strtol]) AC_CHECK_FUNCS([memcpy bcopy]) AC_CHECK_FUNCS([setvbuf setlinebuf]) ########## # don't build pat2inc when cross-compiling, we don't need it if test "$cross_compiling" = no; then AC_SUBST([PAT2INC], [pat2inc]) AC_SUBST([PAT2INCEXE], [pat2inc$EXEEXT]) fi ########## AC_CONFIG_FILES([Makefile gnushogi/Makefile doc/Makefile]) AC_OUTPUT gnushogi-1.5pre/config.h.in0000644000175000017500000000770612364540720012672 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the `bcopy' function. */ #undef HAVE_BCOPY /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have lib */ #undef HAVE_LIBCURSES /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `termcap' library (-ltermcap). */ #undef HAVE_LIBTERMCAP /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `pow' function. */ #undef HAVE_POW /* Define to 1 if you have the `setlinebuf' function. */ #undef HAVE_SETLINEBUF /* Define to 1 if you have the `setvbuf' function. */ #undef HAVE_SETVBUF /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t gnushogi-1.5pre/gnushogi/0000755000175000017500000000000012364540720012540 500000000000000gnushogi-1.5pre/gnushogi/search.c0000644000175000017500000011447512364540030014077 00000000000000/* * FILE: search.c * * ---------------------------------------------------------------------- * Copyright (c) 1993, 1994, 1995 Matthias Mutz * Copyright (c) 1999 Michael Vanier and the Free Software Foundation * Copyright (c) 2008, 2013, 2014 Yann Dirson and the Free Software Foundation * * GNU SHOGI is based on GNU CHESS * * Copyright (c) 1988, 1989, 1990 John Stanback * Copyright (c) 1992 Free Software Foundation * * This file is part of GNU SHOGI. * * GNU Shogi is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 3 of the License, * or (at your option) any later version. * * GNU Shogi is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with GNU Shogi; see the file COPYING. If not, see * . * ---------------------------------------------------------------------- * */ #include "gnushogi.h" short background = 0; static short DepthBeyond; unsigned short PrVar[MAXDEPTH]; extern short recycle, ISZERO; extern void FlagString(unsigned short flags, char *s); #ifdef NULLMOVE short null; /* Null-move already made or not */ short PVari; /* Is this the PV */ #endif short zwndw; /* ............ MOVE GENERATION & SEARCH ROUTINES .............. */ /* * Check for draw by fourfold repetition * (same side, same captures, same board). * WARNING: this is not save (sp? safe?) yet due to possible hash collisions. */ short repetition() { short i, cnt = 0; #ifndef NOREPETITION struct GameRec *g; if (GameCnt > Game50 + 6) { for (i = GameCnt - 1; i >= Game50; i -= 2) { g = &GameList[i]; if (g->hashkey == hashkey && g->hashbd == hashbd) cnt++; } } #endif return cnt; } int plyscore, globalscore; /* * Find the best move in the tree between indexes p1 and p2. Swap the best * move into the p1 element. */ int pick(short p1, short p2) { struct leaf *p, *q, *r, *k; short s0; struct leaf temp; k = p = &Tree[p1]; q = &Tree[p2]; s0 = p->score; for (r = p + 1; r <= q; r++) { if ((r->score) > s0) { s0 = r->score; p = r; } } if (p != k) { temp = *p; *p = *k; *k = temp; return true; } return false; } int bookflag = false; int Jscore = 0; int TCcount; long TCleft = 0; /* * Select a move by calling function search() at progressively deeper ply * until time is up or a mate or draw is reached. An alpha-beta window of * -Awindow to +Bwindow points is set around the score returned from the * previous iteration. If Sdepth != 0 then the program has correctly * predicted the opponents move and the search will start at a depth of * Sdepth + 1 rather than a depth of 1. */ void SelectMove(short side, SelectMove_mode iop) { static short i, tempb, tempc, tempsf, tempst, xside, rpt; static short alpha, beta, score; static struct GameRec *g; short sqking, in_check, blockable; #ifdef BOOKTEST printf("hashbd = %ld (hashkey >> 16)|side = %d\n", hashbd, (hashkey >> 16)|side); #endif flag.timeout = false; flag.back = false; flag.musttimeout = false; xside = side ^ 1; #if ttblsz recycle = (GameCnt % rehash) - rehash; #endif ExaminePosition(side); /* if background mode set to infinite */ if (iop == BACKGROUND_MODE) { background = true; /* if background mode set response time to infinite */ ResponseTime = 9999999; } else { background = false; /* [HGM] with ponder on we did not switch back to foreground mode??? */ player = side; SetResponseTime(side); } #ifdef QUIETBACKGROUND if (!background) #endif /* QUIETBACKGROUND */ dsp->ShowResponseTime(); ExtraTime = 0; score = ScorePosition(side); #ifdef QUIETBACKGROUND if (!background) #endif /* QUIETBACKGROUND */ dsp->ShowSidetoMove(); #ifdef QUIETBACKGROUND if (!background) #endif /* QUIETBACKGROUND */ dsp->SearchStartStuff(side); #ifdef HISTORY array_zero(history, sizeof_history); #endif FROMsquare = TOsquare = -1; PV = 0; if (iop == FOREGROUND_MODE) hint = 0; /* * If the last move was the hint, select the computed answer to the * hint as first move to examine. */ #if MAXDEPTH > 3 if (GameCnt > 0) { SwagHt = (GameList[GameCnt].gmove == PrVar[2]) ? PrVar[3] : 0; } else #endif SwagHt = 0; for (i = 0; i < MAXDEPTH; i++) PrVar[i] = killr0[i] = killr1[i] = killr2[i] = killr3[i] = 0; /* set initial window for search */ if (flag.tsume) { alpha = -(SCORE_LIMIT + 999); beta = SCORE_LIMIT + 999; } else { alpha = score - ((computer == white) ? BAwindow : WAwindow); beta = score + ((computer == white) ? BBwindow : WBwindow); } rpt = 0; TrPnt[1] = 0; root = &Tree[0]; sqking = PieceList[side][0]; in_check = (board[sqking] == king) ? SqAttacked(sqking, side^1, &blockable) : false; MoveList(side, 1, in_check, blockable); for (i = TrPnt[1]; i < TrPnt[2]; i++) { if (!pick(i, TrPnt[2] - 1)) break; } /* Can I get a book move? */ if (flag.regularstart && Book) { flag.timeout = bookflag = OpeningBook(&hint); if (TCflag) ResponseTime += ResponseTime; } /* Zero stats for hash table. */ reminus = replus = 0; GenCnt = NodeCnt = ETnodes = EvalNodes = HashCnt = FHashAdd = HashAdd = FHashCnt = THashCol = HashCol = 0; globalscore = plyscore = score; Jscore = 0; zwndw = 20; /********************* main loop ********************************/ Sdepth = (MaxSearchDepth < (MINDEPTH - 1)) ? MaxSearchDepth : (MINDEPTH - 1); while (!flag.timeout) { /* go down a level at a time */ Sdepth++; #ifdef NULLMOVE null = 0; PVari = 1; #endif /* terminate search at DepthBeyond ply past goal depth */ if (flag.tsume) DepthBeyond = Sdepth; else #if defined SLOW_CPU DepthBeyond = Sdepth + ((Sdepth == 1) ? 3 : 5); #else DepthBeyond = Sdepth + ((Sdepth == 1) ? 7 : 11); #endif # ifdef QUIETBACKGROUND if (!background) #endif /* QUIETBACKGROUND */ dsp->ShowDepth(' '); /* search at this level returns score of PV */ score = search(side, 1, Sdepth, alpha, beta, PrVar, &rpt); /* save PV as killer */ for (i = 1; i <= Sdepth; i++) killr0[i] = PrVar[i]; /* low search failure re-search with (-inf, score) limits */ if (score < alpha) { reminus++; #ifdef QUIETBACKGROUND if (!background) #endif /* QUIETBACKGROUND */ dsp->ShowDepth('-'); if (TCflag && TCcount < MAXTCCOUNTR) { if (hard_time_limit) ExtraTime += (MAXTCCOUNTR - TCcount) * TCleft; else ExtraTime += (8 * TCleft); TCcount = MAXTCCOUNTR - 1; } score = search(side, 1, Sdepth, -(SCORE_LIMIT + 999), (SCORE_LIMIT + 999), PrVar, &rpt); } /* high search failure re-search with (score, +inf) limits */ else if (score > beta && !(root->flags & exact)) { replus++; #ifdef QUIETBACKGROUND if (!background) #endif /* QUIETBACKGROUND */ dsp->ShowDepth('+'); score = search(side, 1, Sdepth, -(SCORE_LIMIT + 999), (SCORE_LIMIT + 999), PrVar, &rpt); } /**************** out of search ***********************************/ CheckForTimeout(score, globalscore, Jscore, zwndw); /************************ time control ****************************/ /* save PV as killer */ for (i = 1; i <= Sdepth + 1; i++) killr0[i] = PrVar[i]; if (!flag.timeout) Tscore[0] = score; /* if (!flag.timeout) */ /* for (i = TrPnt[1] + 1; i < TrPnt[2]; i++) if (!pick (i, TrPnt[2] - 1)) break; */ /* if done or nothing good to look at quit */ if ((root->flags & exact) || (score < -SCORE_LIMIT)) flag.timeout = true; /* find the next best move put below root */ if (!flag.timeout) { #if !defined NODYNALPHA Jscore = (plyscore + score) >> 1; #endif zwndw = 20 + abs(Jscore / 12); plyscore = score; /* recompute search window */ beta = score + ((computer == white) ? BBwindow : WBwindow); #if !defined NODYNALPHA alpha = ((Jscore < score) ? Jscore : score) - ((computer == white) ? BAwindow : WAwindow) - zwndw; #else alpha = score - ((computer == white) ? BAwindow : WAwindow); #endif } #ifdef QUIETBACKGROUND if (!background) #endif /* QUIETBACKGROUND */ dsp->ShowResults(score, PrVar, '.'); } /********************** end of main loop ***************************/ /* background mode */ if (iop == BACKGROUND_MODE) return; if (rpt >= 3) { root->flags |= draw; DRAW = DRAW_REPETITION; } else { /* * If there are no moves and we're not in check (stalemate) then * it's mate in shogi (whereas it's a draw in chess). */ if (GameCnt == MAXMOVES) { root->flags |= draw; DRAW = DRAW_MAXMOVES; } } /* not in book so set hint to guessed move for other side */ if (!bookflag) hint = ((PrVar[1]) ? PrVar[2] : 0); /* if not mate or draw make move and output it */ if (((score > -(SCORE_LIMIT + 999)) && (rpt <= 3)) || (root->flags & draw)) { MakeMove(side, &Tree[0], &tempb, &tempc, &tempsf, &tempst, &INCscore); algbr(root->f, root->t, (short) root->flags); } else { algbr(0, 0, 0); /* Zero move string when mate. */ root->score = score; /* When mate, ignore distinctions! * --SMC */ } g = &GameList[GameCnt]; if ((g->flags & capture) && (g->piece == king)) flag.mate = flag.illegal = true; /* If Time Control get the elapsed time */ if (TCflag) ElapsedTime(COMPUTE_AND_INIT_MODE); /* update time control info */ dsp->OutputMove(); /* if mate set flag */ if ((score == -(SCORE_LIMIT + 999) || score == (SCORE_LIMIT + 998))) flag.mate = true; /* add move to game list */ g->score = score; g->nodes = NodeCnt; g->time = (et +50)/100; /* g->time = TCcount; */ g->depth = Sdepth; /* update time control info */ if (TCflag) { TimeControl.clock[side] -= (et + OperatorTime); timecomp[compptr] = (et + OperatorTime); /* finished our required moves - setup the next set */ --TimeControl.moves[side]; } /* check for end conditions */ if ((root->flags & draw) /* && flag.bothsides */) { flag.mate = true; } else if (GameCnt == MAXMOVES) { flag.mate = true; } /* out of move store, you lose */ else { /* switch to other side */ player = xside; } /* if mate clear hint */ if (flag.mate) hint = 0; Sdepth = 0; } /* * Perform an alpha-beta search to determine the score for the current * board position. If depth <= 0 only capturing moves and responses to * check are generated and searched, otherwise all moves are processed. The * search depth is modified for check evasions, certain re-captures and * threats. Extensions may continue for up to 11 ply beyond the nominal * search depth. */ int search(short side, short ply, short depth, short alpha, short beta, unsigned short *bstline, short *rpt) { short j, pnt; short tempb, tempc, tempsf, tempst; short xside, pbst, score, rcnt, in_check, blockable; unsigned short mv, nxtline[MAXDEPTH]; struct leaf *node, tmp; short best = -(SCORE_LIMIT + 3000); short bestwidth = 0; short mustcut; #ifdef NULLMOVE short PVsave; short PVarisave; #endif NodeCnt++; /* look every ZNODE nodes for a timeout */ #ifdef NULLMOVE if (!null) { #endif if (NodeCnt > ETnodes) { ElapsedTime(COMPUTE_MODE); if (flag.back) { flag.back = false; flag.timeout = true; flag.musttimeout = false; } else if (TCflag || MaxResponseTime) { if ((et >= (ResponseTime + ExtraTime)) && (Sdepth > MINDEPTH)) { /* try to extend to finish ply */ if (flag.back || (TCflag && TCcount < MAXTCCOUNTX)) { flag.back = false; flag.musttimeout = true; TCcount++; ExtraTime += TCleft; } else { flag.back = false; flag.timeout = true; flag.musttimeout = false; } } } else if (flag.back) { flag.back = false; flag.timeout = true; flag.musttimeout = false; } #ifdef QUIETBACKGROUND if (!background) #endif dsp->ShowResponseTime(); } else if (!TCflag && flag.musttimeout && Sdepth > MINDEPTH) { flag.timeout = true; flag.musttimeout = false; } #ifdef NULLMOVE } #endif xside = side ^ 1; score = evaluate(side, ply, alpha, beta, INCscore, &in_check, &blockable); /* * check for possible repitition if so call repitition - rpt is * repeat count */ if ((ply <= Sdepth + 3) && rpthash[side][hashkey & 0xFF] > 0) { *rpt = repetition(); /* * repeat position >3 don't need to return score it's taken * care of above */ if (*rpt == 1) { score /= 3; score *= 2; } else if (*rpt == 2) score /= 2; } else { *rpt = 0; } /* score > SCORE_LIMIT its a draw or mate */ if (score > SCORE_LIMIT) { bstline[ply] = 0; return score; } /* Do we need to add depth because of special conditions */ /* if in check or in capture sequence search deeper */ /***************** depth extensions *****************/ if (depth > 0) { /* Allow opponent a chance to check again */ if (in_check) { if (depth < 2) depth = 2; } else if (flag.rcptr && (score > alpha) && (score < beta) && (ply > 2) && CptrFlag[ply - 1] && CptrFlag[ply - 2]) { if (hard_time_limit) { if (!flag.timeout) ++depth; } else { ++depth; } } } else { short timeout = 0; if (hard_time_limit) timeout = flag.timeout; if ((score >= alpha) && (in_check || ((!timeout && (hung[side] > 1)) && (ply == Sdepth + 1)))) { depth = 1; } else if ((score <= beta) && (((ply < Sdepth + 4) && (ply > 4)) && ChkFlag[ply - 2] && ChkFlag[ply - 4] && (ChkFlag[ply - 2] != ChkFlag[ply - 4]))) { depth = 1; } } /***************************************************/ /* try the local transition table if it's there */ #if ttblsz if (/* depth > 0 && */ flag.hash && ply > 1) { if (use_ttable && ProbeTTable(side, depth, ply, &alpha, &beta, &score) == true) { bstline[ply] = PV; bstline[ply + 1] = 0; if (beta == -((SCORE_LIMIT + 1000) * 2)) return score; if (alpha > beta) return alpha; } #ifdef HASHFILE /* ok try the transition file if its there */ else if (hashfile && (depth > HashDepth) && (GameCnt < HashMoveLimit) && (ProbeFTable(side, depth, ply, &alpha, &beta, &score) == true)) { PutInTTable(side, score, depth, ply, beta, PV); bstline[ply] = PV; bstline[ply + 1] = 0; if (beta == -((SCORE_LIMIT + 1000) * 2)) return score; if (alpha > beta) { return alpha; } } #endif /* HASHFILE */ } #endif /* ttblsz */ if (TrPnt[ply] > (TREE - 300)) mustcut = true; else mustcut = false; /* * If more then DepthBeyond ply past goal depth or at goal depth and * score > beta quit - means we are out of the window. */ if (mustcut || (ply > DepthBeyond) || ((depth < 1) && (score > beta))) return score; /* * If below first ply and not at goal depth generate all moves else * only capture moves. */ if (ply > 1) { if ((depth > 0) || (ply < (SDEPTHLIM)) || (background && (ply < Sdepth + 2))) MoveList(side, ply, in_check, blockable); else CaptureList(side, ply, in_check, blockable); } /* no moves return what we have */ /* * normally a search will continue til past goal and no more capture * moves exist */ /* unless it hits DepthBeyond */ if (TrPnt[ply] == TrPnt[ply + 1]) return score; /* if not at goal set best = -inf else current score */ best = (depth > 0) ? -(SCORE_LIMIT + 3000) : score; #ifdef NULLMOVE PVarisave = PVari; if (!null && /* no previous null-move */ !PVari && /* no null-move during the PV */ (ply > 2) && /* not at ply 1 or 2 */ (ply <= Sdepth) && (depth > 3) && !in_check) /* no check */ /* enough material such that zugzwang is unlikely * but who knows which value is suitable? */ { /* OK, we make a null move, i.e. this means we have nothing to do but we have to keep the some arrays up to date otherwise gnushogi gets confused. Maybe somebody knows exactly which information is important and which isn't. Another idea is that we try the null-move first and generate the moves later. This may save time but we have to take care that PV and other variables contain the right value so that the move ordering works right. */ struct GameRec *g; nxtline[ply + 1] = 0; CptrFlag[ply] = 0; TesujiFlag[ply] = 0; Tscore[ply] = score; PVsave = PV; PV = 0; null = 1; g = &GameList[++GameCnt]; g->hashkey = hashkey; g->hashbd = hashbd; FROMsquare = TOsquare = -1; g->Game50 = Game50; g->gmove = -1; g->flags = 0; g->piece = 0; g->color = neutral; best = -search(xside, ply + 1, depth - 2, -beta - 1, -beta, nxtline, &rcnt); null = 0; PV = PVsave; GameCnt--; if (best < alpha) { best = -(SCORE_LIMIT + 3000); } else if (best > beta) { return best; } else { best = -(SCORE_LIMIT + 3000); } } #endif /* if best so far is better than alpha set alpha to best */ if (best > alpha) alpha = best; /********************** main loop ****************************/ /* look at each move until no more or beta cutoff */ for (pnt = pbst = TrPnt[ply]; (pnt < TrPnt[ply + 1]) && (best <= beta); pnt++) { /* find the most interesting looking of the remaining moves */ if (ply > 1) pick(pnt, TrPnt[ply + 1] - 1); #ifdef NULLMOVE PVari = PVarisave && (pnt == TrPnt[ply]); /* Is this the PV? */ #endif node = &Tree[pnt]; /* is this a forbidden move */ if (/* ply == 1 && */ node->score <= DONTUSE) continue; nxtline[ply + 1] = 0; /* if at top level */ if (ply == 1) { /* at the top update search status */ if (flag.post) { #ifdef QUIETBACKGROUND if (!background) #endif /* QUIETBACKGROUND */ dsp->ShowCurrentMove(pnt, node->f, node->t); } } if (!(node->flags & exact)) { /* make the move and go deeper */ MakeMove(side, node, &tempb, &tempc, &tempsf, &tempst, &INCscore); CptrFlag[ply] = ((node->flags & capture) != 0); TesujiFlag[ply] = (node->flags & tesuji) && (node->flags & dropmask); Tscore[ply] = node->score; PV = node->reply; node->score = -search(xside, ply + 1, (depth > 0) ? (depth - 1) : 0, -beta, -alpha, nxtline, &rcnt); /* * if(!flag.timeout) * node->score = score; */ node->width = ((ply % 2) == 1) ? (TrPnt[ply + 2] - TrPnt[ply + 1]) : 0; if ((node->score > SCORE_LIMIT) || (node->score < -SCORE_LIMIT) ) node->flags |= exact; else if (rcnt == 1) node->score /= 2; if (((rcnt >= 3) || ((node->score == (SCORE_LIMIT + 999) - ply) && !ChkFlag[ply]))) { node->flags |= (draw | exact); DRAW = DRAW_JUSTDRAW; node->score = ((side == computer) ? contempt : -contempt); } node->reply = nxtline[ply + 1]; /* reset to try next move */ UnmakeMove(side, node, &tempb, &tempc, &tempsf, &tempst); } /* if best move so far */ /* CHECKME: flag.timeout isn't valid if no hard time limit */ if (!flag.timeout && ((node->score > best) || ((node->score == best) && (node->width > bestwidth)))) { /* * All things being equal pick the denser part of the * tree. */ bestwidth = node->width; /* * If not at goal depth and better than alpha and not * an exact score increment by depth. */ if ((depth > 0) && (node->score > alpha) && !(node->flags & exact)) { node->score += depth; } best = node->score; pbst = pnt; if (best > alpha) alpha = best; /* update best line */ for (j = ply + 1; nxtline[j] > 0; j++) bstline[j] = nxtline[j]; bstline[j] = 0; bstline[ply] = (node->f << 8) | node->t; /* if at the top */ if (ply == 1) { /* * If it's better than the root score make it the root. */ if ((best > root->score) || ((best == root->score) && (bestwidth > root->width))) { tmp = Tree[pnt]; for (j = pnt - 1; j >= 0; j--) Tree[j + 1] = Tree[j]; Tree[0] = tmp; pbst = 0; } #ifdef QUIETBACKGROUND if (!background) { #endif /* QUIETBACKGROUND */ if (Sdepth > 2) { if (best > beta) { dsp->ShowResults(best, bstline, '+'); } else if (best < alpha) { dsp->ShowResults(best, bstline, '-'); } else { dsp->ShowResults(best, bstline, '&'); } } #ifdef QUIETBACKGROUND } #endif } } if (flag.timeout) return Tscore[ply - 1]; } /******************************************************/ node = &Tree[pbst]; mv = (node->f << 8) | node->t; #ifdef NULLMOVE PVari = PVarisave; #endif /* * We have a move so put it in local table - if it's already there * done else if not there or needs to be updated also put it in * hashfile */ #if ttblsz if (flag.hash && ply <= Sdepth && *rpt == 0 && best == alpha) { # ifdef HASHFILE /* MCV: warning: this confuses the formatter. */ if (use_ttable && PutInTTable(side, best, depth, ply, beta, mv) && hashfile && (depth > HashDepth) && (GameCnt < HashMoveLimit)) # else if (use_ttable && PutInTTable(side, best, depth, ply, beta, mv)) # endif { PutInFTable(side, best, depth, ply, alpha, beta, node->f, node->t); } } #endif /* ttblsz */ if (depth > 0) { #if defined HISTORY unsigned short h, x; h = mv; if (history[x = hindex(side, h)] < HISTORYLIM) history[x] += (unsigned short) 1 << depth; #endif if (node->t != (short)(GameList[GameCnt].gmove & 0xFF)) { if (best <= beta) { killr3[ply] = mv; } else if (mv != killr1[ply]) { killr2[ply] = killr1[ply]; killr1[ply] = mv; } } killr0[ply] = ((best > SCORE_LIMIT) ? mv : 0); } return best; } /* * Update the PieceList and Pindex arrays when a piece is captured or when a * capture is unmade. */ void UpdatePieceList(short side, short sq, UpdatePieceList_mode iop) { short i; if (iop == REMOVE_PIECE) { PieceCnt[side]--; for (i = Pindex[sq]; i <= PieceCnt[side]; i++) { PieceList[side][i] = PieceList[side][i + 1]; Pindex[PieceList[side][i]] = i; } } else if (board[sq] == king) { /* king must have index 0 */ for (i = PieceCnt[side]; i >= 0; i--) { PieceList[side][i + 1] = PieceList[side][i]; Pindex[PieceList[side][i + 1]] = i + 1; } PieceCnt[side]++; PieceList[side][0] = sq; Pindex[sq] = 0; } else { PieceCnt[side]++; PieceList[side][PieceCnt[side]] = sq; Pindex[sq] = PieceCnt[side]; } } /* Make or Unmake drop move. */ static void drop(short side, short piece, short t, short iop) { if (iop == 1) { short n; board[t] = piece; color[t] = side; #if !defined SAVE_SVALUE svalue[t] = 0; #endif n = Captured[side][piece]--; UpdateDropHashbd(side, piece, n); UpdateHashbd(side, piece, -1, t); UpdatePieceList(side, t, ADD_PIECE); if (piece == pawn) { ++PawnCnt[side][column(t)]; } Mvboard[t]++; HasPiece[side][piece]++; } else { short n; board[t] = no_piece; color[t] = neutral; n = ++Captured[side][piece]; UpdateDropHashbd(side, piece, n); UpdateHashbd(side, piece, -1, t); UpdatePieceList(side, t, REMOVE_PIECE); if (piece == pawn) --PawnCnt[side][column(t)]; Mvboard[t]--; HasPiece[side][piece]--; } } #ifdef HASHKEYTEST int CheckHashKey() { unsigned long chashkey, chashbd; short side, sq; chashbd = chashkey = 0; for (sq = 0; sq < NO_SQUARES; sq++) { if (color[sq] != neutral) { chashbd ^= (*hashcode)[color[sq]][board[sq]][sq].bd; chashkey ^= (*hashcode)[color[sq]][board[sq]][sq].key; } /* hashcodes for initial board are 0 ! */ if (Stcolor[sq] != neutral) { chashbd ^= (*hashcode)[Stcolor[sq]][Stboard[sq]][sq].bd; chashkey ^= (*hashcode)[Stcolor[sq]][Stboard[sq]][sq].key; } } for (side = 0; side <= 1; side++) { short piece; for (piece = 0; piece < NO_PIECES; piece++) { short n = Captured[side][piece]; if (n > 0) { short i; for (i = 1; i <= n; i++) { chashbd ^= (*drop_hashcode)[side][piece][i].bd; chashkey ^= (*drop_hashcode)[side][piece][i].key; } } } } if (chashbd != hashbd) printf("chashbd %lu != hashbd %lu\n", chashbd, hashbd); if (chashkey != hashkey) printf("chashkey %lu != hashkey %lu\n", chashkey, hashkey); if (chashbd != hashbd || chashkey != hashkey) return 1; return 0; } #endif /* * Update Arrays board[], color[], and Pindex[] to reflect the new board * position obtained after making the move pointed to by node. Also update * miscellaneous stuff that changes when a move is made. */ void MakeMove(short side, struct leaf *node, short *tempb, /* piece at to square */ short *tempc, /* color of to square */ short *tempsf, /* static value of piece on from */ short *tempst, /* static value of piece on to */ short *INCscore) /* score increment */ { short f, t, xside; struct GameRec *g; short fromb, fromc; xside = side ^ 1; g = &GameList[++GameCnt]; g->hashkey = hashkey; g->hashbd = hashbd; FROMsquare = f = node->f; TOsquare = t = (node->t & 0x7f); *INCscore = (short)node->INCscore; g->Game50 = Game50; g->gmove = (f << 8) | node->t; g->flags = node->flags; #ifdef HASHKEYTEST if (CheckHashKey()) { short i; algbr(f, t, node->flags); printf("error before MakeMove: %s\n", mvstr[0]); UpdateDisplay(0, 0, 1, 0); for (i = 1; i <= GameCnt; i++) { movealgbr(GameList[i].gmove, mvstr[0]); printf("%d: %s\n", i, mvstr[0]); } exit(1); } #endif rpthash[side][hashkey & 0xFF]++, ISZERO++; if (f > NO_SQUARES) { g->fpiece = (node->flags & pmask); g->piece = *tempb = no_piece; g->color = *tempc = neutral; #if !defined SAVE_SVALUE *tempsf = 0; *tempst = svalue[t]; #endif (void)drop(side, g->fpiece, t, 1); } else { #if !defined SAVE_SVALUE *tempsf = svalue[f]; *tempst = svalue[t]; #endif g->fpiece = board[f]; g->piece = *tempb = board[t]; g->color = *tempc = color[t]; fromb = board[f]; fromc = color[f]; if (*tempc != neutral) { /* Capture a piece */ UpdatePieceList(*tempc, t, REMOVE_PIECE); /* if capture decrement pawn count */ if (*tempb == pawn) --PawnCnt[*tempc][column(t)]; mtl[xside] -= (*value)[stage][*tempb]; HasPiece[xside][*tempb]--; { short n, upiece = unpromoted[*tempb]; /* add "upiece" captured by "side" */ n = ++Captured[side][upiece]; UpdateDropHashbd(side, upiece, n); mtl[side] += (*value)[stage][upiece]; } /* remove "*tempb" of "xside" from board[t] */ UpdateHashbd(xside, *tempb, -1, t); #if !defined SAVE_SVALUE *INCscore += *tempst; /* add value of catched piece * to own score */ #endif Mvboard[t]++; } color[t] = fromc; #if !defined SAVE_SVALUE svalue[t] = svalue[f]; svalue[f] = 0; #endif Pindex[t] = Pindex[f]; PieceList[side][Pindex[t]] = t; color[f] = neutral; board[f] = no_piece; if (node->flags & promote) { short tob; board[t] = tob = promoted[fromb]; /* remove unpromoted piece from board[f] */ UpdateHashbd(side, fromb, f, -1); /* add promoted piece to board[t] */ UpdateHashbd(side, tob, -1, t); mtl[side] += value[stage][tob] - value[stage][fromb]; if (fromb == pawn) --PawnCnt[side][column(f)]; HasPiece[side][fromb]--; HasPiece[side][tob]++; #if !defined SAVE_SVALUE *INCscore -= *tempsf; #endif } else { board[t] = fromb; /* remove piece from board[f] and add it to board[t] */ UpdateHashbd(side, fromb, f, t); } Mvboard[f]++; } #ifdef HASHKEYTEST algbr(f, t, node->flags); if (CheckHashKey()) { printf("error in MakeMove: %s\n", mvstr[0]); exit(1); } #endif } /* * Take back a move. */ void UnmakeMove(short side, struct leaf *node, short *tempb, short *tempc, short *tempsf, short *tempst) { short f, t, xside; xside = side ^ 1; f = node->f; t = node->t & 0x7f; Game50 = GameList[GameCnt].Game50; if (node->flags & dropmask) { (void)drop(side, (node->flags & pmask), t, 2); #if !defined SAVE_SVALUE svalue[t] = *tempst; #endif } else { short tob, fromb; color[f] = color[t]; board[f] = tob = fromb = board[t]; #if !defined SAVE_SVALUE svalue[f] = *tempsf; #endif Pindex[f] = Pindex[t]; PieceList[side][Pindex[f]] = f; color[t] = *tempc; board[t] = *tempb; #if !defined SAVE_SVALUE svalue[t] = *tempst; #endif /* Undo move */ if (node->flags & promote) { board[f] = fromb = unpromoted[tob]; mtl[side] += value[stage][fromb] - value[stage][tob]; if (fromb == pawn) ++PawnCnt[side][column(f)]; HasPiece[side][fromb]++; HasPiece[side][tob]--; /* add unpromoted piece to board[f] */ UpdateHashbd(side, fromb, f, -1); /* remove promoted piece from board[t] */ UpdateHashbd(side, tob, -1, t); } else { if (fromb == pawn) { --PawnCnt[side][column(t)]; ++PawnCnt[side][column(f)]; }; /* remove piece from board[t] and add it to board[f] */ UpdateHashbd(side, fromb, f, t); } /* Undo capture */ if (*tempc != neutral) { short n, upiece = unpromoted[*tempb]; UpdatePieceList(*tempc, t, ADD_PIECE); if (*tempb == pawn) ++PawnCnt[*tempc][column(t)]; mtl[xside] += (*value)[stage][*tempb]; HasPiece[xside][*tempb]++; mtl[side] -= (*value)[stage][upiece]; /* remove "upiece" captured by "side" */ n = Captured[side][upiece]--; UpdateDropHashbd(side, upiece, n); /* replace captured piece on board[t] */ UpdateHashbd(xside, *tempb, -1, t); Mvboard[t]--; } Mvboard[f]--; } GameCnt--; rpthash[side][hashkey & 0xFF]--, ISZERO--; #ifdef HASHKEYTEST algbr(f, t, node->flags); if (CheckHashKey()) { printf("error in UnmakeMove: %s\n", mvstr[0]); exit(1); } #endif } /* * Scan thru the board seeing what's on each square. If a piece is found, * update the variables PieceCnt, PawnCnt, Pindex and PieceList. Also * determine the material for each side and set the hashkey and hashbd * variables to represent the current board position. Array * PieceList[side][indx] contains the location of all the pieces of either * side. Array Pindex[sq] contains the indx into PieceList for a given * square. */ void InitializeStats(void) { short i, sq; for (i = 0; i < NO_COLS; i++) PawnCnt[black][i] = PawnCnt[white][i] = 0; mtl[black] = mtl[white] = 0; PieceCnt[black] = PieceCnt[white] = 0; hashbd = hashkey = 0; for (sq = 0; sq < NO_SQUARES; sq++) { if (color[sq] != neutral) { mtl[color[sq]] += (*value)[stage][board[sq]]; if (board[sq] == pawn) ++PawnCnt[color[sq]][column(sq)]; Pindex[sq] = ((board[sq] == king) ? 0 : ++PieceCnt[color[sq]]); PieceList[color[sq]][Pindex[sq]] = sq; UpdateHashbd(color[sq], board[sq], sq, -1); } /* hashcodes for initial board are 0 ! */ if (Stcolor[sq] != neutral) UpdateHashbd(Stcolor[sq], Stboard[sq], sq, -1); } { short side; for (side = 0; side <= 1; side++) { short piece; for (piece = 0; piece < NO_PIECES; piece++) { short n = Captured[side][piece]; if (n > 0) { Captured[side][piece] = 0; for (i = 1; i <= n; i++) { ++Captured[side][piece]; UpdateDropHashbd(side, piece, i); mtl[side] += (*value)[stage][piece]; } } } } } #ifdef HASHKEYTEST if (CheckHashKey()) { printf("error in InitializeStats\n"); exit(1); } #endif } gnushogi-1.5pre/gnushogi/book.c0000644000175000017500000006462612364540011013565 00000000000000/* * FILE: book.c * * ---------------------------------------------------------------------- * Copyright (c) 1993, 1994, 1995 Matthias Mutz * Copyright (c) 1999 Michael Vanier and the Free Software Foundation * Copyright (c) 2008, 2013, 2014 Yann Dirson and the Free Software Foundation * * GNU SHOGI is based on GNU CHESS * * Copyright (c) 1988, 1989, 1990 John Stanback * Copyright (c) 1992 Free Software Foundation * * This file is part of GNU SHOGI. * * GNU Shogi is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 3 of the License, * or (at your option) any later version. * * GNU Shogi is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with GNU Shogi; see the file COPYING. If not, see * . * ---------------------------------------------------------------------- * */ #include "gnushogi.h" #define O_BINARY 0 #if HAVE_UNISTD_H /* Declarations of read(), write(), close(), and lseek(). */ #include #endif #if HAVE_FCNTL_H #include #endif #include "book.h" unsigned booksize = BOOKSIZE; unsigned short bookmaxply = BOOKMAXPLY; unsigned bookcount = 0; #ifdef BOOK char *bookfile = BOOK; #else char *bookfile = NULL; #endif #ifdef BINBOOK char *binbookfile = BINBOOK; #else char *binbookfile = NULL; #endif static char bmvstr[3][7]; static ULONG bhashbd; static ULONG bhashkey; /* * Balgbr(f, t, flags) * * Generate move strings in different formats. */ static void Balgbr(short f, short t, short flags) { short promoted = false; if ((f & 0x80) != 0) { f &= 0x7f; promoted = true; } if (f > NO_SQUARES) { short piece; piece = f - NO_SQUARES; if (f > (NO_SQUARES + NO_PIECES)) piece -= NO_PIECES; flags = (dropmask | piece); } if ((t & 0x80) != 0) { flags |= promote; t &= 0x7f; } if ((f == t) && ((f != 0) || (t != 0))) { /* * error in algbr: FROM=TO=t */ bmvstr[0][0] = bmvstr[1][0] = bmvstr[2][0] = '\0'; } else { if ((flags & dropmask) != 0) { /* bmvstr[0]: P*3c bmvstr[1]: P'3c */ short piece = flags & pmask; bmvstr[0][0] = pxx[piece]; bmvstr[0][1] = '*'; bmvstr[0][2] = COL_NAME(column(t)); bmvstr[0][3] = ROW_NAME(row(t)); bmvstr[0][4] = bmvstr[2][0] = '\0'; strcpy(bmvstr[1], bmvstr[0]); bmvstr[1][1] = '\''; } else { if ((f != 0) || (t != 0)) { /* algebraic notation */ /* bmvstr[0]: 7g7f bmvstr[1]: * (+)P7g7f(+) bmvstr[2]: (+)P7f(+) */ bmvstr[0][0] = COL_NAME(column(f)); bmvstr[0][1] = ROW_NAME(row(f)); bmvstr[0][2] = COL_NAME(column(t)); bmvstr[0][3] = ROW_NAME(row(t)); bmvstr[0][4] = '\0'; if (promoted) { bmvstr[1][0] = bmvstr[2][0] = '+'; bmvstr[1][1] = bmvstr[2][1] = pxx[board[f]]; strcpy(&bmvstr[1][2], &bmvstr[0][0]); strcpy(&bmvstr[2][2], &bmvstr[0][2]); } else { bmvstr[1][0] = bmvstr[2][0] = pxx[board[f]]; strcpy(&bmvstr[1][1], &bmvstr[0][0]); strcpy(&bmvstr[2][1], &bmvstr[0][2]); } if (flags & promote) { strcat(bmvstr[0], "+"); strcat(bmvstr[1], "+"); strcat(bmvstr[2], "+"); } } else { bmvstr[0][0] = bmvstr[1][0] = bmvstr[2][0] = '\0'; } } } } #ifndef QUIETBOOKGEN static void bkdisplay(char *s, int cnt, int moveno) { static short pnt; struct leaf *node; int r, c, l; pnt = TrPnt[2]; printf("matches = %d\n", cnt); printf("inout move is :%s: move number %d side %s\n", s, moveno / 2 + 1, (moveno & 1) ? "white" : "black"); #ifndef SEMIQUIETBOOKGEN printf("legal moves are \n"); while (pnt < TrPnt[3]) { node = &Tree[pnt++]; if (is_promoted[board[node->f]] ) Balgbr(node->f | 0x80, node->t, (short) node->flags); else Balgbr(node->f, node->t, (short) node->flags); printf("%s %s %s\n", bmvstr[0], bmvstr[1], bmvstr[2]); } printf("\n current board is\n"); for (r = (NO_ROWS - 1); r >= 0; r--) { for (c = 0; c <= (NO_COLS - 1); c++) { char pc; l = locn(r, c); pc = (is_promoted[board[l]] ? '+' : ' '); if (color[l] == neutral) printf(" -"); else if (color[l] == black) printf("%c%c", pc, qxx[board[l]]); else printf("%c%c", pc, pxx[board[l]]); } printf("\n"); } printf("\n"); { short color; for (color = black; color <= white; color++) { short piece, c; printf((color == black) ? "black " : "white "); for (piece = pawn; piece <= king; piece++) { if ((c = Captured[color][piece])) printf("%i%c ", c, pxx[piece]); } printf("\n"); }; } #endif /* SEMIQUIETBOOKGEN */ } #endif /* QUIETBOOKGEN */ /* * BVerifyMove(s, mv, moveno) * * Compare the string 's' to the list of legal moves available for the * opponent. If a match is found, make the move on the board. */ static int BVerifyMove(char *s, unsigned short *mv, int moveno) { static short pnt, tempb, tempc, tempsf, tempst, cnt; static struct leaf xnode; struct leaf *node; *mv = 0; cnt = 0; MoveList(opponent, 2, -2, true); pnt = TrPnt[2]; while (pnt < TrPnt[3]) { node = &Tree[pnt++]; if (is_promoted[board[node->f]] ) Balgbr(node->f | 0x80, node->t, (short) node->flags); else Balgbr(node->f, node->t, (short) node->flags); if (strcmp(s, bmvstr[0]) == 0 || strcmp(s, bmvstr[1]) == 0 || strcmp(s, bmvstr[2]) == 0) { cnt++; xnode = *node; } } if (cnt == 1) { short blockable; MakeMove(opponent, &xnode, &tempb, &tempc, &tempsf, &tempst, &INCscore); if (SqAttacked(PieceList[opponent][0], computer, &blockable)) { UnmakeMove(opponent, &xnode, &tempb, &tempc, &tempsf, &tempst); /* Illegal move in check */ #if !defined QUIETBOOKGEN puts("Illegal move (in check): %s"); bkdisplay(s, cnt, moveno); #endif return false; } else { *mv = (xnode.f << 8) | xnode.t; if (is_promoted[board[xnode.t]] ) Balgbr(xnode.f | 0x80, xnode.t, 0); else Balgbr(xnode.f, xnode.t, 0); return true; } } /* Illegal move */ #if !defined QUIETBOOKGEN printf("Illegal move (no match): %s\n", s); bkdisplay(s, cnt, moveno); #endif return false; } /* * RESET() * * Reset the board and other variables to start a new game. * */ static void RESET(void) { short l; flag.illegal = flag.mate = flag.quit = flag.reverse = flag.bothsides = flag.onemove = flag.force = false; flag.post &= xboard; /* [HGM] xboard: do not clear in XBoard mode */ flag.material = flag.coords = flag.hash = flag.easy = flag.beep = flag.rcptr = true; flag.stars = flag.shade = flag.back = flag.musttimeout = false; flag.gamein = false; GenCnt = 0; GameCnt = 0; CptrFlag[0] = TesujiFlag[0] = false; opponent = black; computer = white; for (l = 0; l < NO_SQUARES; l++) { board[l] = Stboard[l]; color[l] = Stcolor[l]; Mvboard[l] = 0; } ClearCaptured(); InitializeStats(); hashbd = hashkey = 0; } static int Vparse (FILE * fd, USHORT *mv, USHORT *flags, int moveno) { int c, i; char s[255]; *flags = 0; while (true) { while (((c = getc(fd)) == ' ') || (c == '!') || (c == '/') || (c == '\n')); if (c == '(') { /* amount of time spent for the last move */ while (((c = getc(fd)) != ')') && (c != EOF)); if (c == ')') { while (((c = getc(fd)) == ' ') || (c == '\n')); } } if (c == '[') { /* comment for the actual game */ while (((c = getc(fd))) != ']' && (c != EOF)); if (c == ']') { while (((c = getc(fd))) == ' ' || (c == '\n')); } } if (c == '\r') continue; if (c == '#') { /* comment */ do { c = getc(fd); if (c == '\r') continue; /* goes to end of line */ if (c == '\n') return 0; if (c == EOF) return -1; } while (true); } s[i = 0] = (char) c; while ((c >= '0') && (c <= '9')) { c = getc(fd); s[++i] = (char) c; } if (c == '.') { while (((c = getc(fd)) == ' ') || (c == '.') || (c == '\n')); s[i = 0] = (char) c; } while (((c = getc(fd)) != '?') && (c != '!') && (c != ' ') && (c != '(') && (c != '\n') && (c != '\t') && (c != EOF)) { if (c == '\r') continue; if ((c != 'x') && (c != '-') && (c != ',') && (c != ';') && (c != '=')) { s[++i] = (char) c; } } s[++i] = '\0'; if (c == '(') { while (((c = getc(fd)) != ')') && (c != EOF)); if (c == ')') c = getc(fd); } if (c == EOF) return -1; if (s[0] == '#') { while ((c != '\n') && (c != EOF)) c = getc(fd); if (c == EOF) return -1; else return 0; } if (strcmp(s, "draw") == 0) continue; else if (strcmp(s, "1-0") == 0) continue; else if (strcmp(s, "0-1") == 0) continue; else if (strcmp(s, "Resigns") == 0) continue; else if (strcmp(s, "Resigns.") == 0) continue; else if (strcmp(s, "Sennichite") == 0) continue; else if (strcmp(s, "Sennichite.") == 0) continue; else if (strcmp(s, "Jishogi") == 0) continue; else if (strcmp(s, "Jishogi.") == 0) continue; bhashkey = hashkey; bhashbd = hashbd; i = BVerifyMove(s, mv, moveno); if (c == '?') { /* Bad move, not for the program to play */ *flags |= BADMOVE; /* Flag it ! */ while (((c = getc(fd)) == '?') || (c == '!') || (c == '/')); } #ifdef EASY_OPENINGS else if (c == '~') { /* Do not use by computer */ *flags |= BADMOVE; /* Flag it ! */ while (((c = getc(fd)) == '?') || (c == '!') || (c == '/')); } #endif else if (c == '!') { /* Good move */ *flags |= GOODMOVE; /* Flag it ! */ while (((c = getc(fd)) == '?') || (c == '!') || (c == '/')); } else if (c == '\r') { c = getc(fd); } if (c == '(' ) while (((c = getc(fd)) != ')') && (c != EOF)); if (!i) { /* flush to start of next */ while (((c = getc(fd)) != '#') && (c != EOF)); if (c == EOF) { return -1; } else { ungetc(c, fd); return i; } } return i; } } static struct gdxadmin ADMIN; struct gdxadmin B; static struct gdxdata DATA; /* lts(l) returns most significant 16 bits of l */ #if SIZEOF_LONG == 8 /* 64-bit long i.e. 8 bytes */ # define lts(x) (USHORT)(((x >> 48) & 0xfffe) | side) #else # if defined USE_LTSIMP static USHORT ltsimp(long x) { USHORT n; n = (((x >> 16) & 0xfffe)); return n; } # define lts(x) (USHORT)(ltsimp(x) | side) # else # define lts(x) (USHORT)(((x >> 16)&0xfffe) | side) # endif #endif /* #define HashValue(l) lts(l) */ #define HashValue(l) (USHORT)(l & 0xffff) static int gfd; #define MAXOFFSET(B) ((B.booksize - 1) * sizeof_gdxdata + sizeof_gdxadmin) static ULONG HashOffset(ULONG hashkey, struct gdxadmin *B) { return (hashkey % B->booksize) * sizeof_gdxdata + sizeof_gdxadmin; } static ULONG NextOffset(struct gdxadmin *B, ULONG offset) { offset += sizeof_gdxdata; if (offset > B->maxoffset) offset = sizeof_gdxadmin; return offset; } static void WriteAdmin(void) { lseek(gfd, 0, SEEK_SET); write(gfd, (char *)&ADMIN, sizeof_gdxadmin); } static void WriteData(ULONG offset, int *mustwrite) { if (!*mustwrite) return; lseek(gfd, offset, SEEK_SET); write(gfd, (char *)&DATA, sizeof_gdxdata); *mustwrite = false; } static int ReadAdmin(void) { lseek(gfd, 0, SEEK_SET); return (sizeof_gdxadmin == read(gfd, (char *)&ADMIN, sizeof_gdxadmin)); } static int ReadData(ULONG offset, struct gdxdata *DATA) { lseek(gfd, offset, SEEK_SET); return (sizeof_gdxdata == read(gfd, (char *)DATA, sizeof_gdxdata)); } /* * GetOpenings() * * CHECKME: is this still valid esp. wrt gnushogi.book? * * Read in the Opening Book file and parse the algebraic notation for a move * into an unsigned integer format indicating the from and to square. Create * a linked list of opening lines of play, with entry->next pointing to the * next line and entry->move pointing to a chunk of memory containing the * moves. More Opening lines of up to 100 half moves may be added to * gnushogi.book. But now it's a hashed table by position which yields a move * or moves for each position. It no longer knows about openings per se only * positions and recommended moves in those positions. * */ void GetOpenings(void) { ULONG currentoffset = 0; short i; int first; unsigned short side; short c; USHORT mv, flags; unsigned int x; unsigned int games = 0; LONG collisions = 0; char msg[80]; FILE *fd; if ((fd = fopen(bookfile, "r")) == NULL) fd = fopen("gnushogi.tbk", "r"); if (fd != NULL) { /* yes add to book */ /* open book as writer */ gfd = open(binbookfile, O_RDONLY | O_BINARY); if (gfd >= 0) { if (ReadAdmin()) { B.bookcount = ADMIN.bookcount; B.booksize = ADMIN.booksize; B.maxoffset = ADMIN.maxoffset; if (B.booksize && !(B.maxoffset == MAXOFFSET(B))) { printf("bad format %s\n", binbookfile); exit(1); } } else { printf("bad format %s\n", binbookfile); exit(1); } close(gfd); gfd = open(binbookfile, O_RDWR | O_BINARY); } else { gfd = open(binbookfile, O_RDWR | O_CREAT | O_BINARY, 0644); ADMIN.bookcount = B.bookcount = 0; ADMIN.booksize = B.booksize = booksize; B.maxoffset = ADMIN.maxoffset = MAXOFFSET(B); DATA.hashbd = 0; DATA.hashkey = 0; DATA.bmove = 0; DATA.flags = 0; DATA.hint = 0; DATA.count = 0; WriteAdmin(); printf("creating bookfile %s %ld %ld\n", binbookfile, B.maxoffset, B.booksize); for (x = 0; x < B.booksize; x++) { int mustwrite = true; WriteData(sizeof_gdxadmin + x* sizeof_gdxdata, &mustwrite); } } if (gfd >= 0) { int mustwrite = false; /* setvbuf(fd, buffr, _IOFBF, 2048); */ side = black; hashbd = hashkey = 0; i = 0; while ((c = Vparse(fd, &mv, &flags, i)) >= 0) { if (c == 1) { /* * If this is not the first move of an opening and * if it's the first time we have seen it then * save the next move as a hint. */ i++; if (i < bookmaxply + 2) { if (i > 1 && !(flags & BADMOVE)) DATA.hint = mv; if (i < bookmaxply + 1) { /* * See if this position and move already * exist from some other opening. */ WriteData(currentoffset, &mustwrite); currentoffset = HashOffset(bhashkey, &B); first = true; while (true) { if (!ReadData(currentoffset, &DATA)) break; /* corrupted binbook file */ if (DATA.bmove == 0) break; /* free entry */ if (DATA.hashkey == HashValue(bhashkey) && DATA.hashbd == bhashbd) { if (DATA.bmove == mv) { /* * Yes, so just bump count - count * is used to choose the opening * move in proportion to its * presence in the book. */ DATA.count++; DATA.flags |= flags; mustwrite = true; break; } else { if (first) collisions++; if (DATA.flags & LASTMOVE) { DATA.flags &= (~LASTMOVE); mustwrite = true; WriteData(currentoffset, &mustwrite); } } } currentoffset = NextOffset(&B, currentoffset); first = false; } /* * Doesn't exist so add it to the book. */ if (!mustwrite) { B.bookcount++; if ((B.bookcount % 1000) == 0) { /* CHECKME: may want to get rid of this, * especially for xshogi. */ printf("%ld rec %d openings " "processed\n", B.bookcount, games); } /* initialize a record */ DATA.hashbd = bhashbd; DATA.hashkey = HashValue(bhashkey); DATA.bmove = mv; DATA.flags = flags | LASTMOVE; DATA.count = 1; DATA.hint = 0; mustwrite = true; } } } computer = opponent; opponent = computer ^ 1; side = side ^ 1; } else if (i > 0) { /* reset for next opening */ games++; WriteData(currentoffset, &mustwrite); RESET(); i = 0; side = black; } } WriteData(currentoffset, &mustwrite); fclose(fd); /* write admin rec with counts */ ADMIN.bookcount = B.bookcount; WriteAdmin(); close(gfd); } } if (binbookfile != NULL) { /* open book as reader */ gfd = open(binbookfile, O_RDONLY | O_BINARY); if (gfd >= 0) { if (ReadAdmin() && (!ADMIN.booksize || (ADMIN.maxoffset == MAXOFFSET(ADMIN)))) { B.bookcount = ADMIN.bookcount; B.booksize = ADMIN.booksize; B.maxoffset = ADMIN.maxoffset; } else { printf("bad format %s\n", binbookfile); exit(1); } } else { B.bookcount = 0; B.booksize = booksize; } sprintf(msg, "Book used %lu(%lu).", B.bookcount, B.booksize); dsp->ShowMessage(msg); } /* Set everything back to start the game. */ Book = BOOKFAIL; RESET(); /* Now get ready to play .*/ if (!B.bookcount) { dsp->ShowMessage("Can't find book."); Book = 0; } } /* * OpeningBook(hint) * * Go through each of the opening lines of play and check for a match with * the current game listing. If a match occurs, generate a random * number. If this number is the largest generated so far then the next * move in this line becomes the current "candidate". After all lines are * checked, the candidate move is put at the top of the Tree[] array and * will be played by the program. Note that the program does not handle * book transpositions. */ int OpeningBook(unsigned short *hint) { ULONG currentoffset; unsigned short r, m; int possibles = TrPnt[2] - TrPnt[1]; gsrand((unsigned int) time((long *) 0)); m = 0; /* * Find all the moves for this position - count them and get their * total count. */ { USHORT i, x; USHORT rec = 0; USHORT summ = 0; USHORT h = 0, b = 0; struct gdxdata OBB[128]; if (B.bookcount == 0) { Book--; return false; } x = 0; currentoffset = HashOffset(hashkey, &B); #ifdef BOOKTEST printf("looking for book move, bhashbd = 0x%lx bhashkey = 0x%x\n", (ULONG)hashbd, HashValue(hashkey)); #endif while (true) { if (!ReadData(currentoffset, &OBB[x])) break; if (OBB[x].bmove == 0) break; #ifdef BOOKTEST printf("compare with bhashbd = 0x%lx bhashkey = 0x%x\n", OBB[x].hashbd, OBB[x].hashkey); #endif if ((OBB[x].hashkey == HashValue(hashkey)) && (OBB[x].hashbd == (ULONG)hashbd)) { x++; if (OBB[x-1].flags & LASTMOVE) break; } currentoffset = NextOffset(&B, currentoffset); } #ifdef BOOKTEST printf("%d book move(s) found.\n", x); #endif if (x == 0) { Book--; return false; } for (i = 0; i < x; i++) { if (OBB[i].flags & BADMOVE) { m = OBB[i].bmove; /* Is the move in the MoveList? */ for (b = TrPnt[1]; b < (unsigned) TrPnt[2]; b++) { if (((Tree[b].f << 8) | Tree[b].t) == m) { if (--possibles) Tree[b].score = DONTUSE; break; } } } else { #if defined BOOKTEST char s[20]; movealgbr(m = OBB[i].bmove, s); printf("finding book move: %s\n", s); #endif summ += OBB[i].count; } } if (summ == 0) { Book--; return false; } r = (urand() % summ); for (i = 0; i < x; i++) { if (!(OBB[i].flags & BADMOVE)) { if (r < OBB[i].count) { rec = i; break; } else { r -= OBB[i].count; } } } h = OBB[rec].hint; m = OBB[rec].bmove; /* Make sure the move is in the MoveList. */ for (b = TrPnt[1]; b < (unsigned) TrPnt[2]; b++) { if (((Tree[b].f << 8) | Tree[b].t) == m) { Tree[b].flags |= book; Tree[b].score = 0; break; } } /* Make sure it's the best. */ pick(TrPnt[1], TrPnt[2] - 1); if (Tree[TrPnt[1]].score) { /* no! */ Book--; return false; } /* Ok, pick up the hint and go. */ *hint = h; return true; } Book--; return false; } gnushogi-1.5pre/gnushogi/eval.h0000644000175000017500000000410712363540323013560 00000000000000/* * FILE: eval.h * * Interface to the board evaluator. * * ---------------------------------------------------------------------- * Copyright (c) 1993, 1994, 1995 Matthias Mutz * Copyright (c) 1999 Michael Vanier and the Free Software Foundation * Copyright (c) 2008, 2013, 2014 Yann Dirson and the Free Software Foundation * * GNU SHOGI is based on GNU CHESS * * Copyright (c) 1988, 1989, 1990 John Stanback * Copyright (c) 1992 Free Software Foundation * * This file is part of GNU SHOGI. * * GNU Shogi is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 3 of the License, * or (at your option) any later version. * * GNU Shogi is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with GNU Shogi; see the file COPYING. If not, see * . * ---------------------------------------------------------------------- * */ #ifndef _EVAL_H_ #define _EVAL_H_ #define NO_STAGES 100 #define NO_FEATURES 31 struct signature { unsigned long hashbd; unsigned long hashkey; }; #define MatchSignature(s) ((s.hashbd == hashbd) && (s.hashkey == hashkey)) #define CopySignature(s) { s.hashbd = hashbd; s.hashkey = hashkey; } typedef short value_array[NO_STAGES][NO_PIECES]; typedef small_short fscore_array[NO_STAGES][NO_FEATURES][2]; extern value_array *value; extern fscore_array *fscore; extern void threats (short side); extern long attack[2][NO_SQUARES]; extern small_short sseed[NO_SQUARES]; extern struct signature threats_signature[2]; extern small_short starget[2][NO_SQUARES]; extern small_short sloose[NO_SQUARES]; extern small_short shole[NO_SQUARES]; extern small_short shung[NO_SQUARES]; extern struct signature squares_signature; #endif /* _EVAL_H_ */ gnushogi-1.5pre/gnushogi/gnushogi.h0000644000175000017500000007642412364540012014463 00000000000000/* * FILE: gnushogi.h * * Main header file for GNU Shogi. * * ---------------------------------------------------------------------- * Copyright (c) 1993, 1994, 1995 Matthias Mutz * Copyright (c) 1999 Michael Vanier and the Free Software Foundation * Copyright (c) 2008, 2013, 2014 Yann Dirson and the Free Software Foundation * * GNU SHOGI is based on GNU CHESS * * Copyright (c) 1988, 1989, 1990 John Stanback * Copyright (c) 1992 Free Software Foundation * * This file is part of GNU SHOGI. * * GNU Shogi is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 3 of the License, * or (at your option) any later version. * * GNU Shogi is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with GNU Shogi; see the file COPYING. If not, see * . * ---------------------------------------------------------------------- * */ /* Hack for anal-retentive ANSI-compliance if desired: */ #define inline /* FIXME: this file needs to be reorganized in some rational manner. */ #ifndef _GNUSHOGI_H_ #define _GNUSHOGI_H_ #include "config.h" /* Portability #defines. */ #include "debug.h" #include "opts.h" /* Various option-setting #defines. */ #include /* * Display options. */ typedef enum { DISPLAY_RAW, #ifdef HAVE_LIBCURSES DISPLAY_CURSES, #endif DISPLAY_X } display_t; extern display_t display_type; #define XSHOGI (display_type == DISPLAY_X) /* Miscellaneous globals. */ extern short hard_time_limit; /* If you exceed time limit, you lose. */ extern short nolist; /* Don't list game after exit. */ extern short xboard; /* Use XBoard instead of xShogi protocol */ /* * Options for various compilers/OSs. */ /* * type small_short must cover -128 .. 127. In case of trouble, * try commenting out "signed". If this doesn't help, use short. */ #define small_short signed char #define small_ushort unsigned char typedef small_ushort UBYTE; typedef short SHORT; typedef unsigned short USHORT; typedef int INT; typedef unsigned int UINT; typedef long LONG; typedef unsigned long ULONG; #if !defined(HAVE_MEMCPY) && !defined(HAVE_BCOPY) # define array_copy(src, dst, len) \ { \ long i; \ char *psrc = (char *)src, *pdst = (char *)dst; \ for (i = len; i; pdst[--i] = psrc[i]); \ } # define array_zero(dst, len) \ { \ long i; \ char *pdst = (char *)dst; \ for (i = len; i; pdst[--i] = 0); \ } #elif !defined(HAVE_MEMCPY) /* BSD and derivatives */ # define array_copy(src, dst, len) bcopy(src, dst, len) # define array_zero(dst, len) bzero(dst, len) #else /* System V and derivatives */ # define array_copy(src, dst, len) memcpy(dst, src, len) # define array_zero(dst, len) memset(dst, 0, len) #endif #ifndef __GNUC__ # define inline #endif /* * Standard header files. */ #include #include #include #include #include #include #include #ifdef WIN32 # include #else typedef small_short BYTE; # include # include #endif #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #define RWA_ACC "r+" #define WA_ACC "w+" #ifdef BINBOOK extern char *binbookfile; #endif extern char *bookfile; extern char *xwin; extern char *Lang; extern void movealgbr(short m, char *s); #define SEEK_SET 0 #define SEEK_END 2 #ifdef MINISHOGI #define NO_PIECES 11 #define MAX_CAPTURED 19 #define NO_PTYPE_PIECES 11 #define NO_COLS 5 #define NO_ROWS 5 #define NO_CAMP_ROWS 1 #else #define NO_PIECES 15 #define MAX_CAPTURED 19 #define NO_PTYPE_PIECES 15 #define NO_COLS 9 #define NO_ROWS 9 #define NO_CAMP_ROWS 3 #endif #define NO_SQUARES (NO_COLS*NO_ROWS) #define ROW_NAME(n) ( xboard ? '1' + n : ('a' + NO_ROWS - 1 - n) ) #define COL_NAME(n) ( xboard ? 'a' + n : ('1' + NO_COLS - 1 - n) ) #define ROW_NUM(c) ( xboard ? c - '1' : ('a' + NO_ROWS - 1 - c) ) #define COL_NUM(c) ( xboard ? c - 'a' : ('1' + NO_COLS - 1 - c) ) #if defined HASHFILE || defined CACHE # define PTBLBDSIZE (NO_SQUARES + NO_PIECES) #endif #include "eval.h" #define SCORE_LIMIT 12000 /* masks into upper 16 bits of attacks array */ /* observe order of relative piece values */ #define CNT_MASK 0x000000FF #define ctlP 0x00200000 #define ctlPp 0x00100000 #define ctlL 0x00080000 #define ctlN 0x00040000 #define ctlLp 0x00020000 #define ctlNp 0x00010000 #define ctlS 0x00008000 #define ctlSp 0x00004000 #define ctlG 0x00002000 #define ctlB 0x00001000 #define ctlBp 0x00000800 #define ctlR 0x00000400 #define ctlRp 0x00000200 #define ctlK 0x00000100 /* attack functions */ #define Pattack(c, u) (attack[c][u] > ctlP) #define Anyattack(c, u) (attack[c][u] != 0) /* hashtable flags */ #define truescore 0x0001 #define lowerbound 0x0002 #define upperbound 0x0004 #define kingcastle 0x0008 #define queencastle 0x0010 #define evalflag 0x0020 /* King positions */ #define BlackKing PieceList[black][0] #define WhiteKing PieceList[white][0] #define OwnKing PieceList[c1][0] #define EnemyKing PieceList[c2][0] /* board properties */ #define InBlackCamp(sq) ((sq) < (NO_COLS * NO_CAMP_ROWS)) #define InWhiteCamp(sq) ((sq) >= (NO_COLS * (NO_ROWS - NO_CAMP_ROWS))) #define InPromotionZone(side, sq) \ (((side) == black) ? InWhiteCamp(sq) : InBlackCamp(sq)) /* constants */ /* FIXME ? */ #define OPENING_HINT 0x141d /* P7g-7f (20->29) */ /* truth values */ #ifndef false #define false 0 #endif #ifndef true #define true 1 #endif /* colors */ #define black 0 #define white 1 #define neutral 2 /* piece code defines */ enum { no_piece = 0, pawn, #ifndef MINISHOGI lance, knight, #endif /* start of pieces that can be dropped at any square */ silver, gold, bishop, rook, ppawn, #ifndef MINISHOGI plance, pknight, #endif psilver, pbishop, prook, king }; /* move types */ enum { ptype_no_piece = 0, ptype_pawn = 0, #ifndef MINISHOGI ptype_lance, ptype_knight, #endif ptype_silver, ptype_gold, ptype_bishop, ptype_rook, ptype_pbishop, ptype_prook, ptype_king, ptype_wpawn, #ifndef MINISHOGI ptype_wlance, ptype_wknight, #endif ptype_wsilver, ptype_wgold }; /* node flags */ #define pmask 0x000f /* 15 */ #define promote 0x0010 /* 16 */ #define dropmask 0x0020 /* 32 */ #define exact 0x0040 /* 64 */ #define tesuji 0x0080 /* 128 */ #define check 0x0100 /* 256 */ #define capture 0x0200 /* 512 */ #define draw 0x0400 /* 1024 */ #define stupid 0x0800 /* 2048 */ #define questionable 0x1000 /* 4096 */ #define kingattack 0x2000 /* 8192 */ #define book 0x4000 /* 16384 */ /* move quality flags */ #define goodmove tesuji #define badmove stupid #ifdef EASY_OPENINGS #define difficult questionable #endif /* move symbols */ #ifndef MINISHOGI #define pxx (" PLNSGBRPLNSBRK ") #define qxx (" plnsgbrplnsbrk ") #else #define pxx (" PSGBRPSBRK ") #define qxx (" psgbrpsbrk ") #endif /***************** Table limits ********************************************/ /* * ttblsz must be a power of 2. Setting ttblsz 0 removes the transposition * tables. */ #if defined NOTTABLE # define vttblsz 0 #elif defined SMALL_MEMORY # if defined SAVE_SSCORE # define vttblsz (1 << 12) # else # if defined EXTRA_2MB # define vttblsz (1 << 12) # else # define vttblsz (1 << 10) # endif # endif #else # define vttblsz (100001) #endif #if defined SMALL_MEMORY # define MINTTABLE (0) #else # define MINTTABLE (8000) /* min ttable size -1 */ #endif #define ttblsz vttblsz #if defined SMALL_MEMORY # if !defined SAVE_SSCORE # define TREE 1500 /* max number of tree entries */ # else # define TREE 2500 /* max number of tree entries */ # endif #else # define TREE 4000 /* max number of tree entries */ #endif #define MAXDEPTH 40 /* max depth a search can be carried */ #define MINDEPTH 2 /* min search depth =1 (no hint), >1 hint */ #define MAXMOVES 300 /* max number of half moves in a game */ #define CPSIZE 241 /* size of lang file max */ #if defined SMALL_MEMORY # if defined SAVE_SSCORE # define ETABLE (1 << 10) /* static eval cache */ # else # if defined EXTRA_2MB # define ETABLE (1 << 10) /* static eval cache */ # else # define ETABLE (1 << 8) /* static eval cache */ # endif # endif #else # define ETABLE (10001) /* static eval cache */ #endif /***************** tuning paramaters *******************/ #if defined VERY_SLOW_CPU # define MINRESPONSETIME 300 #elif defined SLOW_CPU # define MINRESPONSETIME 200 #else # define MINRESPONSETIME 100 /* 1 s */ #endif #define MINGAMEIN 4 #define MINMOVES 15 #define CHKDEPTH 1 /* always look forward CHKDEPTH * half-moves if in check */ #if defined SLOW_CPU || defined VERY_SLOW_CPU # define DEPTHBEYOND 7 /* Max to go beyond Sdepth */ #else # define DEPTHBEYOND 11 /* Max to go beyond Sdepth */ #endif #define HASHDEPTH 4 /* depth above which to use HashFile */ #define HASHMOVELIMIT 40 /* Use HashFile only for this many moves */ #define PTVALUE 0 /* material value below which pawn threats at * 5 & 3 are used */ #define ZDEPTH 3 /* depth beyond which to check * ZDELTA for extra time */ #define ZDELTA 10 /* score delta per ply to cause * extra time to be given */ #define BESTDELTA 90 /* about 1/2 second worth of nodes for your machine */ #if defined VERY_SLOW_CPU /* check the time every ZNODES positions */ # define ZNODES (flag.tsume ? 20 : 50) #elif defined SLOW_CPU # define ZNODES (flag.tsume ? 40 : 100) #else # define ZNODES (flag.tsume ? 400 : 1000) #endif #define MAXTCCOUNTX 10 /* max number of time clicks * per search to complete ply */ #define MAXTCCOUNTR 4 /* max number of time clicks * per search extensions*/ #define SCORESPLIM 8 /* Score space doesn't apply after this stage */ #define SDEPTHLIM (Sdepth + 1) #define HISTORYLIM 4096 /* Max value of history killer */ #ifdef EXACTHISTORY # if defined SMALL_MEMORY # define HISTORY_MASK 0x8000 /* mask to MSB of history index */ # define HISTORY_SIZE 0x10000 /* size of history table */ # else # define HISTORY_MASK (1 << 15) /* mask to MSB of history index */ # define HISTORY_SIZE (1 << 16) /* size of history table */ # endif #else /* smaller history table, but dangerous because of collisions */ # define HISTORY_MASK 0x3fff /* mask to significant bits * of history index */ # if defined SMALL_MEMORY # define HISTORY_SIZE 0x4000 /* size of history table */ # else # define HISTORY_SIZE (1 << 14) /* size of history table */ # endif #endif #define sizeof_history (sizeof(unsigned short) * (size_t)HISTORY_SIZE) #ifdef EXACTHISTORY /* Map from.to (8bit.8bit) to from.to (0.7bit.8bit) */ # define khmove(mv) (mv & 0x7fff) # define hmove(mv) ((mv & 0x7fff) ^ 0x5555) #else /* Map from.to (8bit.8bit) to from.to (00.7bit.7bit) */ /* Swap bits of ToSquare in case of promotions, hoping that no catastrophic collision occurs. */ # define khmove(mv) (((mv & 0x7f00) >> 1) | \ ((mv & 0x0080) ? ((mv & 0x007f) ^ 0x007f) : (mv & 0x007f))) # define hmove(mv) (khmove(mv) ^ 0x2aaa) #endif /* mask color to 15th bit */ #ifdef EXACTHISTORY # define hindex(c, mv) ((c ? HISTORY_MASK : 0) | hmove(mv)) #else /* for white, swap bits, hoping that no catastrophic collision occurs. */ # define hindex(c, mv) (c ? ((~hmove(mv)) & HISTORY_MASK) : hmove(mv)) #endif #define EWNDW 10 /* Eval window to force position scoring at depth * greater than (Sdepth + 2) */ #define WAWNDW 90 /* alpha window when computer black */ #define WBWNDW 90 /* beta window when computer black */ #define BAWNDW 90 /* alpha window when computer white */ #define BBWNDW 90 /* beta window when computer white */ #define BXWNDW 90 /* window to force position scoring at lower */ #define WXWNDW 90 /* window to force position scoring at lower */ #define DITHER 5 /* max amount random can alter a pos value */ #define LBONUS 1 /* points per stage value of L increases */ #define BBONUS 2 /* points per stage value of B increases */ #define RBONUS 2 /* points per stage value of R increases */ #define QUESTIONABLE (valueK) /* Penalty for questionable moves. */ #if defined STUPID # undef STUPID #endif #define STUPID (valueR << 1) /* Penalty for stupid moves. */ #define KINGPOSLIMIT (-1) /* King positional scoring limit */ #define KINGSAFETY 32 #define MAXrehash (7) /******* parameters for Opening Book ****************/ #define BOOKSIZE 8000 /* Number of unique position/move * combinations allowed */ #define BOOKMAXPLY 40 /* Max plys to keep in book database */ #define BOOKFAIL (BOOKMAXPLY / 2) /* if no book move found for BOOKFAIL * turns stop using book */ #define BOOKPOCKET 64 #define BOOKRAND 1000 /* used to select an opening move * from a list */ #define BOOKENDPCT 950 /* 5 % chance a BOOKEND will stop the book */ #define DONTUSE -32760 /* flag move as don't use */ #define ILLEGAL_TRAPPED -32761 /* flag move as illegal: * no move from this square */ #define ILLEGAL_DOUBLED -32762 /* flag move as illegal: * two pawns on one column */ #define ILLEGAL_MATE -32763 /* flag move as illegal: * pawn drop with mate */ /*****************************************************/ struct hashval { unsigned long key, bd; }; struct hashentry { unsigned long hashbd; unsigned short mv; unsigned char depth; /* unsigned char saves some space */ unsigned char flags; #ifdef notdef unsigned short age; #endif short score; #ifdef HASHTEST unsigned char bd[PTBLBDSIZE]; #endif /* HASHTEST */ }; #if defined HASHFILE || defined CACHE struct etable { unsigned long ehashbd; short escore[2]; #if !defined SAVE_SSCORE short sscore[NO_SQUARES]; #endif short score; small_short hung[2]; #ifdef CACHETEST unsigned char bd[PTBLBDSIZE]; #endif /* CACHETEST */ }; #if defined CACHE extern short use_etable; typedef struct etable etable_field[ETABLE]; extern etable_field *etab[2]; #endif /* * CHECKME! Is this valid? * * persistent transposition table. By default, the size is (1 << vfilesz). * If you change the size, be sure to run gnushogi -c [vfilesz] * before anything else. */ #define frehash 6 #if defined SMALL_MEMORY # define vfilesz 10 #else # define vfilesz 14 #endif struct fileentry { unsigned char bd[PTBLBDSIZE]; unsigned char f, t, flags, depth, sh, sl; }; #endif /* HASHFILE */ struct leaf { small_ushort f, t; short score, reply, width; short INCscore; unsigned short flags; }; struct GameRec { unsigned short gmove; /* this move */ short score; /* score after this move */ short depth; /* search depth this move */ long time; /* search time this move */ short fpiece; /* moved or dropped piece */ short piece; /* piece captured */ short color; /* color */ short flags; /* move flags capture, promote, castle */ short Game50; /* flag for repetition */ long nodes; /* nodes searched for this move */ unsigned long hashkey, hashbd; /* board key before this move */ }; struct TimeControlRec { short moves[2]; long clock[2]; }; struct flags { short mate; /* the game is over */ short post; /* show principle variation */ short quit; /* quit/exit */ short regularstart; /* did the game start from standard * initial board ? */ short reverse; /* reverse board display */ short bothsides; /* computer plays both sides */ short hash; /* enable/disable transposition table */ short force; /* enter moves */ short easy; /* disable thinking on opponents time */ short beep; /* enable/disable beep */ short timeout; /* time to make a move */ short musttimeout; /* time to make a move */ short back; /* time to make a move */ short rcptr; /* enable/disable recapture heuristics */ short rv; /* reverse video */ short stars; /* add stars to uxdsp screen */ short coords; /* add coords to visual screen */ short shade; short material; /* draw on lack of material */ short illegal; /* illegal position */ short onemove; /* timing is onemove */ short gamein; /* timing is gamein */ short tsume; /* first consider checks */ }; extern FILE *debugfile; #ifndef EVALFILE #define EVALFILE "/tmp/EVAL" #endif extern FILE *debug_eval_file; extern short debug_moves; #ifdef HISTORY extern short use_history; extern unsigned short *history; #endif extern long znodes; extern char ColorStr[2][10]; extern char mvstr[4][6]; extern int mycnt1, mycnt2; extern struct leaf rootnode; extern struct leaf *Tree; extern struct leaf *root; extern char savefile[], listfile[]; extern short TrPnt[]; extern small_short board[], color[]; extern const small_short sweep[NO_PIECES]; extern small_short PieceList[2][NO_SQUARES], PawnCnt[2][NO_COLS]; extern small_short Captured[2][NO_PIECES]; #ifndef HAVE_MEMSET # define ClearCaptured() \ { \ short piece, color; \ for (color = black; color <= white; color++) \ for (piece = 0; piece < NO_PIECES; piece++) \ Captured[color][piece] = 0; \ } #else # define ClearCaptured() \ memset((char *)Captured, 0, (unsigned long)sizeof(Captured)) #endif /* HAVE_MEMSET */ extern small_short Mvboard[]; #if !defined SAVE_SVALUE extern short svalue[NO_SQUARES]; #endif extern short pscore[2]; /* eval.c */ extern int EADD; /* eval.c */ extern int EGET; /* eval.c */ extern struct flags flag; extern short opponent, computer, INCscore; extern short WAwindow, BAwindow, WBwindow, BBwindow; extern short dither, player; extern short xwndw, contempt; extern long ResponseTime, ExtraTime, TCleft, MaxResponseTime, et, et0, time0, ft; extern int TCcount; #ifdef INTERRUPT_TEST extern long itime0, it; #endif extern long reminus, replus; extern long GenCnt, NodeCnt, ETnodes, EvalNodes, HashAdd, HashCnt, HashCol, THashCol, FHashCnt, FHashAdd; extern short HashDepth, HashMoveLimit; extern struct GameRec *GameList; extern short GameCnt, Game50; extern short Sdepth, MaxSearchDepth; extern int Book; extern struct TimeControlRec TimeControl; extern int TCadd; extern short TCflag, TCmoves, TCminutes, TCseconds, OperatorTime; extern int timecomp[MINGAMEIN], timeopp[MINGAMEIN]; extern int compptr, oppptr; extern short XCmore, XCmoves[], XCminutes[], XCseconds[], XC; extern const short otherside[]; extern const small_short Stboard[]; extern const small_short Stcolor[]; extern unsigned short hint; extern short TOflag; extern short stage, stage2; #define in_opening_stage (!flag.tsume && (stage < 33)) #define in_middlegame_stage (!flag.tsume && (stage >= 33) && (stage <= 66)) #define in_endgame_stage (flag.tsume || (stage > 66)) extern short ahead, hash; extern short balance[2]; extern small_short ChkFlag[], CptrFlag[], TesujiFlag[]; extern short Pscore[], Tscore[]; extern /*unsigned*/ short rehash; /* -1 is used as a flag --tpm */ extern unsigned int ttbllimit; extern unsigned int TTadd; extern unsigned int ttblsize; extern short mtl[], hung[]; extern small_short Pindex[]; extern small_short PieceCnt[]; extern short FROMsquare, TOsquare; extern small_short HasPiece[2][NO_PIECES]; extern const short kingP[]; extern unsigned short killr0[], killr1[]; extern unsigned short killr2[], killr3[]; extern unsigned short PrVar[MAXDEPTH]; extern unsigned short PV, SwagHt, Swag0, Swag1, Swag2, Swag3, Swag4, sidebit; extern short mtl[2], pmtl[2], hung[2]; extern const small_short relative_value[]; extern const long control[]; extern small_short diagonal(short delta); extern const small_short promoted[NO_PIECES], unpromoted[NO_PIECES]; extern const small_short is_promoted[NO_PIECES]; typedef unsigned char next_array[NO_SQUARES][NO_SQUARES]; typedef small_short distdata_array[NO_SQUARES][NO_SQUARES]; extern const small_short inunmap[NO_SQUARES]; #ifndef MINISHOGI extern const small_short nunmap[(NO_COLS + 2)*(NO_ROWS + 4)]; #else extern const small_short nunmap[(NO_COLS + 2)*(NO_ROWS + 2)]; #endif #if defined SAVE_NEXTPOS extern const small_short direc[NO_PTYPE_PIECES][8]; extern short first_direction(short ptyp, short *d, short sq); extern short next_direction(short ptyp, short *d, short sq); extern short next_position(short ptyp, short *d, short sq, short u); #else extern short use_nextpos; extern next_array *nextpos[NO_PTYPE_PIECES]; extern next_array *nextdir[NO_PTYPE_PIECES]; #endif extern value_array *value; extern fscore_array *fscore; #ifndef SAVE_DISTDATA extern short use_distdata; extern distdata_array *distdata; #endif #ifndef SAVE_PTYPE_DISTDATA extern short use_ptype_distdata; extern distdata_array *ptype_distdata[NO_PTYPE_PIECES]; #endif extern const small_short ptype[2][NO_PIECES]; extern long filesz, hashmask, hashbase; extern FILE *hashfile; extern unsigned int starttime; /* eval.c */ typedef small_short Mpiece_array[2][NO_SQUARES]; extern Mpiece_array *Mpiece[NO_PIECES]; extern short ADVNCM[NO_PIECES]; #define computed_distance(a, b) \ ((abs(column(a) - column(b)) > abs(row(a) - row(b))) \ ? abs(column(a) - column(b)) : abs(row(a) - row(b))) extern short distance(short a, short b); extern short ptype_distance(short ptyp, short f, short t); extern short piece_distance(short side, short piece, short f, short t); #if defined UNKNOWN # undef UNKNOWN #endif #define UNKNOWN 'U' #define STATIC_ROOK 'S' #define RANGING_ROOK 'R' extern char GameType[2]; void ShowGameType(void); extern unsigned short bookmaxply; extern unsigned int bookcount; extern unsigned int booksize; extern unsigned long hashkey, hashbd; typedef struct hashval hashcode_array[2][NO_PIECES][NO_SQUARES]; typedef struct hashval drop_hashcode_array[2][NO_PIECES][NO_SQUARES]; extern hashcode_array *hashcode; extern drop_hashcode_array *drop_hashcode; #ifdef QUIETBACKGROUND extern short background; #endif /* QUIETBACKGROUND */ #if ttblsz extern short use_ttable; extern struct hashentry *ttable[2]; #endif /* * hashbd contains a 32 bit "signature" of the board position. hashkey * contains a 16 bit code used to address the hash table. When a move is * made, XOR'ing the hashcode of moved piece on the from and to squares with * the hashbd and hashkey values keeps things current. */ #define UpdateHashbd(side, piece, f, t) \ { \ if ((f) >= 0) \ { \ hashbd ^= (*hashcode)[side][piece][f].bd; \ hashkey ^= (*hashcode)[side][piece][f].key; \ } \ \ if ((t) >= 0) \ { \ hashbd ^= (*hashcode)[side][piece][t].bd; \ hashkey ^= (*hashcode)[side][piece][t].key; \ } \ } #define UpdateDropHashbd(side, piece, count) \ { \ hashbd ^= (*drop_hashcode)[side][piece][count].bd; \ hashkey ^= (*drop_hashcode)[side][piece][count].key; \ } extern short rpthash[2][256]; extern char *DRAW; extern char* DRAW_REPETITION; extern char *DRAW_MAXMOVES; extern char *DRAW_JUSTDRAW; #define row(a) ((a) / NO_COLS) #define column(a) ((a) % NO_COLS) #define locn(a, b) (((a) * NO_COLS) + b) /* init external functions */ extern void InitConst(char *lang); /* init.c */ extern int Initialize_data(void); /* init.c */ extern void Free_data(void); /* init.c */ extern int Lock_data(void); /* init.c */ extern void Unlock_data(void); /* init.c */ extern void Initialize_dist(void); /* init.c */ extern void Initialize_eval(void); /* eval.c */ extern void NewGame(void); extern void GetOpenings(void); extern int OpeningBook(unsigned short *hint); typedef enum { REMOVE_PIECE = 1, ADD_PIECE } UpdatePieceList_mode; extern void UpdatePieceList(short side, short sq, UpdatePieceList_mode iop); typedef enum { FOREGROUND_MODE = 1, BACKGROUND_MODE } SelectMove_mode; extern void SelectMove(short side, SelectMove_mode iop); extern int search(short side, short ply, short depth, short alpha, short beta, unsigned short *bstline, short *rpt); #ifdef CACHE void PutInEETable(short side, int score); int CheckEETable(short side); int ProbeEETable(short side, short *score); #endif #if ttblsz extern int ProbeTTable(short side, short depth, short ply, short *alpha, short *beta, short *score); extern int PutInTTable(short side, short score, short depth, short ply, short beta, unsigned short mv); extern void ZeroTTable(void); extern void ZeroRPT(void); extern void Initialize_ttable(void); extern unsigned int urand(void); # ifdef HASHFILE extern void gsrand(unsigned int); extern int ProbeFTable(short side, short depth, short ply, short *alpha, short *beta, short *score); extern void PutInFTable(short side, short score, short depth, short ply, short alpha, short beta, unsigned short f, unsigned short t); # endif /* HASHFILE */ #endif /* ttblsz */ #if !defined SAVE_NEXTPOS extern void Initialize_moves(void); #endif extern short generate_move_flags; extern void MoveList(short side, short ply, short in_check, short blockable); extern void CaptureList(short side, short ply, short in_check, short blockable); /* from attacks.c */ extern int SqAttacked(short square, short side, short *blockable); extern void MakeMove(short side, struct leaf *node, short *tempb, short *tempc, short *tempsf, short *tempst, short *INCscore); extern void UnmakeMove(short side, struct leaf *node, short *tempb, short *tempc, short *tempsf, short *tempst); extern void InitializeStats(void); extern int evaluate(short side, short ply, short alpha, short beta, short INCscore, short *InChk, short *blockable); extern short ScorePosition(short side); extern void ExaminePosition(short side); extern short ScorePatternDistance(short side); extern void DetermineStage(short side); extern void UpdateWeights(short side); extern int InitMain(void); extern void ExitMain(void); extern void Initialize(void); extern void InputCommand(char *command); extern void ExitShogi(void); extern void ClearScreen(void); extern void SetTimeControl(void); extern void SelectLevel(char *sx); extern void UpdateDisplay(short f, short t, short flag, short iscastle); typedef enum { COMPUTE_AND_INIT_MODE = 1, COMPUTE_MODE #ifdef INTERRUPT_TEST , INIT_INTERRUPT_MODE, COMPUTE_INTERRUPT_MODE #endif } ElapsedTime_mode; extern void SetResponseTime(short side); extern void CheckForTimeout(int score, int globalscore, int Jscore, int zwndw); extern void ShowSidetoMove(void); extern void ShowResponseTime(void); extern void ShowPatternCount(short side, short n); extern void SearchStartStuff(short side); extern void ShowDepth(char ch); extern void TerminateSearch(int); extern void ShowResults(short score, unsigned short *bstline, char ch); extern void SetupBoard(void); extern void algbr(short f, short t, short flags); extern void OutputMove(void); extern void ShowCurrentMove(short pnt, short f, short t); extern void ListGame(void); extern void ShowMessage(char *s, ...); extern void ClearScreen(void); extern void DoDebug(void); extern void DoTable(short table[NO_SQUARES]); extern void ShowPostnValues(void); extern void ChangeXwindow(void); extern void SetContempt(void); extern void ChangeHashDepth(void); extern void ChangeBetaWindow(void); extern void GiveHint(void); extern void ShowPrompt(void); extern void EditBoard(void); extern void help(void); extern void ChangeSearchDepth(void); extern void skip(void); extern void skipb(void); extern void EnPassant(short xside, short f, short t, short iop); extern void ShowNodeCnt(long NodeCnt); extern void ShowLine(unsigned short *bstline); extern int pick(short p1, short p2); extern short repetition(void); extern void TimeCalc(void); extern void ElapsedTime(ElapsedTime_mode iop); extern short IsCheckmate(short side, short in_check, short blockable); /* genmoves.c */ typedef enum { VERIFY_AND_MAKE_MODE, VERIFY_AND_TRY_MODE, UNMAKE_MODE } VerifyMove_mode; extern int VerifyMove(char *s, VerifyMove_mode iop, unsigned short *mv); extern unsigned short TTage; /* display driver framework */ struct display { void (*ChangeAlphaWindow)(void); void (*ChangeBetaWindow)(void); void (*ChangeHashDepth)(void); void (*ChangeSearchDepth)(char *sx); void (*ChangeXwindow)(void); void (*ClearScreen)(void); void (*DoDebug)(void); void (*DoTable)(short table[NO_SQUARES]); void (*EditBoard)(void); void (*ExitShogi)(void); void (*GiveHint)(void); void (*Initialize)(void); void (*ShowNodeCnt)(long NodeCnt); void (*OutputMove)(void); void (*PollForInput)(void); void (*SetContempt)(void); void (*SearchStartStuff)(short side); void (*SelectLevel)(char *sx); void (*ShowCurrentMove)(short pnt, short f, short t); void (*ShowDepth)(char ch); void (*ShowGameType)(void); void (*ShowLine)(unsigned short *bstline); void (*ShowMessage)(char *s, ...); void (*AlwaysShowMessage)(const char *format, ...); void (*Printf)(const char *format, ...); void (*doRequestInputString)(const char* fmt, char* buffer); int (*GetString)(char* sx); void (*SetupBoard)(void); void (*ShowPatternCount)(short side, short n); void (*ShowPostnValue)(short sq); void (*ShowPostnValues)(void); void (*ShowPrompt)(void); void (*ShowResponseTime)(void); void (*ShowResults)(short score, unsigned short *bstline, char ch); void (*ShowSidetoMove)(void); void (*ShowStage)(void); void (*TerminateSearch)(int sig); void (*UpdateClocks)(void); void (*UpdateDisplay)(short f, short t, short redraw, short isspec); void (*help)(void); }; extern struct display *dsp; extern struct display raw_display; extern struct display curses_display; #endif /* _GNUSHOGI_H_ */ gnushogi-1.5pre/gnushogi/sizetest.c0000644000175000017500000001663012364540012014476 00000000000000/* * FILE: sizetest.c * * Display memory usage of GNU Shogi data structures. * * ---------------------------------------------------------------------- * Copyright (c) 1993, 1994, 1995 Matthias Mutz * Copyright (c) 1999 Michael Vanier and the Free Software Foundation * Copyright (c) 2008, 2013, 2014 Yann Dirson and the Free Software Foundation * * GNU SHOGI is based on GNU CHESS * * Copyright (c) 1988, 1989, 1990 John Stanback * Copyright (c) 1992 Free Software Foundation * * This file is part of GNU SHOGI. * * GNU Shogi is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 3 of the License, * or (at your option) any later version. * * GNU Shogi is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with GNU Shogi; see the file COPYING. If not, see * . * ---------------------------------------------------------------------- * */ #include "gnushogi.h" #include struct leaf *Tree, *root; short FROMsquare, TOsquare; small_short ChkFlag[MAXDEPTH], CptrFlag[MAXDEPTH], TesujiFlag[MAXDEPTH]; short Pscore[MAXDEPTH], Tscore[MAXDEPTH]; small_short Pindex[NO_SQUARES]; short mtl[2], hung[2]; small_short PieceCnt[2]; struct GameRec *GameList; char ColorStr[2][10]; long znodes; /* * In a networked enviroment gnushogi might be compiled on different hosts * with different random number generators; that is not acceptable if they * are going to share the same transposition table. */ unsigned long next = 1; unsigned int urand(void) { next *= 1103515245; next += 12345; return ((unsigned int) (next >> 16) & 0xFFFF); } void gsrand(unsigned int seed) { next = seed; } #if ttblsz struct hashentry *ttable[2]; unsigned int ttblsize; #endif #ifdef BINBOOK extern char *binbookfile; #endif extern char *bookfile; char savefile[128] = ""; char listfile[128] = ""; #if defined HISTORY unsigned short *history; #endif short rpthash[2][256]; short TrPnt[MAXDEPTH]; small_short PieceList[2][NO_SQUARES]; small_short PawnCnt[2][NO_COLS]; small_short Captured[2][NO_PIECES]; small_short Mvboard[NO_SQUARES]; #if !defined SAVE_SVALUE short svalue[NO_SQUARES]; #endif struct flags flag; short opponent, computer, WAwindow, WBwindow, BAwindow, BBwindow, dither, INCscore; long ResponseTime, ExtraTime, MaxResponseTime, et, et0, time0, ft; long GenCnt, NodeCnt, ETnodes, EvalNodes, HashCnt, HashAdd, FHashCnt, FHashAdd, HashCol, THashCol, filesz, hashmask, hashbase; long replus, reminus; short HashDepth = HASHDEPTH, HashMoveLimit = HASHMOVELIMIT; short player, xwndw; /*unsigned*/ short rehash; /* -1 is used as a flag --tpm */ short Sdepth, Game50, MaxSearchDepth; short GameCnt = 0; short contempt; int Book; struct TimeControlRec TimeControl; int TCadd = 0; short TCflag, TCmoves, TCminutes, TCseconds, OperatorTime; short XCmoves[3], XCminutes[3], XCseconds[3], XC, XCmore; const short otherside[3] = { white, black, neutral }; unsigned short hint; short TOflag; /* force search re-init if we backup search */ unsigned short killr0[MAXDEPTH], killr1[MAXDEPTH]; unsigned short killr2[MAXDEPTH], killr3[MAXDEPTH]; unsigned short PV, SwagHt, Swag0, Swag1, Swag2, Swag3, Swag4, sidebit; small_short HasPiece[2][NO_PIECES]; const short kingP[3] = { 4, 76, 0 }; const long control[NO_PIECES] = { 0, ctlP, ctlL, ctlN, ctlS, ctlG, ctlB, ctlR, ctlPp, ctlLp, ctlNp, ctlSp, ctlBp, ctlRp, ctlK }; short stage, stage2; FILE *hashfile; unsigned int starttime; short ahead = true, hash = true; int timeopp[MINGAMEIN], timecomp[MINGAMEIN]; int compptr, oppptr; void TimeCalc() { /* adjust number of moves remaining in gamein games */ int increment = 0; int topsum = 0; int tcompsum = 0; int me, him; int i; /* don't do anything til you have enough numbers */ if (GameCnt < (MINGAMEIN * 2)) return; /* calculate average time in sec for last MINGAMEIN moves */ for (i = 0; i < MINGAMEIN; i++) { tcompsum += timecomp[i]; topsum += timeopp[i]; } topsum /= (100 * MINGAMEIN); tcompsum /= (100 * MINGAMEIN); /* if I have less time than opponent add another move */ me = TimeControl.clock[computer] / 100; him = TimeControl.clock[opponent] / 100; if (me < him) increment += 2; if (((him - me) > 60) || ((me < him) && (me < 120))) increment++; /* if I am losing more time with each move add another */ /* if (!((me - him) > 60) && tcompsum > topsum) increment++; */ if (tcompsum > topsum) { increment += 2; } else if ((TimeControl.moves[computer] < MINMOVES) && !increment) { /* but don't let moves go below MINMOVES */ increment++; } else if ((me > him) && (tcompsum < topsum)) { /* if I am doing really well use more time per move */ increment = -1; } TimeControl.moves[computer] += increment; } int main(int argc, char **argv) { long l; int n; #if ttblsz l = (long)sizeof(struct hashentry); n = (int)((l * (ttblsz + rehash) * 2) / 1000); printf("ttable:\t\t%4d\tkByte\t[hashentry:%ld " "* (ttblsz:%d + rehash:%d) * 2]\n", n, l, ttblsz, rehash); #endif #if defined CACHE l = (long)sizeof(struct etable); n = (int)((l * (size_t)ETABLE) / 1000); #else l = n = 0; #endif printf("etab:\t\t%4d\tkByte\t[etable:%ld ETABLE:%d]\n", n, l, ETABLE); l = (long)sizeof(struct leaf); n = (int)(l * TREE / 1000); printf("Tree:\t\t%4d\tkByte\t[leaf:%ld * TREE:%d]\n", n, l, TREE); #if defined HISTORY n = (int)(sizeof_history / 1000); #else n = 0; #endif printf("history:\t%4d\tkByte\t[unsigned short:%lu " "* HISTORY_SIZE:%ld]\n", n, sizeof(unsigned short), (long)HISTORY_SIZE); #ifndef SAVE_NEXTPOS l = (long)sizeof(next_array); n = (int)((l * NO_PTYPE_PIECES) / 1000); printf("nextpos:\t%4d\tkByte\t[next_array:%ld " "* NO_PTYPE_PIECES:%d]\n", n, l, NO_PTYPE_PIECES); l = (long)sizeof(next_array); n = (int)((l * NO_PTYPE_PIECES) / 1000); printf("nextdir:\t%4d\tkByte\t[next_array:%ld " "* NO_PTYPE_PIECES:%d]\n", n, l, NO_PTYPE_PIECES); #endif #ifndef SAVE_DISTDATA n = (int)(sizeof(distdata_array) / 1000); printf("distdata:\t%4d\tkByte\n", n); #endif #ifndef SAVE_PTYPE_DISTDATA l = (long)sizeof(distdata_array); n = (int)((l * NO_PTYPE_PIECES) / 1000); printf("ptype_distdata:\t%4d\tkByte\t[distdata_array:%ld " "* NO_PTYPE_PIECES:%d]\n", n, l, NO_PTYPE_PIECES); #endif l = (long)sizeof(hashcode_array); n = (int)(l / 1000); printf("hashcode:\t%4d\tkByte\t[hashval:%ld]\n", n, (long)sizeof(struct hashval)); l = (long)sizeof(drop_hashcode_array); n = (int)(l / 1000); printf("drop_hashcode:\t%4d\tkByte\t[hashval:%ld]\n", n, (long)sizeof(struct hashval)); l = (long)sizeof(value_array); n = (int)(l / 1000); printf("value:\t\t%4d\tkByte\n", n); l = (long)sizeof(fscore_array); n = (int)(l / 1000); printf("fscore:\t\t%4d\tkByte\n", n); return 0; } gnushogi-1.5pre/gnushogi/opts.h0000644000175000017500000001050412363546414013623 00000000000000/* * FILE: opts.h * * #defines to set various options. * * ---------------------------------------------------------------------- * Copyright (c) 1993, 1994, 1995 Matthias Mutz * Copyright (c) 1999 Michael Vanier and the Free Software Foundation * Copyright (c) 2008, 2013, 2014 Yann Dirson and the Free Software Foundation * * GNU SHOGI is based on GNU CHESS * * Copyright (c) 1988, 1989, 1990 John Stanback * Copyright (c) 1992 Free Software Foundation * * This file is part of GNU SHOGI. * * GNU Shogi is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 3 of the License, * or (at your option) any later version. * * GNU Shogi is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with GNU Shogi; see the file COPYING. If not, see * . * ---------------------------------------------------------------------- * */ /* * This file is for options that control the behavior of GNU shogi, * probably only be of interest to people who are hacking the source codes. * They were previously placed on the * command line as -D