For each challenge there will be a larger image of the challenge followed by a description. If hints are available, you can display any hints and tips by clicking on the arrow next to the description. Try not to use them unless you are truly stuck.
Draw a square.
Creating a function for this one will help for future challenges.
Draw a rectangle.
Draw whatever this is. I wouldn't worry about a loop for this one.
Draw this U shape. Try to keep the proportions correct.
Draw a square inside a square. Make sure the center square is centered and one half the width of the larger square. This would be a good time to use your square function from Challenge 1.
Two squares. Make sure the corner of the lower square is centered in the upper square. Another good use for the square function.
Draw an equilateral triangle. This might be a good time to make your square function a triangle function. If you want, you could even make it a general purpose regular polygon function.
Draw a regular pentagon. You probably know what to do by now.
Draw a regular octagon. This time filled with a color of your choice.
Draw a circle without using the circle()
function. A general purpose regular polygon function would be helpful here.
Draw a plus sign. All sides are of equal length.
Draw this set of squares. Depending on how you decide to draw this one, you might be able to make good use of a function for a square.
Draw this shape. Every side should be of equal length.
Draw a star. This can be done similar to the regular polygons done in the previous challenges.
Draw this set of rotated squares. Make sure they are lined up exactly. Although not necessary, the
goto()
function might be helpful.
Draw a circle inside of a square or a square surrounding a circle. Make sure the circle fits perfectly inside of the square.
Draw the boxes.
Draw this star made up of triangles. How many triangles do you see? How many do you need to make the shape?
Draw the fance rectangle loop thingy. To find the proportions, it can be helpful to trace the drawing by placing a piece of paper on the screen and tracing lightly with a pencil.
Draw a square inside of a circle or a circle surrounding a square. How you approach the problem can sometimes make a huge difference.
circle()
function.Same as Challenge 5, but add some color this time.
Draw this shape made of rhombuses.
Same as Challenge 8, but color every other rhombus.
Draw even more rhombuses with even more colors. The colors should alternate like they do in the example.
Draw the beginnings of the yin-yang symbol. The circle()
function will come in handy.
Finish the yin-yang symbol.
Draw the set of 10 circles all starting from the same location.
The same as the previous challenge, but with every other circle filled.
Similar to the last challenge, but now the circles have the same center.
Draw this spiral.
Draw this set of eight squares nested within each other.
Draw this circle surrounded by a square that is surrounded by a circle.
The same as the previous challenge, but add some color this time.
Draw this shape. I see rhombuses, or is it a hexagon with a star inside? Either way you've got this!
Draw this grid of 100 squares.
Draw the grid of nine circles with the center one colored. They should all be touching.
Draw the outline of a link to a chain.
See if you can get the links from Challenge 12 to fit together.
Now see if you can put holes in the links for the pins to fit in and color the links.
Draw the grid of 100 squares and color them lighter or darker based on which row they are in. You should aim for a nice gradual color gradient. It will be helpful to define your colors using rgb values instead of named colors. In Trinket,
each color channel is represented by an integer from 0 to 255. In IDLE, by default, each color channel is represented by a float from 0 to 1. For example, in Trinket to set the pencolor to red you could use
pencolor(255, 0, 0)
. This sets the red channel to the maximum red value, and the green and blue channels to 0.
Draw the grid of 100 squares and color them lighther or darker depending on their distance from the lower left corner of the grid.
You are drawing the grid of 100 squares, but as you go to draw each square there is a an equal probability that a square is either drawn or not drawn to the grid. Your grid will look different each time due to randomness unless you set the seed to a specific value.
You are combining Challenge 9 and Challenge 11 for this one. You are randomly choosing which squares to draw and coloring them in based on which row they are in. There should be an equal chance of a square being drawn or not drawn.
This one is just like Challenge 9, except you are adding some variation to the color on each row. You still want there to be an obvious gradient from dark to light.
Draw the grid of 100 squares with a gradient from dark to light and randomly rotate each square up to 15 degrees clockwise or counterclockwise.
Draw a random Hitomezashi pattern. Each row and column has an equal likelihood of starting or not starting with a dash. Each column or row will consist of alternating dashes and gaps. Randomly choose if each column starts with a dash or gap. For more information, check out this video about Hitomezashi Stitch Patterns at Numberphile.
Draw a grid consisting of 100 slightly separated squares or circles. For each location in the grid there is a 25% chance of there being a circle instead of a square. Your drawing will look different each time unless you set a specific seed to be used.
Create this scintillating grid illusion.
Send your turtle on a random walk. Have the turtle make a total of 400 steps. For each step the turtle should pick a random direction and travel forward 10 pixels.
Draw 20 partial circles. Starting at the top of each circle, randomly choose to go right or left. Then randomly choose what fraction of the circle to draw.
Draw 20 partial circles starting from a random location on the circle. Then randomly choose what fraction of the circle to draw.
Draw 300 random circles inside of a square and color them based on their distance from the center of the square. In mine, the square has side lengths of 400 and each circle is colored red if it is less than 125 pixels from the center of the square.
The Chaos Game. Start with three dots at each corner of an equilateral triangle. Then pick two of those dots and place a dot half-way between the two dots. Now take the new dot you just made and randomly pick one of the three original dots. Place a new dot half-way between those two dots. Keep doing this 10,000 times and you should get a Sierpinski triangle similar to mine. I started with an equilateral triangle with each side being 200 pixels. For more information, check out this video about the Chaos Game at Numberphile.
Draw a grid of 100 squares with a gradient from dark to light and randomness increasing from the left to right.
Create a 20 x 20 grid of small dots and 10 random larger dots. You will only place a small dot if the distance from the center of the large dot to the center of the small dot is greater than 1.5 times the diameter of the large dot. In this example the small dot is one quarter the diameter of the large dot, and the centers of the small dots are twice the diameter of the small dots apart.
For this one I used 20 random locations for the dots. Choose any color combination you find pleasing.
To make this drawing, randomly choose one of the cardinal directions and move forward. You should stay within the bounds of a square. If a move will take you outside of the square, you should not make the move. For my drawing I made 1000 moves, and the distance I moved forward each time was 5% the width of the square boundry.
Draw a Koch curve using an L-system (Lindenmayer system). See if you can understand the process well enough to draw it without looking at starter code. See this link for some more inspiration.
Same as the previous challenge, but now you are going to draw a Koch Snowflake. You should only have to change the starting shape (axiom). The rule used will be the same as the Koch curve.
Now just add some color.
We are going to revisit the Sierpinski triangle. Draw it this time using an IFS (Iterated Function System). I used 10,000 iterations for the drawing. Once you get this one figured out, try some other cool ones.