eliot-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Eliot-dev] eliot dic/tile.h game/cross.cpp qt/training_wid...


From: eliot-dev
Subject: [Eliot-dev] eliot dic/tile.h game/cross.cpp qt/training_wid...
Date: Wed, 15 Oct 2008 19:43:24 +0000

CVSROOT:        /cvsroot/eliot
Module name:    eliot
Changes by:     Olivier Teulière <ipkiss>      08/10/15 19:43:24

Modified files:
        dic            : tile.h 
        game           : cross.cpp 
        qt             : training_widget.cpp 
        test           : driver training_play.input training_play.ref 
Added files:
        test           : training_cross4.input training_cross4.ref 

Log message:
         - The last commit in cross.cpp fixed a bug but introduced another one, 
now both are fixed
         - Added unit tests for both bugs
         - Fixed another bug preventing to enter some letters in the training 
rack

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/dic/tile.h?cvsroot=eliot&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/eliot/game/cross.cpp?cvsroot=eliot&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/eliot/qt/training_widget.cpp?cvsroot=eliot&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/eliot/test/driver?cvsroot=eliot&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/eliot/test/training_play.input?cvsroot=eliot&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/eliot/test/training_play.ref?cvsroot=eliot&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/eliot/test/training_cross4.input?cvsroot=eliot&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/eliot/test/training_cross4.ref?cvsroot=eliot&rev=1.1

Patches:
Index: dic/tile.h
===================================================================
RCS file: /cvsroot/eliot/eliot/dic/tile.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- dic/tile.h  8 Jan 2008 13:52:36 -0000       1.2
+++ dic/tile.h  15 Oct 2008 19:43:23 -0000      1.3
@@ -50,6 +50,7 @@
 
     bool isEmpty() const        { return m_char == kTILE_DUMMY; }
     bool isJoker() const        { return m_joker; }
+    bool isPureJoker() const    { return m_char == kTILE_JOKER; }
     bool isVowel() const;
     bool isConsonant() const;
     unsigned int maxNumber() const;

Index: game/cross.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/game/cross.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- game/cross.cpp      13 Sep 2008 21:32:46 -0000      1.9
+++ game/cross.cpp      15 Oct 2008 19:43:23 -0000      1.10
@@ -55,7 +55,7 @@
 
 bool Cross::check(const Tile& iTile) const
 {
-    return m_mask & (1 << iTile.toCode());
+    return m_mask & (1 << iTile.toCode()) || (iTile.isPureJoker() && m_mask);
 }
 
 

Index: qt/training_widget.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/qt/training_widget.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- qt/training_widget.cpp      26 Jan 2008 23:03:35 -0000      1.2
+++ qt/training_widget.cpp      15 Oct 2008 19:43:24 -0000      1.3
@@ -263,6 +263,8 @@
     if (m_bag == NULL)
         return Invalid;
 
+    input = input.toUpper();
+
     if (!m_bag->getDic().validateLetters(qtw(input)))
         return Invalid;
 

Index: test/driver
===================================================================
RCS file: /cvsroot/eliot/eliot/test/driver,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- test/driver 13 Sep 2008 21:32:47 -0000      1.9
+++ test/driver 15 Oct 2008 19:43:24 -0000      1.10
@@ -39,6 +39,8 @@
 training_cross2     0
 # Board cross backward joker
 training_cross3     0
+# Search with best word having a joker on the cross-set
+training_cross4     0
 
 # Joker problem on game load
 training_joker      0

Index: test/training_play.input
===================================================================
RCS file: /cvsroot/eliot/eliot/test/training_play.input,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- test/training_play.input    13 Sep 2008 21:32:47 -0000      1.5
+++ test/training_play.input    15 Oct 2008 19:43:24 -0000      1.6
@@ -27,6 +27,9 @@
 t ADEEPSS
 j DEPASSE b12
 a t
+t W?
+j WuS i5
+a t
 a g
 q
 q

Index: test/training_play.ref
===================================================================
RCS file: /cvsroot/eliot/eliot/test/training_play.ref,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- test/training_play.ref      13 Sep 2008 21:32:47 -0000      1.7
+++ test/training_play.ref      15 Oct 2008 19:43:24 -0000      1.8
@@ -73,6 +73,11 @@
 Mot incorrect ou mal placé (12)
 commande> a t
 ADEEPSS
+commande> t W?
+commande> j WuS i5
+Mot incorrect ou mal placé (7)
+commande> a t
+W?
 commande> a g
      1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
  A   -  -  -  -  -  -  -  -  -  -  -  -  -  -  -

Index: test/training_cross4.input
===================================================================
RCS file: test/training_cross4.input
diff -N test/training_cross4.input
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ test/training_cross4.input  15 Oct 2008 19:43:24 -0000      1.1
@@ -0,0 +1,8 @@
+e
+t maison
+j MAISON h4
+t wu?
+r
+a r
+q
+q

Index: test/training_cross4.ref
===================================================================
RCS file: test/training_cross4.ref
diff -N test/training_cross4.ref
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ test/training_cross4.ref    15 Oct 2008 19:43:24 -0000      1.1
@@ -0,0 +1,22 @@
+[?] pour l'aide
+commande> e
+mode entraînement
+[?] pour l'aide
+commande> t maison
+commande> j MAISON h4
+commande> t wu?
+commande> r
+commande> a r
+  1: WUs                38 10F
+  2: WUs                25 I3
+  3: WU                 24 I3
+  4: Wu                 22 I3
+  5: WUrM               13 4E
+  6: WUS                13 7F
+  7: dAUW               12 5G
+  8: dAW                11 5G
+  9: kWA                11 5F
+ 10: WAd                11 5G
+commande> q
+fin du mode entraînement
+commande> q




reply via email to

[Prev in Thread] Current Thread [Next in Thread]