![]() |
Generating a crossword puzzle
I am working on a crossword puzzle game. I have to read in a file with the clues, the answers and the direction (horizontal | vertical). I have no problem doing that.. What I am having a hard time with is generating the actuall crossword diagram. What would be the best way to generate the crossword board?
So far I am able to create the row columns for the user to select which word they are trying to solve :
1 2 3 4 5:
1 2 3 4 5I know that first I have to find the longest words horizontally and vertically and that is how I can figure out the width and height of the board. Im looking forward to any ideas you guys have, oh and I am not allowed to use arrays... |
This might be a little help to you. Java has System.out.printf() method. It works the same way as C and C++'s printf() function. You could align the chars perfectly with the 'Board'. I don't know the exact way to do it but I've done it before when I made a checkout program in C. I can not find the source code where I've done it so I can't really help you there. :(
BTW, What the hell is up with your teacher and arrays? Does he/she really hate them that much? |
Aligning the characters isn't the problem.... I have a list of words which some should go horizontally and some should go vertically. I am not sure about how to figure out where the words cross each other and what their positions should be.
LOL, We haven't covered arrays in class yet.. thats why. |
Quote:
|
| All times are GMT -5. The time now is 2:55 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC