The land is in danger. An ancient dragon has hidden the Amulet of Infinite Loops somewhere in the Forgotten Realm.
You have been granted a magical companion — The Arcane Turtle.
This turtle is not ordinary. It is a construct of pure logic. It does not think. It does not guess. It only obeys commands written in the Ancient Language… Python.”
(Pause dramatically.)
“Today, you will become Code Mages. You will command the turtle to draw the realm’s map and reveal the dragon’s treasure.”
In D&D, when you summon a familiar, you must name it and bind it to your will. Programming works the same way. You must create an object before you control it.
import turtle brings the magic spellbook into your program.
turtle.Turtle() creates the turtle creature.
We assign it to a variable (hero) so we can command it.
turtle.Screen() creates the world the turtle lives in.
🐢 Turtle uses Tkinter’s built-in color names, which are based on standard X11 color names.
There are a lot of them — far more than just red/blue/green.
You need to look these up. There are a TON!!! Remember, they have to be in QUOTES as they're strings!
red, blue, green, yellow, black, white, gray, grey, orange, purple, pink, brown, cyan, magenta
aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque, blanchedalmond, blueviolet, burlywood, cadetblue, chartreuse, chocolate, coral, cornflowerblue, cornsilk, crimson, darkblue, darkcyan, darkgoldenrod, darkgray, darkgreen, darkgrey, darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, darksalmon, darkseagreen, darkslateblue, darkslategray, darkslategrey, darkturquoise, darkviolet, deeppink, deepskyblue, dimgray, dimgrey, dodgerblue, firebrick, floralwhite, forestgreen, fuchsia, gainsboro, ghostwhite, gold, goldenrod, greenyellow, honeydew, hotpink, indianred, indigo, ivory, khaki, lavender, lavenderblush, lawngreen, lemonchiffon, lightblue, lightcoral, lightcyan, lightgoldenrod, lightgoldenrodyellow, lightgray, lightgreen, lightgrey, lightpink, lightsalmon, lightseagreen, lightskyblue, lightslategray, lightslategrey, lightsteelblue, lightyellow, lime, limegreen, linen, maroon, mediumaquamarine, mediumblue, mediumorchid, mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise, mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, navajowhite, navy, oldlace, olive, olivedrab, orangered, orchid, palegoldenrod, palegreen, paleturquoise, palevioletred, papayawhip, peachpuff, peru, plum, powderblue, rebeccapurple, rosybrown, royalblue, saddlebrown, salmon, sandybrown, seagreen, seashell, sienna, silver, skyblue, slateblue, slategray, slategrey, snow, springgreen, steelblue, tan, teal, thistle, tomato, turquoise, violet, wheat, whitesmoke, yellowgreen
t.pencolor("red")
Important:
begin_fill() starts recording the shape.
end_fill() actually fills it.
Without both, nothing gets filled.
screen.bgcolor("black")
Each number goes from 0 to 255.
(0, 0, 0) = black
(255, 255, 255) = white
Mix numbers to create new colors.
First, turn on RGB mode:
turtle.colormode(255)
“The Arcane Turtle does not understand English. It only understands verbs.”
forward(distance)
Moves the turtle forward in the direction it is currently facing by the given number of pixels.
backward(distance)
Moves the turtle backward (opposite the direction it’s facing) by the given number of pixels.
left(angle)
Rotates the turtle to the left by the specified number of degrees without moving it.
right(angle)
Rotates the turtle to the right by the specified number of degrees without moving it.
goto(x, y)
Instantly moves the turtle to the exact coordinate (x, y) on the screen.
setheading(angle)
Sets the turtle’s direction to a specific angle (0° is right, 90° is up, 180° is left, 270° is down).
penup()
Lifts the pen so the turtle moves without drawing a line.
pendown()
Puts the pen down so the turtle draws as it moves.
pensize(width)
Sets the thickness of the lines the turtle draws.
pencolor(color)
Changes the color of the lines the turtle draws.
fillcolor(color)
Sets the color that will be used to fill a shape.
begin_fill()
Tells the turtle to start recording a shape to be filled with color.
end_fill()
Fills the shape drawn since begin_fill() was called
bgcolor(color)
Changes the background color of the screen.
speed(number)
Controls how fast the turtle moves and draws (0 is fastest, 1 is slowest).
hideturtle()
Makes the turtle icon invisible while still allowing it to draw.
exitonclick()
Keeps the window open until the user clicks the screen.
The High Council of Code Mages needs a magical protection seal drawn to guard the kingdom. Only those who understand Angles, Loops, Color, Coordinates and State can create a stable magical circle.
Your Program Must Include:
At least one large outer circle
At least one repeated pattern using a loop
At least three different colors
At least one filled shape
At least one use of goto(x, y)
At least one polygon (not a circle)
A large outer ring
Smaller circles rotated around the center
A pentagram or hexagon inside
A glowing center orb
Runes written using write()
Decorative dots using dot()
Must include 1 outer circle
1 repeating pattern
3 colors
Two layered circular patterns
One rotating polygon
At least 5 color changes
Uses speed(0) intentionally
Nested loops
RGB color mode
Symmetrical design
Custom function for at least one shape