Template:Shogi diagram/doc

From MOASSpedia
Jump to navigation Jump to search

Usage

This is a template that can be used to create simple diagrams of shogi positions.

Syntax

An example of the starting position for shogi can be found at Even game between players of same rank .

{{shogi diagram 
| <1>
| <2>
| <3>
| <4> | <5> | <6> | <7> | <8> | <9> | <10> | <11> | <12>
| <13> | <14> | <15> | <16> | <17> | <18> | <19> | <20> | <21>
| <22> | <23> | <24> | <25> | <26> | <27> | <28> | <29> | <30>
| <31> | <32> | <33> | <34> | <35> | <36> | <37> | <38> | <39>
| <40> | <41> | <42> | <43> | <44> | <45> | <46> | <47> | <48>
| <49> | <50> | <51> | <52> | <53> | <54> | <55> | <56> | <57>
| <58> | <59> | <60> | <61> | <62> | <63> | <64> | <65> | <66>
| <67> | <68> | <69> | <70> | <71> | <72> | <73> | <74> | <75>
| <76> | <77> | <78> | <79> | <80> | <81> | <82> | <83> | <84>
| <85>
| <86>
}}

Parameters

  • <1>: "floatright" or "tright" and "floatleft" or "tleft" sets the horizontal placement of the diagram in the article space: "tright" means diagram will be floated to the right allowing any text to flow to the left, and "tleft" means diagram will be floated to the left allowing any text to flow to the right. No entry for this parameter means that the diagram will simply be displayed in the default position on the left.
  • <2>: Explanation added to top of diagram. For example, a player's name, the name of an opening, etc. (optional)
  • <3>: This is the parameter for the pieces in hand for the White player (gote).
  • <4> to <84>: Each number represents a square on the board, from square 3 (9th file, ath rank: "9a") in the upper left of the board to square 83 (1st file, ith rank: "1i") in the lower right of the board. Codes for "piece types" (see below) can be entered to display pieces on the board. No entry of a code means no piece will be displayed on that particular square.
  • <85>: This is the parameter for the pieces in hand for the Black player (gote).
  • <86>: Explanation added to bottom of diagram; For example, a player's name, etc. (optional)

"Piece type" entry

Squares with no entry made for "piece type" will be displayed as an "empty square".

A "piece type" is designated by a combination of two to four letters like XXYZ.

The XX part represents a one or two letter combination which indicates the piece type.
The piece type codes are as follows:
  • Shogi ks22.svg/Shogi aks22.svg k - 玉将 (gyokushō) or 王将 (Ōshō) (king)
  • Shogi rs22.svg r - 飛車 (hisha) (rook)
  • Shogi bs22.svg b - 角行 (kakugyō) (bishop)
  • Shogi gs22.svg g - 金将 (kinshō) (gold)
  • Shogi ss22.svg s - 銀将 (ginshō) (silver)
  • Shogi ns22.svg n - 桂馬 (keima) (knight)
  • Shogi ls22.svg l - 香車 (kyōsha) (lance)
  • Shogi ps22.svg p - 歩兵 (fuhyō) (pawn)
  • Shogi ds22.svg d - 龍王 (ryūō) (dragon or promoted rook)
  • Shogi dxs22.svgdx - 竜王 (ryūō) (simplified character for promoted rook)
  • Shogi hs22.svg h - 龍馬 (ryūma) (horse or promoted bishop)
  • Shogi pss22.svg ps - 成銀 (narigin) (promoted silver)
  • Shogi pns22.svg pn - 成桂 (narikei) (promoted knight)
  • Shogi pnxs22.svg pnx - (variant character for promoted knight)
  • Shogi pls22.svg pl - 成香 (narikyō) (promoted lance)
  • Shogi plxs22.svg plx - (variant character for promoted lance)
  • Shogi ts22.svg t - と金 (tokin or promoted pawn)
  • Shogi txs22.svg tx - (variant character for promoted pawn)
Sho shogi codes:
  • Shogi es22.svg e - 酔象 (elephant)
  • Shogi as22.svg t - 太子 (crown prince or promoted elephant)
Please note that all of the above combinations are case sensitive, so lower case letters must be used.
All things considered equal, the "king" of the player who is "sente" (i.e., the player who moves first) is indicated by and the "king" of the player who is "gote" (i.e., the player moves second) is indicated by . In even games between players of different ranks, the "king" of the higher ranked player is , and the "king" of the lower ranked player is . In handicap shogi, even though the player giving the handicap (上手, uwate) moves first, their "king" is and the "king" of the player receiving the handicap (下手, shitate) is . In problems, the "king" of the attacking (or mating) side is and the "king" of the defending side is . To indicate for "gote" (e.g., the lower ranked player in an even game is "gote") or for "sente", insert ak instead of k into the template.

Sente or gote

The Y indicates sente (black) or gote (white). For "sente" add the letter s, and for "gote" add the letter g to the end of the character string. Sente's pieces will be displayed at the bottom of the board facing up and gote's pieces will be displayed at the top of the board facing down. So a "pawn" for "sente" is indicated as ps, while a "rook" for "gote" is indicated as rg.

  • Shogi ps22.svg - ps
  • Shogi pg22.svg - pg

Last move played

The Z indicates the last move played. To indicate a piece that has just been moved, add the letter l (for last) to the end of the character string. For example, the show indicate that the last piece moved was a "rook" by "gote", use rgl.

  • Shogi rg22.svg - rg
  • Shogi rgl22.svg - rgl

Pieces-in-hand

Pieces-in-hand are entered directly into parameters <3> and <85>. The following characters (and templates) can be used: for "pawn", for "lance", for "knight", for "silver", for "gold", for "bishop", and for "rook".

To indicate that a player is holding more than one of the same type of piece in hand, one may use piece type + (number) if repeating multiple instances of the piece is unwieldy. For example, having 7 pawns in hand can be indicated as (7).

Exhaustive piece exemplification

ps Shogi ps22.svg pg Shogi pg22.svg psl Shogi psl22.svg pgl Shogi pgl22.svg ts Shogi ts22.svg tg Shogi tg22.svg tsl Shogi tsl22.svg tgl Shogi tgl22.svg txs Shogi txs22.svg txg Shogi txg22.svg txsl Shogi txsl22.svg txgl Shogi txgl22.svg

ls Shogi ls22.svg lg Shogi lg22.svg lsl Shogi lsl22.svg lgl Shogi lgl22.svg pls Shogi pls22.svg plg Shogi plg22.svg plsl Shogi plsl22.svg plgl Shogi plgl22.svg plxs Shogi plxs22.svg plxg Shogi plxg22.svg plxsl Shogi plxsl22.svg plxgl Shogi plxgl22.svg ns Shogi ns22.svg ng Shogi ng22.svg nsl Shogi nsl22.svg ngl Shogi ngl22.svg pns Shogi pns22.svg png Shogi png22.svg pnsl Shogi pnsl22.svg pngl Shogi pngl22.svg pnxs Shogi pnxs22.svg pnxg Shogi pnxg22.svg pnxsl Shogi pnxsl22.svg pnxgl Shogi pnxgl22.svg ss Shogi ss22.svg sg Shogi sg22.svg ssl Shogi ssl22.svg sgl Shogi sgl22.svg pss Shogi pss22.svg psg Shogi psg22.svg pssl Shogi pssl22.svg psgl Shogi psgl22.svg

gs Shogi gs22.svg gg Shogi gg22.svg gsl Shogi gsl22.svg ggl Shogi ggl22.svg

bs Shogi bs22.svg bg Shogi bg22.svg bsl Shogi bsl22.svg bgl Shogi bgl22.svg hs Shogi hs22.svg hg Shogi hg22.svg hsl Shogi hsl22.svg hgl Shogi hgl22.svg

rs Shogi rs22.svg rg Shogi rg22.svg rsl Shogi rsl22.svg rgl Shogi rgl22.svg ds Shogi ds22.svg dg Shogi dg22.svg dsl Shogi dsl22.svg dgl Shogi dgl22.svg dxs Shogi dxs22.svg dxg Shogi dxg22.svg dxsl Shogi dxsl22.svg dxgl Shogi dxgl22.svg

ks Shogi ks22.svg kg Shogi kg22.svg ksl Shogi ksl22.svg kgl Shogi kgl22.svg aks Shogi aks22.svg akg Shogi akg22.svg aksl Shogi aksl22.svg akgl Shogi akgl22.svg

es Shogi es22.svg eg Shogi eg22.svg esl Shogi esl22.svg egl Shogi egl22.svg as Shogi as22.svg ag Shogi ag22.svg asl Shogi asl22.svg agl Shogi agl22.svg

Other diagram files

These files can be used to create diagrams for explaining certain positions or indicating piece movement.

  • Shogi rah22.svgrah - indicate start position for a move one square to the right (rah is for 'right arrow half')
  • Shogi rat22.svg rat - indicate movement from left to right (rat is for 'right arrow tip')
  • Shogi ras22.svg ras - indicate start position from right to left (ras is for 'right arrow start')
  • Shogi lra22.svg lra - indicate movement from right to left or left to right (lra is for 'left right arrow')
  • Shogi lah22.svg lah - indicate start position for a move one square to the left (lah is for 'left arrow half')
  • Shogi lat22.svg lat - indicate movement from right to left (lat is for 'left arrow tip')
  • Shogi las22.svg las - indicate start positiong for movement from left to right (las is for 'left arrow start')
  • Shogi uah22.svg uah - indicate start position for a move one square upward (kadl is for 'up arrow half')
  • Shogi uat22.svg uat - indicate movement from bottom to top (uat is for 'upward arrow tip')
  • Shogi uas22.svg uas - indicate start position for movement from bottom to top (uas is for 'up arrow start')
  • Shogi uda22.svg uda - indicate movement from bottom to top or top to bottom (uda is for 'up down arrow')
  • Shogi dah22.svg dah - indicate start position for a move one square downward (dah is for 'down arrow half')
  • Shogi das22.svg das - indicate start position for movement from top to bottom (das is for 'down arrow start')
  • Shogi dat22.svg dat - indicate movement from top to bottom (dat is for 'downward arrow tip')
  • Shogi durh22.svg durh - indicate start position for a move one square diagonally upward to the right (durh is for 'diagonal up right half')
  • Shogi dau22.svg dau - indicate movement diagonally upward to the right (dau is for 'diagonal arrow upward')
  • Shogi daus44.png daus - indicate start position for movement diagonally upward to right (daus is for 'diagonal arrow upward start')
  • Shogi da44.png da - indicate movement diagonally left to right (da is for 'diagonal arrow')
  • Shogi ddlh22.svg ddlh - indicate start position for a move one square diagonally downward to the left (ddlh is for 'diagonal down left half')
  • Shogi dad22.svg dad - indicate movement diagonally downward to the left (dad is for 'diagonal arrow downward')
  • Shogi dads44.png dads - indicate start position for movement diagonally downward to left (dads is for 'diagonal arrow downward start')
  • Shogi dulh22.svg dulh - indicate start position for a move one square diagonally upward to the left (dulh is for 'diagonal up left half')
  • Shogi daau44.png daau - indicate movement diagonally upward to left (daau is for 'diagonal arrow averse upward')
  • Shogi daaus44.png daaus - indicate start position for movement diagonally upward to left (daaus is for 'diagonal arrow averse upward start')
  • Shogi daa44.png daa - indicate movement diagonally right to left (daa is for 'diagonal arrow averse')
  • Shogi ddrh22.svg ddrh - indicate start position for a move one square diagonally downward to the right (ddrh is for 'diagonal down right half')
  • Shogi daad44.png daad - indicate movement diagonally downward to right (daad is for 'diagonal arrow averse downward')
  • Shogi daads44.png daads - indicate start position for movement diagonally downward to right (daads is for 'diagonal arrow averse downward start')
  • Shogi kar22.svg kar - indicate movement of knight upward to the right (kar is for 'knight arrow right')
  • Shogi kal22.svg kal - indicate movement of knight upward to the left (kal is for 'knight arrow left')
  • Shogi kadr22.svg kadr - indicate movement of knight downward to the right (kadr is for 'knight arrow down right')
  • Shogi kadl22.svg kadl - indicate movement of knight downward to the left (kadl is for 'knight arrow down left')
  • Shogi ddl22.svg ddl - indicate movement of silver downward to the left (ddl is for 'diagonal down left')
  • Shogi ddr22.svg ddr - indicate movement of silver downward to the right (ddr is for 'diagonal down right')
  • Shogi dul22.svg dul - indicate movement of silver downward to the left (dul is for 'daigonal up left')
  • Shogi dur22.svg dur - indicate movement of silver downward to the right (dur is for 'diagonal up right')
  • Shogi yy22.svg yy - highlighted yellow square (yy is for 'yellow')
  • Shogi gr22.svg gr - highlighted gray square (gr is for 'gray')

Examples

The following are examples of the types of diagrams which can be created.

Even game between players of same rank

Diagrams for such positions typically show "sente" at the bottom of the board, and "gote" at the top. Relevant information such as player names, tournament names, etc. may be entered into parameters <2> and <84> if desired.

Gote
Pieces-in-hand: none
☖ pieces in hand: -
987654321 
1
       2
3
         4
         5
         6
7
       8
9
☗ pieces in hand: -
Sente
Pieces-in-hand: none
{{Shogi diagram|tright
|<small>Gote<br/>Pieces-in-hand: ''none''</small>
|-
|lg|ng|sg|gg|kg|gg|sg|ng|lg
|  |rg|  |  |  |  |  |bg|  
|pg|pg|pg|pg|pg|pg|pg|pg|pg
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|ps|ps|ps|ps|ps|ps|ps|ps|ps
|  |bs|  |  |  |  |  |rs|  
|ls|ns|ss|gs|ks|gs|ss|ns|ls
|-
|<small>Sente<br/>Pieces-in-hand: ''none''</small>}}




Even game, sente and gote reversed

Sente
Pieces-in-hand: none
☖ pieces in hand: -
987654321 
1
       2
3
         4
         5
         6
7
       8
9
☗ pieces in hand: -
Gote
Pieces-in-hand: none



{{Shogi diagram|tright
|<small>Sente<br/>Pieces-in-hand: none</small>
|-
|lg|ng|sg|gg|akg|gg|sg|ng|lg
|  |rg|  |  |  |  |  |bg|  
|pg|pg|pg|pg|pg|pg|pg|pg|pg
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|ps|ps|ps|ps|ps|ps|ps|ps|ps
|  |bs|  |  |  |  |  |rs|  
|ls|ns|ss|gs|aks|gs|ss|ns|ls
|-
|<small>Gote<br/>Pieces-in-hand: none</small>}}



Even game, gote lower ranked player

Gote
Pieces-in-hand: none
☖ pieces in hand: -
987654321 
1
       2
3
         4
         5
         6
7
       8
9
☗ pieces in hand: -
Sente
Pieces-in-hand: none



{{Shogi diagram|tright
|<small>Gote<br/>Pieces-in-hand: none</small>
|-
|lg|ng|sg|gg|akg|gg|sg|ng|lg
|  |rg|  |  |  |  |  |bg|  
|pg|pg|pg|pg|pg|pg|pg|pg|pg
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|ps|ps|ps|ps|ps|ps|ps|ps|ps
|  |bs|  |  |  |  |  |rs|  
|ls|ns|ss|gs|aks|gs|ss|ns|ls
|-
|<small>Sente<br/>Pieces-in-hand: none</small>}}



Handicap game (rook handicap)

Uwate
Pieces-in-hand: none
☖ pieces in hand: -
987654321 
1
        2
3
         4
         5
         6
7
       8
9
☗ pieces in hand: -
Shitate
Pieces-in-hand: none



{{Shogi diagram|tright
|<small>Uwate<br/>Pieces-in-hand: none</small>
|-
|lg|ng|sg|gg|kg|gg|sg|ng|lg
|  |  |  |  |  |  |  |bg|  
|pg|pg|pg|pg|pg|pg|pg|pg|pg
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|ps|ps|ps|ps|ps|ps|ps|ps|ps
|  |bs|  |  |  |  |  |rs|  
|ls|ns|ss|gs|ks|gs|ss|ns|ls
|-
|<small>Shitate<br/>Pieces-in-hand: none</small>}}



Last move played (e.g., Position after ....)

The diagram for the position after the moves 1. P-26, 2. P-84, 3. P-25, 4. P-85, 5. G-78, 6. G-32, 7. P-24, 8. Px24, 9. Rx24 is created as follows:

Position after 9. Rx24
Gote
Pieces-in-hand:
☖ pieces in hand: -
987654321 
 1
      2
  3
        4
        5
         6
 7
       8
 9
☗ pieces in hand: -
Sente
Pieces-in-hand:



{{Shogi diagram|tright
|Position after 9. Rx24<br/><small>Gote<br/>Pieces-in-hand:</small> {{nihongo2|歩}}
|-
|lg|ng|sg|gg|kg|  |sg|ng|lg
|  |rg|  |  |  |  |gg|bg|  
|pg|  |pg|pg|pg|pg|pg|  |pg
|  |  |  |  |  |  |  |rsl|  
|  |pg|  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|ps|ps|ps|ps|ps|ps|ps|  |ps
|  |bs|gs|  |  |  |  |  |  
|ls|ns|ss|  |ks|gs|ss|ns|ls
|-
|<small>Sente<br/>Pieces-in-hand:</small>{{nihongo2|歩}}}}



Tsumeshogi problems

Example of how this diagram can be used for "tsumeshogi" problems

Sente to mate in three
Gote
Pieces-in-hand: all the rest
☖ pieces in hand: -
987654321 
      1
         2
        3
         4
         5
        6
         7
         8
         9
☗ pieces in hand: -
Sente
Pieces-in-hand:



{{Shogi diagram|tright
|Sente to mate in three<br/><small>Gote<br/>Pieces-in-hand: all the rest</small>
|-
|  |  |  |sg|kg|sg|  |  |  
|  |  |  |  |  |  |  |  |  
|  |  |  |  |ts|  |  |  |  
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|hs|  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|-
|<small>Sente<br/>Pieces-in-hand:</small> {{nihongo2|銀}}}}



Highligting squares and indicating piece movement

Examples of how specific square can be highlighted and piece movement indicated.

Highlighting squares
Gote
☖ pieces in hand: -
987654321 
         1
         2
         3
  Shogi yy22.svg Shogi gr22.svg    4
         5
         6
         7
         8
         9
☗ pieces in hand: -
Sente



{{Shogi diagram|tright
|Indicting piece movement<br/><small>Gote</small>
|-
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|  |  |yy|  |gr|  |  |  |  
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  |  
|-
|<small>Sente</small>}}



Indciating piece movement
Gote
☖ pieces in hand: -
987654321 
Shogi lat22.svgShogi lra22.svgShogi las22.svgShogi ras22.svgShogi lra22.svgShogi rat22.svg   1
  Shogi kal22.svg   Shogi kar22.svg  2
  Shogi uas22.svg   Shogi uas22.svg  3
Shogi daau22.svg       Shogi uat22.svg4
 Shogi daaus22.svg  Shogi dau22.svg   Shogi uda22.svg5
   Shogi da22.svg    Shogi uas22.svg6
 Shogi daads22.svgShogi daus22.svg  Shogi das22.svgShogi das22.svg Shogi das22.svg7
 Shogi dads22.svgShogi daa22.svg  Shogi kadl22.svgShogi kadr22.svg Shogi uda22.svg8
Shogi dad22.svg  Shogi daad22.svg    Shogi dat22.svg9
☗ pieces in hand: -
Sente



{{Shogi diagram|tright
|Highlighting squares<br/><small>Gote</small>
|-
|lat |lra  |las |ras |lra|rat |    |  |  
|    |     |kal |    |   |    |kar |  |  
|    |     |uda |    |   |    |uda |  |  
|daau|     |    |    |   |    |    |  |uat  
|    |daaus|    |    |dau|    |    |  |uda 
|    |     |    |da  |   |    |    |  |uas  
|    |daads|daus|    |   |das |das |  |das
|    |dads |daa |    |   |kadl|kadr|  |uda 
|dad |     |     |daad|   |    |    |  |dat 
|-
|<small>Sente</small>}}



Alternate versions

This diagram uses an Arabic numeral to designate each file, and a lowercase alphabetic character to designate each rank.

This template can be easily edited to use Arabic numerals or kanji numerals to designate ranks by simply replacing the number text.

To create a diagram with no rank or file designations, simply delete rows of number and letter.

Regardless of how the ranks are designated, care should be taken to use a form of notation consistent with the diagram to avoid confusion.

See also