From 92391f3899952f812bb7575386223ca158e79a83 Mon Sep 17 00:00:00 2001 From: foo Date: Mon, 19 Dec 2016 06:31:51 +0000 Subject: [PATCH] Ignore any non-letter character --- uk/org/mafoo/wordsearch/GridFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uk/org/mafoo/wordsearch/GridFactory.java b/uk/org/mafoo/wordsearch/GridFactory.java index 32bef33..80ea03d 100755 --- a/uk/org/mafoo/wordsearch/GridFactory.java +++ b/uk/org/mafoo/wordsearch/GridFactory.java @@ -196,7 +196,7 @@ public class GridFactory { // System.out.println("[" + word + "] Placing @ " + x + "," + y + " going " + direction); char[][] tempgrid = clone2d(grid); for( char c : word.toUpperCase().toCharArray() ) { - if(c==' ') continue; + if(!Character.isLetter(c)) continue; if(grid[y][x] != Character.UNASSIGNED) { if (grid[y][x] != c) { throw new CouldNotPlaceWordException();