Skip to content

Commit

Permalink
add more pgn test fixtures, update log
Browse files Browse the repository at this point in the history
  • Loading branch information
jfredett committed Nov 10, 2024
1 parent 34fe770 commit 0436048
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 1 deletion.
16 changes: 16 additions & 0 deletions LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1058,3 +1058,19 @@ game-legality-preserving moves between boardstates, a rule is associated with ev

[2] I don't actually know if this is a proper category, so maybe it's just a Graph with some extra steps, but I like to
think of it this way.

# 10-NOV-2024

## 1219 - gamerep

I've got `Variation` (formerly Game, Line, HalfPly and Ply... it's been through a few iterations) basically working.
It can at least represent a simple variation, and while the API is going to need some finishwork, I think the design
works and I should be able to flatten a PGN into it.

I'm debating now between merging and tackling that in a separate PR, or just pushing through and getting it done. I
think I might try to push through and see how painful it is. If it comes together quickly then I'll go for it, but
otherwise I'll plan to merge and then tackle it in a separate PR.

I have an existing 'no-variations' PGN example I can use, and I think I should probably have the test exist in the
`tests/` subdir as it's more of an integration test than a unit test. I plan to use the `Shakmaty` PGN parser for now,
but would like to build my own eventually.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Event "Example Chess"]
[Event "No Variations, Includes Halt"]
[White "white"]
[Black "black"]
[Result "0-1"]
Expand Down
12 changes: 12 additions & 0 deletions tests/fixtures/no-variations-and-no-halt.pgn
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Event "No Variations, No Halt"]
[White "white"]
[Black "black"]
[Result "0-1"]
[CurrentPosition "3r2k1/5rp1/p3Q2p/1p2Bp2/8/PP1q4/4RPbP/4K3 w - -"]
[TimeControl "900+10"]

1. e4 c6 2. d4 d5 3. exd5 cxd5 4. c4 Nf6 5. Nc3 Nc6 6. Nf3 e6 7. Be2 Bd6 8. O-O
dxc4 9. Bxc4 O-O 10. b3 a6 11. Bd3 h6 12. Bc2 b5 13. Ne4 Nxe4 14. Bxe4 Bb7 15.
Bc2 Nb4 16. Bb1 Qd7 17. a3 Nd5 18. Ne5 Qc7 19. Qd3 f5 20. Qg3 Qc3 21. Bd3 Qxd4
22. Re1 Qxa1 23. Kf1 Bxe5 24. Qg6 Nf4 25. Bxf4 Qd4 26. Qxe6+ Rf7 27. Bxe5 Qxd3+
28. Re2 Bxg2+ 29. Ke1 Rd8
7 changes: 7 additions & 0 deletions tests/fixtures/with-nested-variations.pgn
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Event "Nested Variations"]
[White "white"]
[Black "black"]
[Result "0-1"]
[TimeControl "900+10"]

1. d4 d5 2. Bf4 c6 3. Nf3 Nf6 4. e3 Nh5 (4... Bf5 5. c4 a5 (5... e6 6. Qb3 b6 7. Nc3) 6. Nc3 e6) 5. Be5 f6 6. Bxb8 (6. Bg3 Nxg3 7. hxg3) 6... Rxb8 7. c4 g6
8 changes: 8 additions & 0 deletions tests/fixtures/with-variations.pgn
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Event "With Variations"]
[White "white"]
[Black "black"]
[Result "0-1"]
[TimeControl "900+10"]

1. d4 d5 2. Bf4 c6 3. Nf3 Nf6 4. e3 Nh5 (4... Bf5 5. c4 a5 6. Nc3 e6) 5. Be5 f6 6. Bxb8 (6. Bg3 Nxg3 7. hxg3) 6... Rxb8 7. c4 g6

0 comments on commit 0436048

Please sign in to comment.