xshogi(6)

๐ŸŽ€ xshogi(6) โ€” Games Manual ๐ŸŽ€

okay bestie, buckle up, because this is xshogi(6) from the Games Manual section and she is long and she is iconic. grab a snack ๐Ÿ“


โœจ NAME โœจ

xshogi โ€” Xt/Athena user interface for gnushogi ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

xshogi [ options ]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

xshogi hands you a whole X11/Xt/Athena Widgets user interface for gnushogi. no cap. with xshogi you can:

  • play gnushogi like the main character you are
  • set up arbitrary positions
  • force variations
  • sit back and watch xshogi manage a whole game between two shogi programs ๐Ÿ‘‘

and like, it can even be the interface between two players on different displays. long-distance shogi besties, we love to see it.

xshogi also works as a plain old shogi board for playing out games. it'll read through a game file, or let a player play through a variation manually (that's force mode). super useful for keeping track of email postal games, or for browsing games off the net. ๐Ÿงš

after you start xshogi, you make moves by pressing mouse button 1 while the cursor is over a square with your piece on it, then dragging the mouse to another square. if the move is illegal, gnushogi simply will not allow it, and xshogi will then retract the move. that's it. that's the whole vibe. ๐Ÿ™ˆ


๐Ÿ’œ RULES ๐Ÿ’œ

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
  • nine Pawns

the player moving up the board and making the first move is referred to as black, and his opponent white โ€” even though in Shogi sets all pieces have the same colour. ๐Ÿ˜ญ they're 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.


๐ŸŒˆ Moves

  • King โ€” one step in any direction per move
  • Gold General โ€” one step per move any way except diagonally 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

๐ŸŒŸ 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. no takebacks on that one.

in Shogi sets, promoting a piece is done by turning this piece upside down. its promoted name is written on its other side. ๐ŸŽ€

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.

๐Ÿซถ 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 possibility 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 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. ๐Ÿงš

not me explaining 1000-year-old Japanese chess strategy in a terminal ๐Ÿ’… but fr fr, this is all in the original, i'm just saying it with love.

more parts incoming bestie, don't go anywhere ๐Ÿฆ‹

โœจ OPTIONS โœจ

okay bestie, so these command line options? they also double as X resources you can drop straight into your .Xdefaults or .Xresources file. two for one, we love a versatile icon ๐Ÿ’…

๐ŸŒˆ standard Xt options

xshogi accepts standard Xt options like -display, -geometry, -iconic, -bg etc. classic Xt behavior, nothing weird, slay.

๐ŸŽ€ the actual options

  • -tc or -timeControl minutes[:seconds] โ€” how much time you get for a set of moves, and that set size is decided by movesPerSession. if you play that many moves inside the time control period, xshogi resets the time clocks. default: 5 minutes. clock resetting? iconic behavior honestly โฐ
  • -mps or -movesPerSession moves โ€” how many moves live inside one time control period. default: 40 moves.
  • -st or -searchTime minutes[:seconds] โ€” tells gnushogi to spend at most this much time searching for each of its moves. if you don't set this, gnushogi figures out its own search time based on how many moves are left and how much time remains until the next time control. heads up: setting this option also sets -clockMode to False.
  • -sd or -searchDepth number โ€” tells gnushogi to look ahead at most this many moves when it's picking what to play. without it, gnushogi picks its own search depth based on moves remaining and time until the next time control. same caveat bestie: setting this also sets -clockMode to False.
  • -clock or -clockMode (True | False) โ€” decides whether the clock runs at all. if clockMode is False, the clock doesn't run โ€” but the side that's up next still gets highlighted, so you're never lost ๐Ÿ‘€
  • -td or -timeDelay seconds โ€” time delay between moves during "Load Game". doesn't have to be a round number, so go wild. try -td 0.4. default: 1 second.
  • -nsp or -noShogiProgram (True | False) โ€” if this is True, xshogi just becomes a passive shogiboard ๐Ÿซถ it does not try to start a shogi program, and it won't even check whether moves made in Force mode are legal. it also sets -clockMode to False. default: False.
  • -fsp or -firstShogiProgram program โ€” name of the first shogi program. in matches between two machines, this one plays white. default: "gnushogi".
  • -ssp or -secondShogiProgram program โ€” name of the second shogi program, if you need one. in matches between two machines, this one plays black; otherwise it doesn't even get started. default: "gnushogi".
  • -fh or -firstHost host โ€” name of the host the first shogi program plays on. default: "localhost".
  • -sh or -secondHost host โ€” name of the host the second shogi program plays on. default: "localhost".
  • -rsh or -remoteShell shell_name โ€” some systems don't use rsh as their remote shell, and this option lets you name the remote shell command instead. do it in the resource file, bestie.
  • -mm or -matchMode (False | Init | Position | Opening) โ€” automatically runs a whole game between firstShogiProgram and secondShogiProgram, no cap. if matchMode is Init, xshogi starts from the initial shogi position. if it's Position, xshogi starts from the position named by the loadPositionFile resource. if it's Opening, xshogi plays out the opening moves named by the -loadGameFile resource. and if the -saveGameFile resource is set, a move record for the match gets saved into that file. default: "False".
  • -lgf or -loadGameFile file โ€” name of the file to read a game record from. game files live in the directory named by the SHOGIDIR environment variable. if that variable isn't set, the current directory is used โ€” unless the file name starts with a /.
  • -lpf or -loadPositionFile file โ€” name of the file to read a game position from. position files also live in the directory named by SHOGIDIR. if it's not set, current directory, same deal โ€” unless the name starts with a /.
  • -sgf or -saveGameFile file โ€” name of the file to save a game record to. game files get saved in the directory named by SHOGIDIR. not set? current directory, unless the file name starts with a /.
  • -spf or -savePositionFile file โ€” name of the file to save a game position to. position files get saved in the SHOGIDIR directory. if it's unset, current directory is the move โ€” unless the name starts with a /.
  • -coords or -showCoords (True | False) โ€” if True, xshogi shows algebraic coordinates along the board's left and bottom edges. default is False. the coordFont resource decides which font gets used for them.
  • -mono or -monoMode (True | False) โ€” monochrome mode. ngl you shouldn't have to set this yourself; xshogi works out whether it needs it. it's giving self-sufficient ๐Ÿ’…
  • -pc or -pieceColor color โ€” color spec for the pieces, in a format suitable for XParseColor(). default: #FFFFD7.
  • -sc or -squareColor color โ€” same thing but for the squares. default: #EBDFB0.
  • -wps or -westernPieceSet (True | False) โ€” picks the Western style piece set. aesthetics, we love her ๐ŸŽจ
  • -npb or -normalPawnBitmap file
  • -nnb or -normalKnightBitmap file
  • -nbb or -normalBishopBitmap file
  • -nrb or -normalRookBitmap file
  • -nkb or -normalKingBitmap file โ€” names of the bitmap files used for the bitmap piece icons.
  • -rpb or -reversePawnBitmap file
  • -rnb or -reverseKnightBitmap file
  • -rbb or -reverseBishopBitmap file
  • -rrb or -reverseRookBitmap file
  • -rkb or -reverseKingBitmap file โ€” names of the bitmap files used for the outline piece icons.
  • -debug or -debugMode (True | False) โ€” turns on debugging printout. for when you need to see the receipts ๐Ÿ”

๐Ÿ’– RESOURCES ๐Ÿ’–

๐Ÿฆ‹ initString

the actual string that gets sent to initialize the shogi program can be set from .Xdefaults. it can't be set from the command line, because syntax problems said no ๐Ÿ™ˆ the default value is:

new\nbeep\nrandom\neasy\n

the "new" and "beep" commands are required, periodt. you can remove the "random" command if you want; including it makes gnushogi randomize its move selection a little so it doesn't play the exact same moves every single game. and even without "random", gnushogi still randomizes its choice of moves from its opening book, so it's fine either way. you can also drop "easy" if you like; including it toggles easy mode off, which makes gnushogi think on your time. that is: if "easy" is in the initString, gnushogi thinks on your time; if it's not, it does not. (yes, this does seem backwards, doesn't it. it IS backwards. we're not going to talk about it ๐Ÿ˜ญ) you can also try adding other commands to the initString โ€” go read the gnushogi documentation for the deets.

๐ŸŒธ blackString and whiteString

these resources control what gets sent when the Machine Black and Machine White buttons are selected. mostly it's there for compatibility with obsolete versions of gnushogi, so it's giving legacy queen energy ๐Ÿ‘‘

โญ alternate bitmaps

alternate bitmaps for piece icons can be specified either by choosing one of the built-in sets or with the file name resources described above. there are three built-in sets of piece bitmaps: large (the default), medium, or small. easiest way is to pick the one you want in the .Xdefaults file:

XShogi*boardSize:   Medium

๐ŸŽ€ fonts

the font used for button labels and comments can be changed in the .Xdefaults file too. you might wanna pick a smaller font if you're running the small pieces:

XShogi*font:    helvetica_oblique12

and the font used for coordinates (that's when the showCoords option is True) gets set the same way:

XShogi*coordFont:    helvetica_10

๐ŸŒˆ grayscale glow-up

if you're on a grayscale monitor, try setting the colors to:

XShogi*pieceColor:     gray100
XShogi*squareColor:    gray60

monochrome but make it cute ๐Ÿ’…

๐ŸŽฎ COMMAND BUTTONS AND KEYS ๐ŸŽฎ

okay bestie, this is the part where you learn what all the little buttons do. every single one. no skipping ๐Ÿ’…

  • Quit โ€” exits xshogi, bye bestie ๐Ÿ‘‹. Q or q does the exact same thing from your keyboard.
  • Reset โ€” takes xshogi all the way back to the start of a shogi game. it also deselects any game or position files you had going, so it's a full glow-up reset โœจ.
  • Flip View โ€” inverts the view of the shogi board. upside down era ๐Ÿ™ƒ.
  • Hint โ€” shows you a move hint from gnushogi. your little chess... shogi... fairy godmother ๐Ÿงš.
  • Load Game โ€” plays a game from a record file. if you don't name a file, a popup dialog asks for a filename. game files live in the directory named by the SHOGIDIR environment variable. if that variable isn't declared, the current directory is used instead โ€” unless the file name starts with a /. G or g is the keyboard equivalent. the game file parser will accept almost any file that contains moves in algebraic notation. if the first line begins with #, it's assumed to be a title and gets displayed. text enclosed in parentheses or square brackets is assumed to be commentary and gets displayed in a pop-up window. any other text in the file is just ignored, no thoughts head empty ๐Ÿ’€.
  • Load Position โ€” sets up a position from a position file. if you don't name a file, a popup dialog asks for a filename. position files live in the directory named by the SHOGIDIR environment variable. if that variable isn't declared, the current directory is used โ€” unless the file name starts with a /. position files must be in the format that the Save Position command writes, no freestyling ๐Ÿšซ.
  • Save Game โ€” saves a game to a record file. if you don't name a file, a popup dialog asks for a filename. if the filename already exists, the user is asked whether the current game record should be appended to this file or whether the file should be replaced. game files are saved in the directory named by the SHOGIDIR environment variable. if that variable isn't declared, the current directory is used โ€” unless the file name starts with a /. game files are human-readable, and can also be read back by the Load Game command. furthermore, they are accepted as gnushogi text bookfiles ๐Ÿ”ฅ.
  • Save Position โ€” saves a position to a position file. if you don't name a file, a popup dialog asks for a filename. position files are saved in the directory named by the SHOGIDIR environment variable. if that variable isn't declared, the current directory is used โ€” unless the file name starts with a /. position files are human-readable, and can also be read back by the Load Position command ๐Ÿซถ.
  • Machine White โ€” forces gnushogi to play white.
  • Machine Black โ€” forces gnushogi to play black.
  • Force Moves โ€” forces a series of moves. that is, gnushogi stops playing and xshogi lets you make moves for both white and black. you're the main character now ๐Ÿ‘‘.
  • Two Machines โ€” plays a game between two computer programs. robot vs robot, no humans invited ๐Ÿค–.
  • Forward โ€” moves forward through a series of remembered moves. F or f is the keyboard equivalent.
  • Backward โ€” moves backward through a series of remembered moves. side effect alert: it puts xshogi into Force Moves mode. B or b is the keyboard equivalent.
  • Pause โ€” pauses the clocks, or (in Load Game mode) pauses the game being loaded. press Pause again to continue. P or p is the keyboard equivalent โธ๏ธ.
  • Edit Position โ€” lets you set up an arbitrary board position. use mouse button 1 to drag pieces to new squares, or to delete a piece by dragging it off the board or dragging an empty square on top of it. to drop a new piece on a square, press mouse button 2 or 3 over the square. this brings up a menu of black pieces (button 2) or white pieces (button 3). additional menu choices let you empty the square or clear the board. you can set the side to play next by clicking on the Black or White indicator at the top of the screen. full custom era ๐Ÿ’…โœจ.
  • Challenge โ€” allows you to make a two display game between two human players. enter the display you want to connect to. if you are allowed to connect, a new board is displayed at the remote display. challenge mode can only be stopped by pressing "quit". like, that's the only way out, no cap ๐Ÿ˜ญ.
  • Select Level โ€” allows you to reset the clocks for both players. enter the number of moves and the number of minutes in which the moves should be done.
  • Move NOW โ€” force computer to stop thinking and to make the current best move. hurry uppp ๐Ÿ”ฅ.
  • Iconify โ€” I, i, C or c iconifies xshogi.

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€


โš ๏ธ LIMITATIONS โš ๏ธ

bestie, read this part, it's the fine print and it WILL get you ๐Ÿ™ˆ:

  • If you press the Pause button during gnushogi's turn, xshogi will stop the clocks, but gnushogi will still make a move. yeah. it does that ๐Ÿ’€.
  • After a mate or draw when playing against gnushogi, if you back up with the Backward button, the clocks are reset (because gnushogi has exited and must be restarted).
  • Some xshogi functions may not work with versions of gnushogi earlier than 1.1, patchlevel 02.
  • The game parser recognizes only algebraic notation.

๐Ÿ’– AUTHORS ๐Ÿ’–

giving credit where credit is due, iconic behavior:

  • Original authors of XBoard: Chris Sears and Dan Sears.
  • Enhancements for XBoard (Version 2.0): Tim Mann.
  • Conversion to XShogi (Version 1.1): Matthias Mutz.
  • Current maintainer: Mike Vanier.

XShogi borrows some of its piece bitmaps from CRANES Shogi.

Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. Enhancements Copyright 1992 Free Software Foundation, Inc. Enhancements Copyright 1993 Matthias Mutz

The following terms apply to Digital Equipment Corporation's copyright interest in XBoard:

All Rights Reserved

Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that the name of
Digital not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission.

DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

The following terms apply to the enhanced version of XShogi distributed by the Free Software Foundation:

This file is part of XSHOGI.

XSHOGI is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY.  No author or distributor accepts
responsibility to anyone for the consequences of using it or for
whether it serves any particular purpose or works at all, unless
he says so in writing.  Refer to the XSHOGI General Public
License for full details.

Everyone is granted permission to copy, modify and redistribute
XSHOGI, but only under the conditions described in the XSHOGI
General Public License. A copy of this license is supposed to
have been given to you along with XSHOGI so you can know your
rights and responsibilities.  It should be in a file named
COPYING.  Among other things, the copyright notice and this
notice must be preserved on all copies.

and that's the whole page bestie, you made it to the end ๐ŸŽ€ this one's from X Version 11, dated Jan 29, 1993 โ€” vintage, iconic, timeless, no notes ๐Ÿ’œ go forth and slay some shogi ๐Ÿฆ‹๐Ÿ‘‘