When playing a word, forbid using a joker to specify a letter on the board (even a joker).

This is just a convention, but a reasonable one :)
This commit is contained in:
Olivier Teulière 2012-02-19 11:52:08 +01:00
parent 6e2c665bdf
commit 32957abfcc
3 changed files with 21 additions and 18 deletions

View file

@ -287,20 +287,13 @@ int Board::checkRoundAux(const Matrix<Tile> &iTilesMx,
t = iRound.getTile(i); t = iRound.getTile(i);
if (!iTilesMx[row][col + i].isEmpty()) if (!iTilesMx[row][col + i].isEmpty())
{ {
// There is already a letter on the board // Using a joker tile to emulate the letter on the board is not allowed,
if (iTilesMx[row][col + i] != t) // the plain letter should be used instead.
// Also, make sure the played letter is the same as the one on the board
if (iRound.isJoker(i) || iTilesMx[row][col+i].toCode() != t.toCode())
{ {
// Check if it is only a joker // Trying to overwrite a placed letter
if ((iTilesMx[row][col+i].toCode() == t.toCode()) && iTilesMx[row][col+i].isJoker()) return 2;
{
// Do nothing, we don't need to change the tile in the round
//iRound.setJoker(i,true);
}
else
{
// Trying to overwrite a placed letter
return 2;
}
} }
isolated = false; isolated = false;

View file

@ -26,8 +26,12 @@ a t
t ADEEPSS t ADEEPSS
j DEPASSE b12 j DEPASSE b12
a t a t
t W? t WE?
j WuS i5 j WuS i5
j JEUX H6
j JEUx H6
j Ex 9G
j EX 9G
a t a t
a g a g
q q

View file

@ -72,11 +72,17 @@ commande> j DEPASSE b12
Mot incorrect ou mal placé (12) Mot incorrect ou mal placé (12)
commande> a t commande> a t
ADEEPSS ADEEPSS
commande> t W? commande> t WE?
commande> j WuS i5 commande> j WuS i5
Mot incorrect ou mal placé (7) Mot incorrect ou mal placé (7)
commande> j JEUX H6
Mot incorrect ou mal placé (4)
commande> j JEUx H6
commande> j Ex 9G
Mot incorrect ou mal placé (6)
commande> j EX 9G
commande> a t commande> a t
W? W
commande> a g commande> a g
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
A - - - - - - - - - - - - - - - A - - - - - - - - - - - - - - -
@ -85,8 +91,8 @@ commande> a g
D - - - - - - I - - - - - - - - D - - - - - - I - - - - - - - -
E - - - - - - E - - - - - - - - E - - - - - - E - - - - - - - -
F - - - - - - G - - - - - - - - F - - - - - - G - - - - - - - -
G - - - - - - E - - - - - - - - G - - - - - - E - E - - - - - -
H - - - - - J E U - - - - - - - H - - - - - J E U x - - - - - -
I - - - - - - S - - - - - - - - I - - - - - - S - - - - - - - -
J - - - - - - - - - - - - - - - J - - - - - - - - - - - - - - -
K - - - - - - - - - - - - - - - K - - - - - - - - - - - - - - -