Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

holds a pen in one of two positions, up or down. While the pen is down the turtle traces out lines or shapes as it

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

holds a pen in one of two positions, up or down. 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 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 one 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: Meaning pen up pen down turn right 90 nove forward r spaces output the board Command 4 turn left 90 9end 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 moves. Also note that when a pen down command is given the current location of the turtle should be marked. 2 Program Design PrtScrnsert 6 8 4. O P WER G HJ holds a pen in one of two positions, up or down. 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 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 one 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: Meaning pen up pen down turn right 90 nove forward r spaces output the board Command 4 turn left 90 9end 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 moves. Also note that when a pen down command is given the current location of the turtle should be marked. 2 Program Design PrtScrnsert 6 8 4. O P WER G HJ

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

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions

Question

Prepare a short profile of Henry words worth Longfellow?

Answered: 1 week ago

Question

What is RAM as far as telecommunication is concerned?

Answered: 1 week ago

Question

Question 1: What is reproductive system? Question 2: What is Semen?

Answered: 1 week ago

Question

Describe the sources of long term financing.

Answered: 1 week ago

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago