robots. This will be a graded lab which you'll work on in groups of two. (You may work on your own if you ask for approval in advance.) First, carefully plan out your program. Before doing any programming, you should get your plan endorsed.
robotspredates the ubiquitousness of graphical interfaces, so you have to play using keyboard input.
manual-page), and enter
-M ~mc38/man robots. This gives your directions on how to play. (The
-M ~mc38/manpart says ``Please look for the man page in the MC38 directory.'')
Just as Horstmann plans out the Clock game in chapter 8, you should plan out your program. You should have at least two classes (probably more), and should plan on most of your code being in member functions (as opposed to non-member functions).
Decide in advance what order you will write your classes and functions. You don't need to program a whole class all at once. On the contrary, I recommend coding part of it, testing a bit, and continuing. Plan how you will test as you go along.
READMEwhich has the following:
reads characters from the keyboard, and places those characters on
random points in
cwin. It demontrates how to address the
first few problems below.
In particular, you need the
system ("stty raw"); to let
the computer know you want to read a character as soon as it's typed,
and not wait for the "return" or "enter" key to be hit.
Stuff isn't drawn until
either (1) you do something like a
(2) you return from
main() or (3) there are many things
that need to be drawn (filling a buffer). If you include a loop which
draws 50 points off the screen, the window will be forced to redraw.
for (int i = 0; i < 50; i++) cwin << Point (-15,-15);
Maybe you forgot to include a library like
the compilation command your
Makefile uses with care.
ccc_win.cppmore than once. Be sure this is only included at the top of
main(). Elsewhere, include
#include ccc_win.cppat the top of
Perhaps you don't have a default constructor for that class, i.e., one which takes no arguments.
Check the end of an included
.h file. Perhaps you left a
; off the end of a
In short, you can't. The graphics classes are limited for pedagogical reasons. The book describes all graphics classes in the appendix.