eliot/test/load_saved_game.ref
Olivier Teulière 3c7a84d543 Support saving/loading games (any game type) in XML format.
Status:
It works well, but there are still a few details to improve/fix

More details about the changes:
 - New dependency on Arabica and Libxml2 to parse the XML
 - Loading the old format is still supported for this release, but won't be supported anymore in the next one
 - Games are now only saved in the new format
 - In training mode, the player is now created externally, like in the other modes
 - Avoid using GameIO (the one from game/) whenever possible
 - Do not use a FILE* argument anymore when loading a game
 - Throw and catch exceptions correctly when a game cannot be loaded or saved
 - The non-regression tests now use a new method to print the game history
2009-11-29 16:01:31 +00:00

116 lines
4 KiB
Text

Using seed: 0
[?] pour l'aide
commande> e
mode entraînement
[?] pour l'aide
commande> t EA?AEBF
commande> j FABAcEE H4
commande>
commande> t LMUAEYE
commande> j AY I6
commande>
commande> t EELMUJE
commande> j JUMEL J2
commande> a g
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
A - - - - - - - - - - - - - - -
B - - - - - - - - - - - - - - -
C - - - - - - - - - - - - - - -
D - - - - - - - - - - - - - - -
E - - - - - - - - - - - - - - -
F - - - - - - - - - - - - - - -
G - - - - - - - - - - - - - - -
H - - - F A B A c E E - - - - -
I - - - - - A Y - - - - - - - -
J - J U M E L - - - - - - - - -
K - - - - - - - - - - - - - - -
L - - - - - - - - - - - - - - -
M - - - - - - - - - - - - - - -
N - - - - - - - - - - - - - - -
O - - - - - - - - - - - - - - -
commande>
commande> t EEIGLEH
commande> j EGAYEE 7F
commande>
commande> a g
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
A - - - - - - - - - - - - - - -
B - - - - - - - - - - - - - - -
C - - - - - - - - - - - - - - -
D - - - - - - - - - - - - - - -
E - - - - - - - - - - - - - - -
F - - - - - - E - - - - - - - -
G - - - - - - G - - - - - - - -
H - - - F A B A c E E - - - - -
I - - - - - A Y - - - - - - - -
J - J U M E L E - - - - - - - -
K - - - - - - E - - - - - - - -
L - - - - - - - - - - - - - - -
M - - - - - - - - - - - - - - -
N - - - - - - - - - - - - - - -
O - - - - - - - - - - - - - - -
commande> a p
Game: player 1 out of 1
Game: mode=Training
Game: variant=unknown
Game: history:
N | P | RACK | SOLUTION | REF | PTS | BONUS
===|===|==========|================|=====|=====|======
1 | 0 | EA?AEBF | FABAcEE | H4 | 80 | *
2 | 0 | LMUAEYE | AY | I6 | 46 |
3 | 0 | EELMUJE | JUMEL | J2 | 38 |
4 | 0 | EEIGLEH | EGAYEE | 7F | 32 |
Rack 0: HIL
Score 0: 196
commande> a l
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ?
6 1 2 3 9 1 1 2 8 0 1 4 2 6 6 2 1 6 6 6 5 2 1 1 0 1 1
commande>
commande> s load_saved_game.elt
commande> q
fin du mode entraînement
commande> c load_saved_game.elt
mode entraînement
[?] pour l'aide
commande>
commande> a g
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
A - - - - - - - - - - - - - - -
B - - - - - - - - - - - - - - -
C - - - - - - - - - - - - - - -
D - - - - - - - - - - - - - - -
E - - - - - - - - - - - - - - -
F - - - - - - E - - - - - - - -
G - - - - - - G - - - - - - - -
H - - - F A B A c E E - - - - -
I - - - - - A Y - - - - - - - -
J - J U M E L E - - - - - - - -
K - - - - - - E - - - - - - - -
L - - - - - - - - - - - - - - -
M - - - - - - - - - - - - - - -
N - - - - - - - - - - - - - - -
O - - - - - - - - - - - - - - -
commande> a p
Game: player 1 out of 1
Game: mode=Training
Game: variant=unknown
Game: history:
N | P | RACK | SOLUTION | REF | PTS | BONUS
===|===|==========|================|=====|=====|======
1 | 0 | EA?AEBF | FABAcEE | H4 | 80 | *
2 | 0 | LMUAEYE | AY | I6 | 46 |
3 | 0 | EELMUJE | JUMEL | J2 | 38 |
4 | 0 | EEIGLEH | EGAYEE | 7F | 32 |
Rack 0: HIL
Score 0: 196
commande> a l
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ?
6 1 2 3 9 1 1 2 8 0 1 4 2 6 6 2 1 6 6 6 5 2 1 1 0 1 1
commande>
commande> q
fin du mode entraînement
commande> q