hgm wrote: ↑Thu Sep 19, 2019 11:48 pm
But how would you know? The engine analysis you do at the end evaluates both the positions of the loaded game, as well as any recorded deviations you entered, and displays them side by side?
A first step towards what you describe would be not to merely display the popup "incorrect move" in XBoard's Training mode, but add the move (as 'recursive variation') to the loaded game. That should be pretty easy: XBoard stored recursive variations together with other types of comment as one text string per game move. In this case the variation part would just consist of the move in SAN form, surrounded by parentheses. Having the existing routines CoordsToAlgebraic() and AppendComment() act on the entered move at the point that summons the popup would do that.
The second step would be to implement something very similar to the handling routine of the Analize Game menu item, which does not only step through the main line of the game, but also follows up all variations recorded in it.
I am just not sure what is expected in the form of result diplay. XBoard´s current Analyze Game function just adds the score-depth info as comments to the move.
Let me give you an example. After replaying many classical games, This is the game I followed:
[pgn][Event "Gashimov Memorial 2nd"]
[Site "Shamkir"]
[Date "2015.04.18"]
[Round "2"]
[White "Carlsen, Magnus"]
[Black "Mamedyarov, Shakhriyar"]
[Result "1-0"]
[ECO "D94"]
[WhiteElo "2863"]
[BlackElo "2756"]
[PlyCount "57"]
[EventDate "2015.04.17"]
[EventType "tourn"]
[EventRounds "9"]
[EventCountry "AZE"]
[EventCategory "21"]
[SourceTitle "CBM 166"]
[Source "ChessBase"]
[SourceDate "2015.05.11"]
[SourceVersion "1"]
[SourceVersionDate "2015.05.11"]
[SourceQuality "1"]
1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. e3 g6 5. Nc3 Bg7 6. Be2 O-O 7. O-O b6 8. a4 a5
9. cxd5 cxd5 10. b3 Ne4 11. Nxe4 dxe4 12. Nd2 Bb7 13. Ba3 f5 14. Rc1 Kh8 15.
Nc4 Nd7 16. d5 Rc8 17. d6 e6 18. b4 axb4 19. Bxb4 Bd5 20. a5 bxa5 21. Bxa5 Qe8
22. Qa4 Bc6 23. Qb4 Rb8 24. Nb6 Ne5 25. Qc5 Ba8 26. Bc3 Nd7 27. Bxg7+ Kxg7 28.
Nxd7 Qxd7 29. Qe5+ 1-0
[/pgn]
Now after my "replay training" :
[pgn]
[Event "Gashimov Memorial 2nd"]
[Site "Shamkir"]
[Date "2015.04.18"]
[Round "2"]
[White "Carlsen, Magnus"]
[Black "Mamedyarov, Shakhriyar"]
[Result "1-0"]
[ECO "D94"]
[WhiteElo "2863"]
[BlackElo "2756"]
[Annotator "Krasenkow,M"]
[PlyCount "57"]
[EventDate "2015.04.17"]
[EventType "tourn"]
[EventRounds "9"]
[EventCountry "AZE"]
[EventCategory "21"]
[SourceTitle "CBM 166"]
[Source "ChessBase"]
[SourceDate "2015.05.11"]
[SourceVersion "1"]
[SourceVersionDate "2015.05.11"]
[SourceQuality "1"]
1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. e3 g6 5. Nc3 Bg7 6. Be2 (6. Bd3) 6... O-O 7.
O-O b6 8. a4 (8. cxd5) 8... a5 9. cxd5 (9. b3) 9... cxd5 10. b3 (10. Nb5) 10...
Ne4 11. Nxe4 (11. Bb2) 11... dxe4 12. Nd2 Bb7 13. Ba3 (13. Bb2) 13... f5 14.
Rc1 (14. Bc4+) 14... Kh8 15. Nc4 (15. Qc2) 15... Nd7 16. d5 (16. f4) 16... Rc8
17. d6 (17. Bb2) 17... e6 18. b4 (18. Qd2) 18... axb4 19. Bxb4 Bd5 20. a5 (20.
Qd2) 20... bxa5 21. Bxa5 Qe8 22. Qa4 (22. Bc7) 22... Bc6 23. Qb4 (23. Qa2)
23... Rb8 24. Nb6 (24. Qd2) 24... Ne5 25. Qc5 (25. Rfd1) 25... Ba8 26. Bc3 (26.
Bb5) 26... Nd7 27. Bxg7+ Kxg7 28. Nxd7 Qxd7 29. Qe5+ 1-0
[/pgn]
The single move variations are my moves that differ from Magnus Carlsen moves. If both are the same , no variation is given.