Lab 14
For this week's lab we wish to implement a coin swaping game using link list.
The code we've given you gives an idea of how game is played. We will be implemeting the knowledge we have learnt over weeks.
The initial board will have H H . T T. The main idea of the game is to move the H H from one corner to other and vise versa with TT to get the final state of T T . H H
Stage 1 (0 point):
Understand the code
Stage 2 (2 point):
Now lets say we made a wrong move or we are stuck.In step 2 Undo the move you just did by going back to the previous step.
Stage 3 (Extra Credit) (1 point):
Gives error message when attempting to undo at beginning of game
Example how game works
Initail Board
1 2 3 4 5
H H . T T
1. Move from: 2 3
1 2 3 4 5
H . H T T
2. Move from: 4 2
1 2 3 4 5
H T H . T
3. Move from: 3 4
....
1 2 3 4 5
T T H . T
Move from: 3 4
T T . H H
Notes:
Keep in mind that this is a team effort so you should agree with your partner on what you are going to do before you start typing. The partner who is typing is the "driver" and the partner watching is the "navigator." Be sure to switch roles every 10 to 15 minutes, to foster a deep understanding of the code for both partners. The navigator should be watching for syntax errors and verifying the correctness of the code you're writing.
It will speed things up for you if you keep a window open for editing and have a separate window open for compiling and running your program. Remember that windows are resizable!
Submission:
1. You should work with a partner for this (and all the remaining) lab(s). Only one of you need to submit the program to Blackboard, though you should be certain that both of your names be present in a comment at the top of the .c or .cpp source file.
1.5 If you work alone, include just your name in a comment at the top so that I know you worked alone, and not have to guess.
2. You should turn in to Blackboard by the END OF THE LAB. I know it's tempting to keep working on it, but other classes come in, and it's not fair to the students who are limited to that particular time span if you go over. Which isn't to say that you can't work on it later, to check your solution against the one I post for your own understanding. But what you submit for a grade should be before the next hour begins.
3. If you wish, you may submit your lab by noon on Friday for a 1 point penalty. If you can't finish up the second point by the end of lab, you can still earn the score by completing all three steps and submitting your code by the day after.