jimburton/scrabble

AI overwriting existing tiles when playing a word

Closed this issue · 1 comments

Could be fixed by altering the code that removes freedoms (seems complicated) or just checking that all cells are free before placing the word and retrying if no (kludgy but easy fix).

Example:

Enter WORD ROW COL DIR[H/V]:
rouge 7 7 h
  | 0| 1| 2| 3| 4| 5| 6| 7| 8| 9|10|11|12|13|14|
------------------------------------------------
 0|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
 1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
 2|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
 3|  |  | R|  |  |  |  |  |  |  |  |  |  |  |  |
 4|  |  | E|  | J|  |  |  |  |  |  |  |  |  |  |
 5|  |  | W|  | U|  |  |  |  |  |  |  |  |  |  |
 6|  |  | O|  | D|  |  |  |  |  |  |  |  |  |  |
 7|  |  | R|  | G|  |  | R| O| U| G| E|  |  |  |
 8|  |  | K| I| E| R| I| E|  |  |  |  |  |  |  |
 9|  |  | S|  |  |  |  | F|  |  |  |  |  |  |  |
10|  |  |  |  |  |  |  | U|  |  |  |  |  |  |  |
11|  |  |  |  |  |  |  | T|  |  |  |  |  |  |  |
12|  |  |  |  |  |  |  | E|  |  |  |  |  |  |  |
13|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
14|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
------------------------------------------------

ROUGE 7
  | 0| 1| 2| 3| 4| 5| 6| 7| 8| 9|10|11|12|13|14|
------------------------------------------------
 0|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
 1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
 2|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
 3|  |  | R|  |  |  |  |  |  |  |  |  |  |  |  |
 4|  |  | E| M| P| T| S|  |  |  |  |  |  |  |  |
 5|  |  | W|  | U|  |  |  |  |  |  |  |  |  |  |
 6|  |  | O|  | D|  |  |  |  |  |  |  |  |  |  |
 7|  |  | R|  | G|  |  | R| O| U| G| E|  |  |  |
 8|  |  | K| I| E| R| I| E|  |  |  |  |  |  |  |
 9|  |  | S|  |  |  |  | F|  |  |  |  |  |  |  |
10|  |  |  |  |  |  |  | U|  |  |  |  |  |  |  |
11|  |  |  |  |  |  |  | T|  |  |  |  |  |  |  |
12|  |  |  |  |  |  |  | E|  |  |  |  |  |  |  |
13|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
14|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
------------------------------------------------

EMPTS 9