This task is part of project08 which is due at 23:00 EDT on 2024-04-02.
You have the option to work with a partner on this task if you wish. Working with a partner requires more work to coordinate schedules, but if you work together and make sure that you are both understanding the code you write, you will make progress faster and learn more.
You can download the starter code for this task using this link.
You can submit this task using this link.
Put all of your work for this task into the file
scene2.py
(you will create this file from scratch)
For this task, we want you to review concepts covered in the first part
of the class, like loops, functions, and conditionals, giving you space
to design your own code that uses these constructs. Back at the start of
the class you did either a custom scene or a custom song a way of
learning about Python basics; now you will have a chance to make
something more complex, using what you've learned so far. This task
focuses on turtle
and turtlBeads
drawing, while you could instead do
the wavesynthTune2
task which focuses on audio.
The requirements are again simple, with no restrictions on what you draw: the only rules are that you must make use of certain Python statements.
To start, you need to create a new file, named scene2.py
. This file
must be in a folder where turtleBeads.py
is also present. Download the
starter code, unzip it, and then create your scene2.py
file in that
folder.
Your scene2.py
file must satisfy the following criteria:
Your file must start with the usual docstring with authorship information. Here's a template you can copy and paste:
"""
Authors: Anon & Ymous
Consulted: T. A.
Date: 2023-10-31
Purpose: Turtle Scene task version 2
"""
Your file will have to import
the turtle
and turtleBeads
modules.
for
and/or while
loops as long as
they're directly inside each other. Inside the inner loop of this
nested loop, you must call a custom function called
drawOne
.drawOne
function must accept at least two
parameters.drawOne
function must contain at least one if/else
statement.drawOne
function must call at least one of the following
functions:forward
(a.k.a. fd
)backward
(a.k.a. bk
or back
)drawDot
drawCircle
drawEllipse
drawSquare
drawRectangle
drawPolygon
drawText
pensize
and either
pencolor
or color
(pen
functions reference).begin_fill
and
end_fill
to draw at least one
filled-in shape, and you must use fillcolor
(or
color
)) to control its color
(fill reference; see also the
example on filling).penup
and
pendown
to move the turtle
without drawing a line (or you may use the one or more of the
teleport
, leap
, or hop
functions from
turtleBeads
to achieve the same
thing).title
function to
assign a title to your graphics window (title
reference).You are welcome to use other turtle
or turtleBeads
features in
addition to the ones listed above, but only the above features are
required.
Note: to speed up the drawing when things get complex, you can use the
noTrace
and
showPicture
functions. You can read
how they work in our turtle documentation.
After completing this task, you must take a screenshot of your graphics scene, name it correctly, and upload it to the shared google drive folder as explained in the submission instructions.
drawOne
drawOne
in at least one place.drawOne(_, _, ___)
def
to define drawOne(_, _, ___)
drawOne(_, _, ___)
, use an if
statement (possibly accompanied by an elif
or else
block) in at least one place.forward
drawOne(_, _, ___)
, call forward
, fd
, turtle.forward
, turtle.fd
, backward
, bk
, back
, turtle.backward
, turtle.bk
, turtle.back
, drawDot
, turtleBeads.drawDot
, drawCircle
, turtleBeads.drawCircle
, drawEllipse
, turtleBeads.drawEllipse
, drawSquare
, turtleBeads.drawSquare
, drawRectangle
, turtleBeads.drawRectangle
, drawPolygon
, turtleBeads.drawPolygon
, drawText
, or turtleBeads.drawText
in at least one place.pensize
pensize
or penSize
in at least one place.pencolor
pencolor
, color
, or penColor
in at least one place.fillcolor
fillcolor
, color
, or fillColor
in at least one place.begin_fill
begin_fill
or beginFill
in at least one place.end_fill
end_fill
or endFill
in at least one place.penup
penup
, pu
, penUp
, teleport
, leap
, or hop
in at least one place.pendown
pendown
, pd
, penDown
, teleport
, leap
, or hop
in at least one place.title
title
in at least one place.