Question: TURTLE GRAPHICS C PROGRAM: Using a 25 X 25 board with start position (0,0), your turltle will be given integer commands that will control it's
TURTLE GRAPHICS
C PROGRAM: Using a 25 X 25 board with start position (0,0), your turltle will be given integer commands that will control it's movement.
1=pen up, 2=pen down, 3=turn right 90 degrees, 4=trun left 90 degrees, 5x= move forward x spaces, 6=output data, 9=end of data. Current location when the pen down is called should be marked. Input is coming from a file redirected on the command line. Turtle can only move to the edge of the board. complete the Each command should have its own function, which will be called by the main. Only global variables allowed is preprocessor identifiers.
Sample data.
5 2 3 5 2 4 2 5 5 3 5 5 3 5 5 3 5 5 6 9
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
