CS120
Assignment #10
For this assignment you will continue working with the "robot world" program
from chapter 7 of the text.
Make the following modifications:
- Change the program so that the terrain the robot is entering
determines how much energy the robot uses up (Problem 7.5.2 from the
text).
- Change the program so that some of the terrain is impassible (the
robot can't enter it), some is deadly (a robot entering it is
immediately
deleted), and some terrain cells are vortexes (a robot entering that
cell automatically faces in a new random direction) (Problem 7.5.3 from
the text).
- Change the program so that robots intereact. Currently when one
robot tries to move into another robot's cell the move simply
fails. Change the program so that either the robot in the destination
cell is destryoed (deleted) or the robot in the destination
cell gives some of its energy to the moving robot (which still doesn't
move). Make sure to specify which verions you're doing in
the block comment at the beginning of the program. (Problem 7.5.8 from
the text).
Turn in:
To turn the program you will need to combine all three of your files
into one file that you can use cscheckin to submit (see assignment 8). On a Unix
computer you do this
by taring the files together. Use the command:
tar -cvf lab11.tar lab11.cpp robot.h world.h
(note your main program may have a name other than lab11.cpp,
use that file name instead of lab11.cpp).
This will combine the files into one file called lab11.tar. Use cscheckin to turn
in that file.