Courses‎ > ‎AP Computer Science‎ > ‎Konstantinovich‎ > ‎

2018-11-05

posted Nov 4, 2018, 6:50 PM by Konstantinovich Samuel   [ updated Nov 7, 2018, 5:57 AM ]
LAB07 results at bottom of post.


Goal: Word search design! 

Puzzles like this are common:

U A I F L Q B I D R T V D S S 
D R H N N N K W R N E A P H F 
U J Y M B O A X U S L O G J N 
N U X D L Z E P C A P X V V I 
B O D S J O T X S C L I X R D 
C A C L Y Y S I O T A N U E B 
K H X N M P P R E S L U E T C 
E K O I K I N T F S T T B S S 
S G D C V C D I U B X Z H B I 
H O N F O Z Y P F K S W J O W 
Z E O W V L E A R H R E R L R 
Q W X A T R A O Z M S J E U N 
Z C N Y M V N T O Z U I F L L 
N T W A Y A S Q E L I D F Q X 
X H N T K S O H J W O P J Z X
	 
FIND THE FOLLOWING WORDS:
FISH        LOBSTER    PIZZA       CHOCOLATE
STEAK       SALAD      POPCORN     THOR
LOKI        ZOD        SUPERMAN



You are writing a word search generator. 

The class should be able to:
1. generate an N by M puzzle 
    (A puzzle includes a list of words, and a grid of letters with those words hidden.)
2. add a bunch of words randomly
3. show the puzzle , or the solution. (have a puzzle have a unique ID so you can recall it later)
4. Use a plain text file as a list of words to add to the puzzle. 
           This means we can swap the theme of the puzzle with different files.
5. Be able to reproduce the same puzzle/solution at a later date. This is a VERY useful feature.


IN CLASS:
 Brainstorm with your neighbors on the following points:
 - How to design a data structure to hold the puzzle, words, solution, etc.
 - How the overall program would place the words and how you could view a solution.
 - How would the user interact with the words search program?
     e.g.     java WordSearch ???? ??? ???
 - What tools in java do you need but not have yet?
Comments