mirror of
https://github.com/fooflington/wordsearch.git
synced 2025-01-22 17:29:55 +00:00
Twiddles
This commit is contained in:
parent
f869de337f
commit
e44b5356ab
2
Makefile
2
Makefile
@ -17,7 +17,7 @@ OBJS = ${SRCS:.java=.class}
|
|||||||
all: build wordsearch.jar
|
all: build wordsearch.jar
|
||||||
|
|
||||||
run: all
|
run: all
|
||||||
$(JAVA) uk.org.mafoo.wordsearch.GridFactory 10 10
|
$(JAVA) uk.org.mafoo.wordsearch.GridFactory 15 15
|
||||||
|
|
||||||
.java.class:
|
.java.class:
|
||||||
$(JAVAC) $(JFLAGS) $<
|
$(JAVAC) $(JFLAGS) $<
|
||||||
|
@ -155,7 +155,7 @@ public class GridFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static char[][] makeGrid(List<String> words, int height, int width) {
|
public static char[][] makeGrid(List<String> words, int height, int width) {
|
||||||
return makeGrid(words, height, width, Modes.NORMAL);
|
return makeGrid(words, height, width, Modes.CROSSWORD);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static char[][] makeGrid(List<String> words, int height, int width, Modes mode) {
|
public static char[][] makeGrid(List<String> words, int height, int width, Modes mode) {
|
||||||
@ -205,6 +205,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(!Character.isLetter(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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user