mirror of
https://github.com/fooflington/wordsearch.git
synced 2025-01-22 09:19:55 +00:00
Ignore any non-letter character
This commit is contained in:
parent
f95f43ad56
commit
92391f3899
@ -196,7 +196,7 @@ public class GridFactory {
|
|||||||
// System.out.println("[" + word + "] Placing @ " + x + "," + y + " going " + direction);
|
// System.out.println("[" + word + "] Placing @ " + x + "," + y + " going " + direction);
|
||||||
char[][] tempgrid = clone2d(grid);
|
char[][] tempgrid = clone2d(grid);
|
||||||
for( char c : word.toUpperCase().toCharArray() ) {
|
for( char c : word.toUpperCase().toCharArray() ) {
|
||||||
if(c==' ') continue;
|
if(!Character.isLetter(c)) continue;
|
||||||
if(grid[y][x] != Character.UNASSIGNED) {
|
if(grid[y][x] != Character.UNASSIGNED) {
|
||||||
if (grid[y][x] != c) {
|
if (grid[y][x] != c) {
|
||||||
throw new CouldNotPlaceWordException();
|
throw new CouldNotPlaceWordException();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user