Skip to content

Instantly share code, notes, and snippets.

@Marken-Foo
Marken-Foo / atomic_perft_suite.epd
Last active January 21, 2020 17:21
A collection of perft values for atomic chess. Many positions from Roman Hartmann's (rocechess.ch/rocee.html) collection of regular chess perft values. (Note: castling convention used is that castling is allowed if squares that the king passes through are not attacked *while the king is on its original square*.)
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 ;D1 20 ;D2 400 ;D3 8902 ;D4 197326 ;D5 4864979 ;D6 118926425
r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1 ;D1 48 ;D2 1939 ;D3 88298 ;D4 3492097 ;D5 153516309
rn2kb1r/1pp1p2p/p2q1pp1/3P4/2P3b1/4PN2/PP3PPP/R2QKB1R b KQkq - 0 1 ;D1 40 ;D2 1238 ;D3 45237 ;D4 1434825 ;D5 50504249
rn1qkb1r/p5pp/2p5/3p4/N3P3/5P2/PPP4P/R1BQK3 w Qkq - 0 1 ;D1 28 ;D2 833 ;D3 23353 ;D4 714499 ;D5 21134061
8/8/8/8/5p1p/4pP1P/4P2K/5BNk w - - 0 1 ;D1 2 ;D2 1 ;D3 2 ;D4 4 ;D5 10 ;D6 22 ;D7 67 ;D8 132 ;D9 492 ;D10 1096 ;D11 5157 ;D12 13063 ;D13 79376 ;D14 268898 ;D15 1881806
5bnK/4p2k/4Pp1p/5P1P/8/8/8/8 b - - 0 1 ;D1 2 ;D2 1 ;D3 2 ;D4 4 ;D5 10 ;D6 22 ;D7 67 ;D8 132 ;D9 492 ;D10 1096 ;D11 5157 ;D12 13063 ;D13 79376 ;D14 268898 ;D15 1881806
8/8/8/8/8/1p1p1p1p/1PpPkPpP/2BbK2R w K - 0 1 ;D1 4 ;D2 14 ;D3 22 ;D4 69 ;D5 133 ;D6 979 ;D7 3595 ;D8 46827 ;D9 347327
8/8/8/8/8/8/4kr2/4K2R w K - 0 1 ;D1 13 ;D2 184 ;D3 2591 ;D4 44811 ;D5 693481 ;D6 12230636
8/8/8/8/8/8/4kq2/4K2
@Marken-Foo
Marken-Foo / sfen_to_latex.py
Last active April 20, 2020 16:21
Script to convert file containing shogi SFENs to commands for LaTeX rendering
# === SFEN-to-LaTeX-tsumeshogi-converter ===
# Just a quick and dirty conversion of SFEN notation from a file into LaTeX
# commands for rendering using the myshogi.sty package.
# Specifically, assumes the SFEN from the "Sfen" copy option of ShogiGUI.
# Example of SFEN line:
# position sfen 3sks3/9/4S4/9/1B7/9/+p+l+n+sg+b+r1K/9/9 b r3g3n3l17p 1 moves
# Example of desired output (tsume mode):
#
@Marken-Foo
Marken-Foo / zhume_fen.py
Created July 16, 2020 10:49
Command-line python script to complete crazyhouse FEN by giving black all unused pieces in hand
# === FENify tsumehouse ===
# Takes a crazyhouse FEN containing just board position and command-line
# argument for white hand pieces, and outputs correct FEN where black has all
# the remaining pieces in hand.
#
# --- Example ---
# Input: "4r3/5k2/5pp1/5N2/8/8/8/8[] w - - 0 1" "BQ"
# Output: "4r3/5k2/5pp1/5N2/8/8/8/8[QBqrrrbbbnnnpppppppppppppp] w - - 0 1"
# (this is a 3te crazyhouse tsume)
@Marken-Foo
Marken-Foo / KIF_standard.md
Created December 19, 2020 14:18
Shogi KIF file standard

Kifu file KIF format

This document is a translation of the original Japanese text at http://kakinoki.o.oo7.jp/kif_format.html on 2020-11-11 by Marken Foo.

  • 2020/11/11 translated to English
  • 2020/11/25 added translated tsumeshogi sample headers

Summary

The KIF file format used by programs like Kakinoki Shogi and "Kifu for Series" is a text file format described below.

@Marken-Foo
Marken-Foo / CSA_standard.md
Created December 19, 2020 14:19
Shogi CSA file standard

CSA standard kifu file format

This document is a translation of the original Japanese text at http://www2.computer-shogi.org/protocol/record_v22.html on 2020-12-19 by Marken Foo.

  • 1991-03-08 original draft by Kakinoki Yoshikazu
  • 1991-03-09 discussed by the Computer Shogi Association (CSA)
  • 1991-05-11 1st Edition accepted by the CSA
  • 1997-08-25 3rd Edition accepted by CSA board
    • %KACHI, %HIKIWAKE added
  • 2002-11-15 4th Edition accepted by CSA board
@Marken-Foo
Marken-Foo / karakoro_note_201125.md
Created December 20, 2020 16:30
Hopes for lishogi - translation of 2020-11-25 note.com post by karakoro

Hopes for lishogi

(Original post by karakoro-san: https://note.com/karakorororo/n/n6413990e80c1)

Every day, kind volunteers are working to develop lishogi.

This time I will raise several features that I am particularly looking forward to as lishogi continues to grow.

A complete tournament system

@Marken-Foo
Marken-Foo / karakoro_note_201129.md
Created December 20, 2020 16:32
Shogi tactics trainer? - translation of 2020-11-29 note.com post by karakoro

Can a shogi tactics trainer be made?

(Original post by karakoro-san: https://note.com/karakorororo/n/n3d352a787214)

If you have been exposed to both shogi and chess before, you may have wondered about something.

"Isn't there a shogi version of chess tactics?"

Let's try to look at it from a regular person's perspective, someone familiar with shogi but without specialist knowledge.

@Marken-Foo
Marken-Foo / karakoro_note_201203.md
Created December 20, 2020 16:33
International shogi sites - translation of 2020-12-03 note.com post by karakoro

There are a surprising number of international shogi sites

(Original post by karakoro-san: https://note.com/karakorororo/n/nbfc14b45f3a6)

Recently I've been playing a lot on lishogi. Before I knew it, I had the second-highest number of games played on the site.

As I play games on lishogi, keep tabs on development progress on the lishogi discord (and occasionally get into debates), I've come to realise that there are actually a surprising number of shogi sites aimed at an international audience.

Let me introduce them one by one.

@Marken-Foo
Marken-Foo / karakoro_note_201204.md
Created December 20, 2020 16:33
Chess culture and shogi culture - translation of 2020-12-04 note.com post by karakoro

Chess culture and shogi culture

(Original post by karakoro-san: https://note.com/karakorororo/n/n806887c435e0)

Because I sensed a need for it, I summarise here to the best of my knowledge the elements of chess culture that are likely to stir trouble if directly introduced to shogi culture.

There are some unspoken taboos involved; as the lishogi project advances, I was worried that it would run into them unless someone who is familiar with the issues collates these, so I took up the pen.

This article respects as far as possible both shogi culture and JSA policy, places emphasis on Japanese cultural sensibilities, and will avoid referencing any legal issues.

@Marken-Foo
Marken-Foo / suginami_note_201208.md
Created December 20, 2020 16:35
lishogi updates 2020-12-08 - translation of 2020-12-08 note.com post by 杉並委員長 (ch_suginami)

lishogi latest updates (as of nighttime, 8th December)

(Original post by ch_suginami-san: https://note.com/ch_suginami/n/n1f0d9ff49b31)

Although it's been a little while, I'll finally drop another article about lishogi. Just a few days ago I wrote a similar article, but it vanished due to "synchronisation" or something. But since I've noticed a few other things since then, I'll add them in as I go along.

lishogi population

Although globally the number of games played is slowly increasing, the total number is still rather small. There are still times when matchmaking is slow and it's somewhat difficult to find active users; but conversely this is evidence that there are still users who are excited to play on lishogi. I would count myself among these (whom I believe to be) Japanese people who are immersed in, and even contribute to lishogi. Contributing to the spread of lishogi within Japanese circles is also karakoro-san, whom I frequently see around and who also assists with the development of