From f92d4df21009929cb75f231aab5ebeec263d0f17 Mon Sep 17 00:00:00 2001 From: Matthew Slowe Date: Sun, 5 Apr 2020 13:25:51 +0100 Subject: [PATCH] Add extra starter method --- uk/org/mafoo/wordsearch/GridFactory.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/uk/org/mafoo/wordsearch/GridFactory.java b/uk/org/mafoo/wordsearch/GridFactory.java index adacb67..0639eb2 100755 --- a/uk/org/mafoo/wordsearch/GridFactory.java +++ b/uk/org/mafoo/wordsearch/GridFactory.java @@ -37,7 +37,7 @@ public class GridFactory { drng.addNumber(23, 0.0017d); // X drng.addNumber(24, 0.0211d); // Y drng.addNumber(25, 0.0007d); // Z - } + } private static char[] chars = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' @@ -77,10 +77,10 @@ public class GridFactory { Bounds b = new Bounds(0, height, 0, width); length--; // arrays, duh - + if( - direction == Direction.N || - direction == Direction.NE || + direction == Direction.N || + direction == Direction.NE || direction == Direction.NW ) { b.min_y = length; @@ -158,6 +158,10 @@ public class GridFactory { return makeGrid(words, height, width, false, true); } + public static char[][] makeGrid(List words, int height, int width, boolean simple) { + return makeGrid(words, height, width, simple, true); + } + public static char[][] makeGrid(List words, int height, int width, boolean simple, boolean fill) { char[][] grid = new char[height][width]; @@ -184,7 +188,7 @@ public class GridFactory { if(fill) { for (int y=0; y