From e44b5356ab7abda16a6b01e60d8f315e89793c84 Mon Sep 17 00:00:00 2001 From: foo Date: Sun, 15 Oct 2017 17:26:25 +0100 Subject: [PATCH] Twiddles --- Makefile | 2 +- uk/org/mafoo/wordsearch/GridFactory.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0468b9a..5228043 100755 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ OBJS = ${SRCS:.java=.class} all: build wordsearch.jar run: all - $(JAVA) uk.org.mafoo.wordsearch.GridFactory 10 10 + $(JAVA) uk.org.mafoo.wordsearch.GridFactory 15 15 .java.class: $(JAVAC) $(JFLAGS) $< diff --git a/uk/org/mafoo/wordsearch/GridFactory.java b/uk/org/mafoo/wordsearch/GridFactory.java index 0da3de2..4a0c4e2 100755 --- a/uk/org/mafoo/wordsearch/GridFactory.java +++ b/uk/org/mafoo/wordsearch/GridFactory.java @@ -155,7 +155,7 @@ public class GridFactory { } public static char[][] makeGrid(List words, int height, int width) { - return makeGrid(words, height, width, Modes.NORMAL); + return makeGrid(words, height, width, Modes.CROSSWORD); } public static char[][] makeGrid(List words, int height, int width, Modes mode) { @@ -205,6 +205,7 @@ public class GridFactory { // System.out.println("[" + word + "] Placing @ " + x + "," + y + " going " + direction); char[][] tempgrid = clone2d(grid); for( char c : word.toUpperCase().toCharArray() ) { + if(!Character.isLetter(c)) continue; if(grid[y][x] != Character.UNASSIGNED) { if (grid[y][x] != c) {