I saw this program from a website... Any solution ?
Turtle Graphics: The Logo language, which is particularly popular among personal computer user, made the concept of turtle graphics famous. Imagine a mechanical turtle that walks around the room under control of c++ program. The turtle holds a pen in one of the 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 freely without writing anything. In this problem, you will simulate the operation of the turtle and create a computer sketchpad as well.
Use a 20-by-20 array floor that is initialized to zeros. Show movement of the turtle with pen down by marking #. The turtle always starts from 0,0. The set of turtle commands is as shown for printing a 12 X 12 square is shown below
2
5, 12
3
5,12
3
5,12
1
6
9
The meaning of the command can be followed from the table shown below
Command Meaning
1 Pen up
2 Pen down
3 Turn Right
4 Turn Left
5,10 Move Forward 10 spaces( or a number other than 10)
6 Print 20 by 20 array
9 End of data
Write a c++ program to read the turtle command from a file and implement the turtle capabilities discussed here. Add other commands if required.