Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Help with FinalProject.
Author Message
SenorDingDong

Posted: Wed Oct 29, 2003 10:18 pm   Post subject: Help with FinalProject.

Hello, I have a final project due in two weeks, and I dont really know how to approach making this. My Turng knowledge I'd say is about moderate, not advanced.

Anyway heres the problem:

Hide and Seek

Sample Data:
10 DATA WJSUOJ, JUFEDR, OFECDR, YUFRAS, YUHOKE, YHTWAS
20 DATA CAKE

1.) A series of words are read and considered as a square array. The dimensions of the array will be dtermined by the length of the first word read. In the above case the array would look as follows.

6 W J S U O J
5 U J F E D R
4 O F E C D R
3 Y U F R A S
2 Y U H O K E
1 Y H T W A S

1 2 3 4 5 6

2.) The additional word read is hidden somewhere in the array in such a way that each succesive lteer in the word touches the previoues letter diagonally, vertically, or horizontally. Examples of this are as follows:

C A E K K
A K C C A A E
E K E C

3.) Find any one solution to the hidden word by printing the word in the way it appears and the co-ordinates of each letter in the word.

4.) Note that the first word read is placed in the top row of the array and that the bottom left hand corner of the array is considered to be (1,1). There will be no more then 8 words forming the square array and the hidden word will be no more then 5 letters long.

Sample Output:

C
A
K E

C (4,4) A (5,3) K (5,2) E(6,2)

any help would be appreciated.

Tony

Posted: Wed Oct 29, 2003 10:46 pm   Post subject: (No subject)

sounds simple enough.

first you load your "playing field" into a 2D array. Read my tutorial on arrays if you're not sure how to use them.

Then go through each letter, searching for the first letter of the word. If it matches, you check all surrounding letters for 2nd letter, and continue so until you match the whole word.

You would have to use a self-calling function in here. As soon as whole word is matched, just redraw your letters in different color. Using Font. will make your project look good
Tony's programming blog. DWITE - a programming contest.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 2 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: