See the assignment turn-in page for instructions on turning in your assignment.
class cube { public: cube(int s) void move(int x, int y, int z) bool interferes_with(cube c) };
The three public members have the functions
cube()
- create a cube s
units on a side. The cube's center
is co-incident with the origin of the environment.
move()
- move the cube x
units along the x axis (positive
right, negative left), y
units along the y axis (positive up, negative
down), and z
units along the z axis (positive out, negative in).
interferes_with()
- return true if the cube c interferes with any
part of this cube; return false if c
doesn't interfere with this cube.
One cube interferes with another cube if there exists some point p in the
environment such that p is part of both cubes. A point p is part of
a cube if the point lies on the cube's surface or is part of the cube's
interior.
cube
source with the test file game.cc
to test your code. You can download game.cc
from a browser (shift-left-click on the link) or access it
directly at
/export/home/us/csfac/cs176-summer2001/pa/2/game.cc
from any PC lab machine or rockhopper.
This page last modified on 6 June 2001.