diff --git a/uk/org/mafoo/wordsearch/GridFactory.java b/uk/org/mafoo/wordsearch/GridFactory.java index eb223ea..280f099 100755 --- a/uk/org/mafoo/wordsearch/GridFactory.java +++ b/uk/org/mafoo/wordsearch/GridFactory.java @@ -155,12 +155,14 @@ public class GridFactory { } public static char[][] makeGrid(List words, int height, int width) { - return makeGrid(words, height, width, false); + return makeGrid(words, height, width, Modes.NORMAL); } - public static char[][] makeGrid(List words, int height, int width, boolean simple) { + public static char[][] makeGrid(List words, int height, int width, Modes mode) { char[][] grid = new char[height][width]; + bool simple = (mode == Modes.SIMPLE || mode == Modes.CROSSWORD); + // Place words at random? for (String word : words) { int tries = 0; @@ -180,12 +182,14 @@ public class GridFactory { } } - // Fill rest of grid - for (int y=0; y 2048) { throw new Exception("Input too large"); } @@ -25,7 +29,7 @@ } Collections.sort(words); - char[][] grid = GridFactory.makeGrid(words, height, width, simple); + char[][] grid = GridFactory.makeGrid(words, height, width, mode); String csv = ""; %> diff --git a/war/index.jsp b/war/index.jsp index 34d63aa..17a0228 100755 --- a/war/index.jsp +++ b/war/index.jsp @@ -25,7 +25,9 @@ Dining Room
- Simple [?] + Normal + Simple[?] + Crossword