Skip to content

Commit 84743b5

Browse files
committed
Add antichess test case by programfox
1 parent 9ba6ce9 commit 84743b5

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

data/pgn/antichess-programfox.pgn

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[Variant "Antichess"]
2+
3+
1. g3 Nh6 2. g4 Nxg4 3. b3 Nxh2 4. Rxh2 g5 5. Rxh7 Rxh7 6. Bh3 Rxh3 7. Nxh3 Na6 8. Nxg5 Nb4 9. Nxf7 Nxc2 10. Qxc2 Kxf7 11. Qxc7 Qxc7 12. a4 Qxc1 13. Ra3 Qxa3 14. Nxa3 b5 15. Nxb5 Rb8 16. Nxa7 Rxb3 17. Nxc8 Rg3 18. Nxe7 Bxe7 19. fxg3 Bh4 20. gxh4 d5 21. e4 dxe4 22. d3 exd3 23. Kf1 d2 24. Kg1 Kf6 25. a5 Ke6 26. a6 Kd7 27. a7 Kc7 28. h5 d1=B 29. a8=B Bxh5 30. Bf3 Bxf3 31. Kg2 Bxg2# 1-0

test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2987,6 +2987,14 @@ def test_capture_with_promotion(self):
29872987
self.assertEqual(board.fen(), "4k3/8/8/8/8/8/1p6/2R1K3[] b - - 0 1")
29882988

29892989

2990+
class GiveawayTestCase(unittest.TestCase):
2991+
2992+
def test_antichess_pgn(self):
2993+
with open("data/pgn/antichess-programfox.pgn") as pgn:
2994+
game = chess.pgn.read_game(pgn)
2995+
self.assertEqual(game.end().board().fen(), "8/2k5/8/8/8/8/6b1/8 w - - 0 32")
2996+
2997+
29902998
if __name__ == "__main__":
29912999
if "-v" in sys.argv or "--verbose" in sys.argv:
29923000
logging.basicConfig(level=logging.DEBUG)

0 commit comments

Comments
 (0)