These are works by artists Josef Albers, Maya Hayuk, Vassily Kandinsky, Atta Kwami, Kazimir Malevich, Alma Thomas, and Theo van Doesburg. The styles are different, but all of them are based on polygons or circles.
In this lab, you'll draw polygons so you can create your own art:
On this page, you will explore the basics of drawing a shape in Snap! by using the repeat
block to loop through the same code multiple times.
An algorithm is a sequence of steps that are usually performed by a computer. The algorithm doesn't have to be written in any particular programming language or even in a programming language at all; you can write your algorithm in English or any other human language. Some people call an algorithm written in human language pseudocode. Once you know the steps that the computer will take, you can code your algorithm in the programming language of your choice.
pen down
(or any block) in the palette on the left or in the scripting area to run it. If you click a block inside a script, the whole script runs.Snap! has a tool called Visible Stepping that allows you to control how quickly Snap! steps through the blocks of your code.
Visible stepping can be useful as you read someone else's code because you can watch it at human speed instead of computer speed. It's also useful in debugging (fixing problems with) your own code when it's doing something wrong.
move
block of your script by clicking on the 100 and typing 50. Then click the script again to run it with the new input value.turn
block and run the script again... and again... and again.Clear
the stage again, and change the number in the block.turn
and repeat
blocks. Try to draw a triangle with equal sides.repeat
, move
, turn
script again.
set pen size
block to run it after you've entered the number you want.set
block is in the Sensing palette, where it looks like . Just click once in the hexagonal slot to get True (the green check box). If you're not sure what difference the "flat line ends" makes, try clicking the hexagonal slot again to run the script with that option False. And of course you can change all the numbers, or have your program pick random numbers.
set pen to crayon
block. Computers can display billions of colors, but unless you have to match the paint on your wall very precisely, finding your way through all those colors may be more trouble than it's worth. The crayon library, just like a box of crayons, gives you a small set of vibrant colors, arranged in families. So if you want a lot of browns in your picture, you could pick a random number between 30 and 39.flat line ends
and get interesting results: