[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Eliot-dev] eliot utils/eliottxt.cpp test/training_cross2.i...
From: |
Olivier Teuličre |
Subject: |
[Eliot-dev] eliot utils/eliottxt.cpp test/training_cross2.i... |
Date: |
Sat, 24 Jan 2009 17:43:57 +0000 |
CVSROOT: /cvsroot/eliot
Module name: eliot
Changes by: Olivier Teulière <ipkiss> 09/01/24 17:43:57
Modified files:
utils : eliottxt.cpp
test : training_cross2.input training_cross2.ref
training_cross3.input training_cross3.ref
training_joker2.input training_joker2.ref
Log message:
- Text interface: removed uses of the 'n' command with a negative
argument
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/utils/eliottxt.cpp?cvsroot=eliot&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/eliot/test/training_cross2.input?cvsroot=eliot&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/eliot/test/training_cross2.ref?cvsroot=eliot&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/eliot/test/training_cross3.input?cvsroot=eliot&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/eliot/test/training_cross3.ref?cvsroot=eliot&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/eliot/test/training_joker2.input?cvsroot=eliot&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/eliot/test/training_joker2.ref?cvsroot=eliot&r1=1.7&r2=1.8
Patches:
Index: utils/eliottxt.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/utils/eliottxt.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- utils/eliottxt.cpp 24 Jan 2009 17:11:08 -0000 1.33
+++ utils/eliottxt.cpp 24 Jan 2009 17:43:57 -0000 1.34
@@ -1,7 +1,8 @@
/*****************************************************************************
- * Copyright (C) 2005 Eliot
- * Authors: Antoine Fraboulet <address@hidden>
- * Olivier Teuliere <address@hidden>
+ * Eliot
+ * Copyright (C) 2005-2008 Antoine Fraboulet & Olivier Teulière
+ * Authors: Antoine Fraboulet <antoine.fraboulet @@ free.fr>
+ * Olivier Teulière <ipkiss @@ gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -380,12 +381,21 @@
else if (tokens[0][0] == L'h')
{
const wstring &action = checkAlphaToken(tokens, 1);
+ wstring count = checkNumToken(tokens, 2);
+ if (count == L"")
+ count = L"1";
if (action == L"" || action.size() != 1)
return;
if (action[0] == L'p')
+ {
+ for (int i = 0; i < _wtoi(count.c_str()); ++i)
iGame.prevTurn();
+ }
else if (action[0] == L'n')
+ {
+ for (int i = 0; i < _wtoi(count.c_str()); ++i)
iGame.nextTurn();
+ }
else if (action[0] == L'f')
iGame.firstTurn();
else if (action[0] == L'l')
@@ -624,20 +634,8 @@
{
int n = _wtoi(num.c_str());
if (n <= 0)
- {
- if (n == 0)
- n = -1;
- if ((unsigned int)-n >
iGame.getHistory().getSize())
- throw GameException("Cannot go back that
far");
- for (int i = 0; i < -n; ++i)
- iGame.prevTurn();
- iGame.clearFuture();
- }
- else
- {
- if (iGame.trainingPlayResult(--n))
printf("mauvais argument\n");
- }
+ iGame.trainingPlayResult(n - 1);
}
}
break;
@@ -1018,24 +1016,18 @@
int main(int argc, char *argv[])
{
- string dicPath;
-
// Let the user choose the locale
setlocale(LC_ALL, "");
if (argc != 2 && argc != 3)
{
- fprintf(stdout, "Usage: eliot /chemin/vers/ods4.dawg [random_seed]\n");
+ fprintf(stdout, "Usage: eliot /chemin/vers/ods5.dawg [random_seed]\n");
exit(1);
}
- else
- {
- dicPath = argv[1];
- }
try
{
- Dictionary dic(dicPath);
+ Dictionary dic(argv[1]);
unsigned int seed;
if (argc == 3)
Index: test/training_cross2.input
===================================================================
RCS file: /cvsroot/eliot/eliot/test/training_cross2.input,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- test/training_cross2.input 24 Jan 2009 10:28:22 -0000 1.2
+++ test/training_cross2.input 24 Jan 2009 17:43:57 -0000 1.3
@@ -9,7 +9,8 @@
a s
a l
a gd
-n -1
+h p
+h r
a g
a gd
q
Index: test/training_cross2.ref
===================================================================
RCS file: /cvsroot/eliot/eliot/test/training_cross2.ref,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- test/training_cross2.ref 24 Jan 2009 10:28:22 -0000 1.7
+++ test/training_cross2.ref 24 Jan 2009 17:43:57 -0000 1.8
@@ -105,7 +105,8 @@
Mc
[ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1]
Nc
[ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1]
Oc
[ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1]
-commande> n -1
+commande> h p
+commande> h r
commande> a g
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
A - - - - - - - - - - - - - - -
Index: test/training_cross3.input
===================================================================
RCS file: /cvsroot/eliot/eliot/test/training_cross3.input,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- test/training_cross3.input 24 Jan 2009 10:28:22 -0000 1.2
+++ test/training_cross3.input 24 Jan 2009 17:43:57 -0000 1.3
@@ -6,7 +6,8 @@
n 1
a gd # c2
-n -1
+h p
+h r
a gd # c3
t EUOFMIE
@@ -24,7 +25,8 @@
n 1
a gd # c6
-n -1
+h p
+h r
a gd # c7
q
Index: test/training_cross3.ref
===================================================================
RCS file: /cvsroot/eliot/eliot/test/training_cross3.ref,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- test/training_cross3.ref 24 Jan 2009 10:28:22 -0000 1.5
+++ test/training_cross3.ref 24 Jan 2009 17:43:57 -0000 1.6
@@ -72,7 +72,8 @@
Nc
[ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1]
Oc
[ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1]
commande>
-commande> n -1
+commande> h p
+commande> h r
commande> a gd # c3
Ar
[ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1]
Br
[ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1]
@@ -214,7 +215,8 @@
Nc
[ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1]
Oc
[ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1]
commande>
-commande> n -1
+commande> h p
+commande> h r
commande> a gd # c7
Ar
[ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1]
Br
[ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1][ffffffff:-1]
Index: test/training_joker2.input
===================================================================
RCS file: /cvsroot/eliot/eliot/test/training_joker2.input,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- test/training_joker2.input 24 Jan 2009 10:28:22 -0000 1.2
+++ test/training_joker2.input 24 Jan 2009 17:43:57 -0000 1.3
@@ -1,5 +1,6 @@
c rosace
-n -13
+h p 13
+h r
a P
a t
a l
Index: test/training_joker2.ref
===================================================================
RCS file: /cvsroot/eliot/eliot/test/training_joker2.ref,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- test/training_joker2.ref 24 Jan 2009 10:28:22 -0000 1.7
+++ test/training_joker2.ref 24 Jan 2009 17:43:57 -0000 1.8
@@ -3,7 +3,8 @@
commande> c rosace
mode entraĂŽnement
[?] pour l'aide
-commande> n -13
+commande> h p 13
+commande> h r
commande> a P
Eliot
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Eliot-dev] eliot utils/eliottxt.cpp test/training_cross2.i...,
Olivier Teuličre <=