The deadline for this lab is Wednesday 14 November 2007, 09:45:59 hours. Strictly no submissions will be accepted after the deadline.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . H E L L O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Look at the example above where the word HELLO has already been placed. Suppose we now attempt to place the word SNOW at coordinates (2,7), vertically. This is unsuccessful because the letter N in SNOW clashes with the letter L at coordinates (2,8). It violates Rule 3 above.
Now suppose we attempt to place the word BYE at coordinates (2,4) vertically. This is unsuccessful because it violates Rule 1 above.
Again, suppose we attempt to place the word HE at coordinates (3,5) horizontally. This is unsuccessful because it violates Rule 2 above; no new tile has been placed on the board.
Finally, suppose we attempt to place place the word SLOW at coordinates (2,7) vertically. This is successful, so we update the Scrabble board. We print out the Scrabble board only when the placement of a word has been successful.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S . . . . . . . . . . . . H E L L O . . . . . . . . . . . . O . . . . . . . . . . . . . . W . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The contents of the sample text file is shown below:
3 5 1 heLlo 2 7 2 snOw 0 14 2 Bye 2 7 2 slOw 3 7 2 LO 3 7 2 lolly 3 7 2 loWly
Let us look at the first line. The coordinates of the starting letter are (3,5). The next integer 1 indicates that we wish to place the word HELLO horizontally.
Now look at the second line. The coordinates of the starting letter are (2,7). The next integer 2 indicates that we wish to place the word SNOW vertically.
Notice that you must convert all letters in the word to upper case letters.
===== Begin Sample Output ===== Attempting to place the word HELLO at coordinates (3, 5) horizontally. Successful! Scrabble Board: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . H E L L O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Attempting to place the word SNOW at coordinates (2, 7) vertically. Unsuccessful. Attempting to place the word BYE at coordinates (0, 14) vertically. Unsuccessful. Attempting to place the word SLOW at coordinates (2, 7) vertically. Successful! Scrabble Board: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S . . . . . . . . . . . . H E L L O . . . . . . . . . . . . O . . . . . . . . . . . . . . W . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Attempting to place the word LO at coordinates (3, 7) vertically. Unsuccessful. Attempting to place the word LOLLY at coordinates (3, 7) vertically. Unsuccessful. Attempting to place the word LOWLY at coordinates (3, 7) vertically. Successful! Scrabble Board: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S . . . . . . . . . . . . H E L L O . . . . . . . . . . . . O . . . . . . . . . . . . . . W . . . . . . . . . . . . . . L . . . . . . . . . . . . . . Y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ===== End Sample Output =====
You are reminded to follow the sample output exactly; else marks will be deducted.
We will test your programs with other (more complicated) text input files.
You may assume that the user will never place any tiles outside of the board.
Do not use any structures or any form of dynamic memory allocation (using malloc or calloc) in your program, else no credit will be given.
Remember to submit your program frequently using the submit scrabble.c command, and check your submission using the check command.
All the best!