mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-17 06:11:49 +01:00
- 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
This commit is contained in:
parent
0de2e6256f
commit
350666b568
8 changed files with 44 additions and 1 deletions
|
@ -50,6 +50,7 @@ public:
|
|||
|
||||
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;
|
||||
|
|
|
@ -55,7 +55,7 @@ string Cross::getHexContent() const
|
|||
|
||||
bool Cross::check(const Tile& iTile) const
|
||||
{
|
||||
return m_mask & (1 << iTile.toCode());
|
||||
return m_mask & (1 << iTile.toCode()) || (iTile.isPureJoker() && m_mask);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -263,6 +263,8 @@ QValidator::State RackValidator::validate(QString &input, int &) const
|
|||
if (m_bag == NULL)
|
||||
return Invalid;
|
||||
|
||||
input = input.toUpper();
|
||||
|
||||
if (!m_bag->getDic().validateLetters(qtw(input)))
|
||||
return Invalid;
|
||||
|
||||
|
|
|
@ -39,6 +39,8 @@ training_cross 0
|
|||
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
|
||||
|
|
8
test/training_cross4.input
Normal file
8
test/training_cross4.input
Normal file
|
@ -0,0 +1,8 @@
|
|||
e
|
||||
t maison
|
||||
j MAISON h4
|
||||
t wu?
|
||||
r
|
||||
a r
|
||||
q
|
||||
q
|
22
test/training_cross4.ref
Normal file
22
test/training_cross4.ref
Normal file
|
@ -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
|
|
@ -27,6 +27,9 @@ a t
|
|||
t ADEEPSS
|
||||
j DEPASSE b12
|
||||
a t
|
||||
t W?
|
||||
j WuS i5
|
||||
a t
|
||||
a g
|
||||
q
|
||||
q
|
||||
|
|
|
@ -73,6 +73,11 @@ commande> j DEPASSE b12
|
|||
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 - - - - - - - - - - - - - - -
|
||||
|
|
Loading…
Reference in a new issue