Commit ccb71735 authored by Vivien Kraus's avatar Vivien Kraus
Browse files

The tarot-status program can now assess the likelihood of a game

parent f789e7d3
......@@ -705,7 +705,9 @@ The tarot distribution provides a few other command-line programs:
- if it is =at-end=, then it does not print anything but succeeds if
the game is finished, and fails otherwise,
- if it is =score=, then it prints the score for each player, one
row for each player. It fails if the game is not finished;
row for each player. It fails if the game is not finished,
- if it is =errors=, then it prints the amount of errors that the
players made;
- =tarot-deal= prints a game which has been dealt for all players,
based on the following options:
- =--n-players=: set the number of players,
......
......@@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: tarot 0.4.2.83-ebdc-dirty\n"
"Report-Msgid-Bugs-To: vivien@planete-kraus.eu\n"
"POT-Creation-Date: 2019-10-12 00:16+0200\n"
"PO-Revision-Date: 2019-09-14 13:19+0200\n"
"POT-Creation-Date: 2019-10-12 11:32+0200\n"
"PO-Revision-Date: 2019-10-12 11:34+0200\n"
"Last-Translator: Vivien Kraus <vivien@planete-kraus.eu>\n"
"Language-Team: French\n"
"Language: fr\n"
......@@ -51,7 +51,7 @@ msgstr "Affiche l'information de version et quitte"
msgid "version"
msgstr "version"
#: src/tarot-app/main.vala:130 src/tarot-app/tarot_status.c:55
#: src/tarot-app/main.vala:130 src/tarot-app/tarot_status.c:58
#: src/tarot-app/tarot_deal.c:107 src/tarot-app/tarot_mcts.c:148
#: src/tarot-app/tarot_stacking.c:113 src/tarot-app/tarot_features.c:92
#: src/tarot-app/tarot_cnn_features.c:88
......@@ -1098,21 +1098,23 @@ msgid ""
"- tarot-status next < GAME\n"
"- tarot-status at-end < GAME\n"
"- tarot-status score < GAME\n"
"- tarot-status errors < GAME\n"
"Please run tarot-status --help.\n"
msgstr ""
"Utilisation :\n"
"- tarot-status --aide\n"
"- tarot-status --version\n"
"- tarot-status suivant\n"
"- tarot-status fini\n"
"- tarot-status score\n"
"- tarot-status suivant < PARTIE\n"
"- tarot-status fini < PARTIE\n"
"- tarot-status score < PARTIE\n"
"- tarot-status erreurs < PARTIE\n"
"Veuillez exécuter tarot-status --aide.\n"
#: src/tarot-app/tarot_status.c:36
#: src/tarot-app/tarot_status.c:37
msgid "--help"
msgstr "--aide"
#: src/tarot-app/tarot_status.c:38
#: src/tarot-app/tarot_status.c:39
#, c-format
msgid ""
"Usage: tarot-status [OPTION]... ([COMMAND] < GAME)?\n"
......@@ -1127,7 +1129,9 @@ msgid ""
"- at-end: exit sucessfully if the game is finished, or exit with code\n"
" 1 if the game is not finished;\n"
"- score: for a finished game, print the score, in the order of player\n"
" numbers, one line for each player.\n"
" numbers, one line for each player;\n"
"- errors: print the sum of all errors that all known players made in\n"
" the game.\n"
msgstr ""
"Utilisation : tarot-status [OPTION]... ([COMMANDE] < PARTIE)?\n"
"Affiche des informations sur le statut de PARTIE. Les options sont :\n"
......@@ -1141,35 +1145,41 @@ msgstr ""
"- fini : termine sans erreur si la partie est finie, ou termine avec\n"
" le code 1 si la partie n'est pas finie ;\n"
"- score : pour une partie terminée, affiche le score, par ordre de\n"
" numéro de joueur, une ligne pour chaque joueur.\n"
" numéro de joueur, une ligne pour chaque joueur ;\n"
"- erreurs : calcule la somme de toutes les erreurs que tous les\n"
" joueurs connus ont commises au cours de la partie.\n"
#: src/tarot-app/tarot_status.c:53
#: src/tarot-app/tarot_status.c:56
msgid "--version"
msgstr "--version"
#: src/tarot-app/tarot_status.c:63
#: src/tarot-app/tarot_status.c:66
msgid "next"
msgstr "suivant"
#: src/tarot-app/tarot_status.c:73
#: src/tarot-app/tarot_status.c:76
#, c-format
msgid "Error: all players have played in this game.\n"
msgstr "Erreur : tous les joueurs ont joué dans cette partie.\n"
#: src/tarot-app/tarot_status.c:77
#: src/tarot-app/tarot_status.c:80
msgid "at-end"
msgstr "fini"
#: src/tarot-app/tarot_status.c:86
#: src/tarot-app/tarot_status.c:89
msgid "score"
msgstr "score"
#: src/tarot-app/tarot_status.c:93 src/tarot-app/tarot_features.c:44
#: src/tarot-app/tarot_status.c:96 src/tarot-app/tarot_features.c:44
#, c-format
msgid "Error: this game is not finished yet.\n"
msgstr "ERREUR : cette partie n'est pas terminée.\n"
#: src/tarot-app/tarot_status.c:102
#: src/tarot-app/tarot_status.c:105
msgid "errors"
msgstr "erreurs"
#: src/tarot-app/tarot_status.c:110
#, c-format
msgid "Error: unknown command '%s'.\n"
msgstr "Erreur : commande inconnue « %s ».\n"
......
......@@ -30,6 +30,7 @@ main (int argc, char *argv[])
- tarot-status next < GAME\n\
- tarot-status at-end < GAME\n\
- tarot-status score < GAME\n\
- tarot-status errors < GAME\n\
Please run tarot-status --help.\n"));
return EXIT_FAILURE;
}
......@@ -47,7 +48,9 @@ Commands:\n\
- at-end: exit sucessfully if the game is finished, or exit with code\n\
1 if the game is not finished;\n\
- score: for a finished game, print the score, in the order of player\n\
numbers, one line for each player.\n"));
numbers, one line for each player;\n\
- errors: print the sum of all errors that all known players made in\n\
the game.\n"));
return EXIT_SUCCESS;
}
if (strcmp (argv[1], _ ("--version")) == 0)
......@@ -99,6 +102,11 @@ Copyright © 2019 Vivien Kraus\nThis is free software; see the source for copyin
}
return EXIT_SUCCESS;
}
if (strcmp (argv[1], _ ("errors")) == 0)
{
double ret = tarot_features_errors (game);
printf ("%f\n", ret);
}
fprintf (stderr, _ ("Error: unknown command '%s'.\n"), argv[1]);
return EXIT_FAILURE;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment