Intro to Programming Using Robots:
Optional Extra Credit
There is stuff that you can do without the robot and with the
robot. The options range from pretty simple to more complex.
IMPORTANT: If you submit any extra
credit, make sure that you tell me in your email which options you
chose!!!! Don't make me figure it out!!!
IMPORTANT: All non-robot code must be emailed to me by Saturday May 9th (the last day of the semester). All robot
demos must be uploaded to youtube and the link emailed to me before the final
exam on May 8th (because you need to return your equipment then!!!!)
Non-Robot Extra Credit Options
(In order of difficulty):
- Option 1: Make your X and O drawings on the graphics board "cool"
- Option 2: Complete (and submit) your code for the Tic
Tac Toe 3 lab
- Option 3: Modify your code from 1A so that you can play tic tac
toe against the computer.
- Hint 1: create a robot_take_turn_simple
function.
This function has no arguments. When you call it, the robot chooses any
blank space and puts an X there to make its move.
- Hint 2: Write a function did_anyone_win( ) that has no
arguments,
but checks each of the possible lines in the game and sees if X or O
has won. If X has won, it returns "X", and if
O has won, it returns "O". If no
one has won yet, it returns the empty string ""
- Hint 3: you can see some of my "play_game" code here.
- Option 4: Improve the robot's strategy by writing
a new function to replace robot_take_turn_simple called
robot_take_turn_medium. This time, instead of
taking the first available spot, the robot should do the following:
- If the robot can win, then it should make the winning move
- If the robot can't win, but it can block the human from
winning,
it should make the blocking move
- If the robot can't win, and can't block, then take the first
available space
- Option 5: Improve the robot's strategy by writing
a new function to replace robot_take_turn_medium called
robot_take_turn_well. This time, you should
program the system so that it actually plays as well as your average
human.
- Hint 1: I think the wikiHow web page on
how to win at tic-tac-toe is pretty good. Remember that you always
go first, and I suggest that you always mark the center as your
starting spot. Note that on the wikiHow page you are "O", but in our
program you are "X". Don't get confused.
- Hint2: This is going to take you more time than the rest of the
code. You may want to work on part 3 and then come back to this.
- Option 6: Ignore all of the above and just make your tic tac toe
game work.
Robot Extra Credit Options:
- Option 7: Program your Robot to draw a simple X and O character
when you drop a pen into it's pen slot. If you wish, you can have the
robot ask you to take the pen out so it can move without drawing and
then put the pen back
- Option 8: Program your Robot to draw a cool X and O character
when you drop a pen into it's pen slot. If you wish, you can have the
robot ask you to take the pen out so it can move without drawing and
then put the pen back, or change color, or whatever.
- Option 9: Email me and ask for a copy of this
mega 24x36 inch tic tac toe board. Program your robot to
start in the bottom left corner (the funny extra square) and drive to
the row, column location that you specify. IMPORTANT NOTE: If you choose to
do this option, please make sure your youtube demo shows your robot
doing 5 different demos: all 4 corners plus the middle square.