Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer ASAP! And test it with the same sample run! 1 of 3 Programming Project #6 EGRE245 Fall 2018 Turtle Graphics I Overview The

Please answer ASAP! And test it with the same sample run! image text in transcribed
image text in transcribed
image text in transcribed
1 of 3 Programming Project #6 EGRE245 Fall 2018 Turtle Graphics I Overview The Logo programming language made the conoept of turtle graphics famous Imagine a mechanical turtle that walks around a board underthe control of a C program. The turtle holds a pen in one of two positions, up or dow. While the pen is down the turtle traces out lines or shapes as it moves; while the pen is up, the turtle moves about freely without writing anything. In this program you'll simulate the operation of the turtle and create a computerized sketchpad as well. Use a 25 x 25 board which initially has no marks on it. The turtle always starts at position (0,0) (row first, then column; position (0,0) is the upper left corner of the board facing east with its pen up. The turtle will also always be facing e of four directions north-south. east, or west (with north being up on the screen, east to the right, etc) Your turtle will then be given a set of commands (as integers) that will control its movement and drawing on the board. Here are the possible commands: Con Meaning up pen down turn right 90 turn left 90 move forward a spaces 6 output the end of data Note that the turtle can only move to the edge of the board, e.g. if a move command calls for moving 5 spaces and after moving only 3 spaces the turtle is at the edge of the board it stops and does not complete the remaining 2 movs. Also note that when a pen down command is given the current location of the turtle should be marked 2 Program Design You must subdivide your program so that each command (pen up, pen down, turn right turn left, move forward, and output the board) is executed in your code by calling a separate function. The only global variables you are allowed are for the current board position of the turtle, whether the pen is up or down, which direction the turtle is facing, and the board (a two dimensional ary) One exception: you may have globally defined preprocessor identifiers

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions

Question

What is operatiing system?

Answered: 1 week ago

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago