The Logo language, made the concept of turtle graphics famous. It was a mechanical turtle that walked around and drew shapes. The turtle holds a pen in one of two positions, up or down. While the
pen is down the turtle traces out shapes as it moves; while the pen is up, the turtle moves about freely without writing anything. This is similar to the way some line draw programs work.
You are to design such a program:
Use a 20 by 20 array or floor which is initialized to zeros. Keep track of the current position of the turtle at all times, the direction it is heading, and whether the pen is currently up or down. Assume that
the turtle always starts position 0,0 on the floor with its pen up, heading to the right or east.
The set of turtle commands your program must process are:
1 change pen position
2 turn
3 move forward
4 print
5 change brush
6 erase/start over
7 jump
8 see menu again
9 end program
There must be at least
a turtle class ( turtle.h , turtle.cpp )
a pen class ( pen.h, pen.cpp )
a direction class ( direction.h , direction.cpp ),
a position class ( position.h, position.cpp )
and a driver ( driver.cpp )
The driver must not contain any function prototypes/implementations: place them in separate files
Well... I have some questions:
Would it be smarter to put the floor in the position class or right smack dab in the driver?
Also, how do I get the turtle to interact with the floor, or the turtle to hold the pen? I guess I am having trouble understanding implementing different classes to different classes.
I have already written some of the things I would need in each class, but how do these classes interact with each other?
Please help!