Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Turtle Lab # 1 General Directions Turtle graphics comes with your Python compiler and is a graphical way to learn programming. In order to work

Turtle Lab #1
General Directions
Turtle graphics comes with your Python compiler and is a graphical way to learn programming. In order to work with Turtle graphics you need to import the turtle library. From there you can make the turtle move on your screen. If you have not done so already, please read the material listed on Canvas that describes Turtle Graphics.
In this lab you will learn how to use the turtle class and its methods. You will utilize some basic commands in order to get your turtle to move on the screen. The end product is a short program, containing functions that will allow you to move the turtle.
The methods listed below are a part of the turtle class. They will allow you to move the turtle, draw shapes and add color.
\table[[Method,Datatype],[.showturtle(),Shows the turtle on the screen],[forward(50),Allows the turtle to move 50 pixels],[.right(90),Turns the turtle right 90 degrees],[. left(90),Turns the turtle left 90 degrees],[.setheading(90),Sets the turtle's heading to a 90 degrees],[.heading(),Returns the turtle's heading],[penup(),Allows you to move the turtle without drawing a line],[pendown(),Allows you to move the turtle with the pen down.],[.circle(radius),Draws a circle with a specific radius.],[dot(),Draws a simple dot],[.pensize(width),Allows you to change the width of the pen in pixels.],[.pencolor(color),Allows you to change the color of the pen.],[bgcolor(color),\table[[Allows you to change the background color of the turtle's graphics],[window.]]],[.clear(),Erases all drawings. Does not reset anything.],[.reset(),\table[[Erases all drawings that currently appear in the graphics window,],[resets the drawing color to black, resets the location of the turtle to],[the middle of the screen and resets the background color.]]],[.clearscreen(),\table[[Erases all drawings that currently appear in the graphics window,],[resets the drawing color to black, resets the graphics window],[background color to white and resets the turtle to its original position],[in the center of the screen.]]],[.setup(width, height) Specifies the size for the graphics window],[goto (x,y),Moves the turtle to a specifc postion on the screen.],[pos(),Returns the turtle's position on the screen.],[xcor(),Returns the turtles x coordinate position on the screen],[.ycor(),Returns the turtles y coordinate position on the screen.],[speed(speed),Allows you to set the speed of the turtle from 0 to 10.],[.hideturtle(),Hides the turtle],[.write(),Displays text in the graphics window.],[.begin_fill(),Fills a shape. Use this before you draw the shape.],[end_fill(),Ends filling a shape()],[fillcolor(color),Fills a shape with a color],[.done(),Allows the graphics window to stay open after the program has run.],[.shape(),\table[[Allows you to specify a shape for the turtle. For instance,],[turtle.shape("turtle") allows your cursor to turn in to a turtle. Other],[shapes include: "arrow", "circle", "square", "triangle", and],["classic"]]]]
Drawing Shapes
For your portion of the lab you will create a circle, square and a shape of your choosing. Initialize the turtle shape to be a turtle and the color to be green.
Create a circle that contains the following:
Fill color of your choosing
Pen Color in a contrasting color
Pen Size needs to be 10
Size needs to be 100 pixels
Drawn at 200,100
Change the turtle back to green
Create a Square that contains the following:
Fill color of your choosing
Pen Color in a contrasting color
Pen Size needs to be 5
Size needs to be 200 pixels. This means that when you make
Create a Square that contains the following:
Fill color of your choosing
Pen Color in a contrasting color
Pen Size needs to be 5
Size needs to be 200 pixels. This means that when you make the turtle go forward it needs to go forward 200 pixels.
Drawn at -200,-200
Change the turtle back to green
Create a shape of your choosing that is not a circle or square. You can draw a triangle, parallelagram, rectangle, etc. This shape needs to be different from the other shapes already drawn in the program in terms of location, fill color, pen color and size. Your file and pen color need to be different from your other shapes. The pen size also needs to be different from your other shapes.
Change the turtle back to green
Relocate the turtle to 0,0 or the center of the screen.
Finished Drawing
My rendition of a circle, square and different shape looked like the following. Your output will be different since you are choosing different colors and your last shape will be different.
Handing In
Once your program is working upload your .py file to Canvas.
Assignment Rubric
\table[[,Exemplary,pts,Competent,pts,Developing,pts,Did not complete],[1.0,Comments in the code,0.8,Only one comment in code,0.6,Comments are sparse,0,No comments],[4.0,\table[[Created a circle in the right],[location, with the right size,],[contained a
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago