利用者:Keys/Shogi diagram/doc
これは利用者:Keys/Shogi diagramの解説サブページです。 使用方法、カテゴリ、およびその他利用者ページ自体に含まれない情報を収容しています。 |
将棋の盤面図を表示するためのテンプレート。
使い方
[編集]{{Shogi diagram|<1> | <2> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <84> }}
引数 | 指定内容 | 既定値 | 説明 |
---|---|---|---|
第1引数 | tright / tleft / なし | スタイルシートの設定 | |
第2引数 | なし | 上部に表示する説明 | |
第3引数-第83引数 | 駒の種類 | なし | 左上(9一)から右に、駒の種類などを入れる(記述法は後述) |
第84引数 | なし | 下部に表示する説明 |
駒の表記のしかた
[編集]駒の置かれていないマスや、駒の移動を見せないマスは空白にする。
駒の置かれたマスは、その種類により2~4文字で記述する。書式は XXYZ。
- XX の部分
- 駒の種類。以下の1文字または2文字。
- 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 Template:Nihongo2 and the "king" of the player who is "gote" (i.e., the player moves second) is indicated by Template:Nihongo2. In even games between players of different ranks, the "king" of the higher ranked player is Template:Nihongo2, and the "king" of the lower ranked player is Template:Nihongo2. In handicap shogi, even though the player giving the handicap(上手 uwate) moves first, their "king" is Template:Nihongo2 and the "king" of the player receiving the handicap(下手 shitate) is Template:Nihongo2. In problems, the "king" of the attacking (or mating) side is Template:Nihongo2 and the "king" of the defending side is Template:Nihongo2. To indicate Template:Nihongo2 for "gote" (e.g., the lower ranked player in an even game is "gote") or Template:Nihongo2 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.
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.
Pieces-in-hand
[編集]Pieces-in-hand are entered directly into parameters <3> and <85>. The following characters (and templates) can be used: Template:Nihongo2 for "pawn", Template:Nihongo2 for "lance", Template:Nihongo2 for "knight", Template:Nihongo2 for "silver", Template:Nihongo2 for "gold", Template:Nihongo2 for "bishop", and Template:Nihongo2 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 Template:Nihongo2 (7).
Exhaustive piece exemplification
[編集]ps pg psl pgl ts tg tsl tgl txs txg txsl txgl
ls lg lsl lgl pls plg plsl plgl plxs plxg plxsl plxgl ns ng nsl ngl pns png pnsl pngl pnxs pnxg pnxsl pnxgl ss sg ssl sgl pss psg pssl psgl
rs rg rsl rgl ds dg dsl dgl dxs dxg dxsl dxgl
ks kg ksl kgl aks akg aksl akgl
Other diagram files
[編集]These files can be used to create diagrams for explaining certain positions or indicating piece movement.
- rah - indicate start position for a move one square to the right (rah is for 'right arrow half')
- rat - indicate movement from left to right (rat is for 'right arrow tip')
- ras - indicate start position from right to left (ras is for 'right arrow start')
- lra - indicate movement from right to left or left to right (lra is for 'left right arrow')
- lah - indicate start position for a move one square to the left (lah is for 'left arrow half')
- lat - indicate movement from right to left (lat is for 'left arrow tip')
- las - indicate start positiong for movement from left to right (las is for 'left arrow start')
- uah - indicate start position for a move one square upward (kadl is for 'up arrow half')
- uat - indicate movement from bottom to top (uat is for 'upward arrow tip')
- uas - indicate start position for movement from bottom to top (uas is for 'up arrow start')
- uda - indicate movement from bottom to top or top to bottom (uda is for 'up down arrow')
- dah - indicate start position for a move one square downward (dah is for 'down arrow half')
- das - indicate start position for movement from top to bottom (das is for 'down arrow start')
- dat - indicate movement from top to bottom (dat is for 'downward arrow tip')
- durh - indicate start position for a move one square diagonally upward to the right (durh is for 'diagonal up right half')
- dau - indicate movement diagonally upward to the right (dau is for 'diagonal arrow upward')
- daus - indicate start position for movement diagonally upward to right (daus is for 'diagonal arrow upward start')
- da - indicate movement diagonally left to right (da is for 'diagonal arrow')
- ddlh - indicate start position for a move one square diagonally downward to the left (ddlh is for 'diagonal down left half')
- dad - indicate movement diagonally downward to the left (dad is for 'diagonal arrow downward')
- dads - indicate start position for movement diagonally downward to left (dads is for 'diagonal arrow downward start')
- dulh - indicate start position for a move one square diagonally upward to the left (dulh is for 'diagonal up left half')
- daau - indicate movement diagonally upward to left (daau is for 'diagonal arrow averse upward')
- daaus - indicate start position for movement diagonally upward to left (daaus is for 'diagonal arrow averse upward start')
- daa - indicate movement diagonally right to left (daa is for 'diagonal arrow averse')
- ddrh - indicate start position for a move one square diagonally downward to the right (ddrh is for 'diagonal down right half')
- daad - indicate movement diagonally downward to right (daad is for 'diagonal arrow averse downward')
- daads - indicate start position for movement diagonally downward to right (daads is for 'diagonal arrow averse downward start')
- kar - indicate movement of knight upward to the right (kar is for 'knight arrow right')
- kal - indicate movement of knight upward to the left (kal is for 'knight arrow left')
- kadr - indicate movement of knight downward to the right (kadr is for 'knight arrow down right')
- kadl - indicate movement of knight downward to the left (kadl is for 'knight arrow down left')
- ddl - indicate movement of silver downward to the left (ddl is for 'diagonal down left')
- ddr - indicate movement of silver downward to the right (ddr is for 'diagonal down right')
- dul - indicate movement of silver downward to the left (dul is for 'daigonal up left')
- dur - indicate movement of silver downward to the right (dur is for 'diagonal up right')
- yy - highlighted yellow square (yy is for 'yellow')
- 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.
Pieces-in-hand: none
9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | |
香 | 桂 | 銀 | 金 | 王 | 金 | 銀 | 桂 | 香 | 一 |
飛 | 角 | 二 | |||||||
歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 三 |
四 | |||||||||
五 | |||||||||
六 | |||||||||
歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 七 |
角 | 飛 | 八 | |||||||
香 | 桂 | 銀 | 金 | 玉 | 金 | 銀 | 桂 | 香 | 九 |
Pieces-in-hand: none
{{利用者:Keys/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
[編集]Pieces-in-hand: none
9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | |
香 | 桂 | 銀 | 金 | 王 | 金 | 銀 | 桂 | 香 | 一 |
飛 | 角 | 二 | |||||||
歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 三 |
四 | |||||||||
五 | |||||||||
六 | |||||||||
歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 七 |
角 | 飛 | 八 | |||||||
香 | 桂 | 銀 | 金 | 玉 | 金 | 銀 | 桂 | 香 | 九 |
Pieces-in-hand: none
{{利用者:Keys/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
[編集]Pieces-in-hand: none
9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | |
香 | 桂 | 銀 | 金 | 王 | 金 | 銀 | 桂 | 香 | 一 |
飛 | 角 | 二 | |||||||
歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 三 |
四 | |||||||||
五 | |||||||||
六 | |||||||||
歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 七 |
角 | 飛 | 八 | |||||||
香 | 桂 | 銀 | 金 | 玉 | 金 | 銀 | 桂 | 香 | 九 |
Pieces-in-hand: none
{{利用者:Keys/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)
[編集]Pieces-in-hand: none
9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | |
香 | 桂 | 銀 | 金 | 王 | 金 | 銀 | 桂 | 香 | 一 |
角 | 二 | ||||||||
歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 三 |
四 | |||||||||
五 | |||||||||
六 | |||||||||
歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 七 |
角 | 飛 | 八 | |||||||
香 | 桂 | 銀 | 金 | 玉 | 金 | 銀 | 桂 | 香 | 九 |
Pieces-in-hand: none
{{利用者:Keys/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:
9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | |
香 | 桂 | 銀 | 金 | 王 | 銀 | 桂 | 香 | 一 | |
飛 | 金 | 角 | 二 | ||||||
歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 三 | ||
飛 | 四 | ||||||||
歩 | 五 | ||||||||
六 | |||||||||
歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 歩 | 七 | |
角 | 金 | 八 | |||||||
香 | 桂 | 銀 | 玉 | 金 | 銀 | 桂 | 香 | 九 |
Pieces-in-hand: Template:Nihongo2
{{利用者:Keys/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
Gote
Pieces-in-hand: all the rest
9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | |
銀 | 王 | 銀 | 一 | ||||||
二 | |||||||||
と | 三 | ||||||||
四 | |||||||||
五 | |||||||||
馬 | 六 | ||||||||
七 | |||||||||
八 | |||||||||
九 |
Pieces-in-hand: Template:Nihongo2
{{利用者:Keys/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.
{{利用者:Keys/Shogi diagram|tright |Indicting piece movement<br/><small>Gote</small> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |yy| |gr| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |<small>Sente</small>}}
{{利用者:Keys/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.