Open a new file.
You have a choice. Some of the problems below are about language or linguistics, some are about mathematics, and some are about art. Choose any three that interest you and do them.
"Tableau 1" by Piet Mondrian
Mondrian wasn't at all random in his choice of colors and locations, but even some random choices can be interesting. A snap script can produce designs like these.

To keep your code clear, you may want to create separate blocks that specialize in boundary and fill and choosing locations and calculating size.
snap has no fill with color block. One way to make such a block is
To get bright colors, use set pen shade to 100, and you get a good collection of colors with
does not do what you might expect, because the "ends of the lines" are rounded. Try it. Now clear the stage and try
.


.
In order to do this, you will need to be able to change a letter into a number, add 1 to that number, and then change the new number back to a letter. The blocks
and
will help you do that. Experiment with them to see how they work.
encode block the input z, what does it report? If that's not what you would like it to report, change it. decode block.factorial block
(or
) that takes a positive integer n and reports the product of all whole numbers from 1 through n, in other words 1 × 2 × 3 × ... × (n - 1) × n. When the input is 4, the output should be 24 (because 1 × 2 × 3 × 4 = 24).
because 5 factorial is really just 5 times 4 factorial. Using your block, check each of these computations—
,
,
and
—to see what it reports. One of these is inconsistent with the others. To fix the problem, we need to define 0! = 1. Edit your n! block to report 1 if n = 0. Then fully test n! again to make sure it works as it should.
should not work. Check to see what does happen. Then edit your block and find a way to use
to check that the input is a number and report some sensible result or message.
reports a result.
Find out what it reports and analyze what the block does so that you can figure out why that is the result.
triangular number n that adds all of the whole numbers from 1 through n:$$1 + 2 + 3 + \cdots + (n - 1) + n$$ When its input is 4, your block should report 10 (that is, 1 + 2 + 3 + 4). Define your block so that triangular number 0 reports 0.
reports the sum of -3 + -2 + -1 + 0 + 1 + 2 + 3.n mod i will tell you if i is a divisor of n.
because, from 1 through 8, only the numbers 1, 2, 4, and 8 evenly divide 8. number-of-divisors 10 should also report 4 because, of the numbers from 1 through 10, only 1, 2, 5, and 10 are divisors of 10. Experiment to find several numbers that have an odd number of divisors.
(color-0).png)
Edit it and give it inputs that let you produce pictures like these. You don't have to use script variables.
(color-50).png)
Experiment with various inputs.
Set "flat line ends" and create a block that draws pictures like this. It will be convenient to use script variables
raise (n) to the power (b) block to make it work for negative integer exponents. digit sum that adds up the digits in a number. So, for example digit sum 7 should report 7, and digit sum 12 should report 3, and digit sum 126 should report 9 (the sum of 1, 2 and 6). You may find these blocks useful.

repeated digit sum, which keeps taking the digit sum until the result is a single digit. For example, the digit sum of 238 is 2+3+8=13, which is more than a single digit. The digit sum of 13 is 1+3=4, which is a single digit. So the repeated digit sum of 238 is 4.divisible by 3? and divisible by 9?. A number is divisible by 3 if its repeated digit sum is 0, 3, 6, or 9; it's divisible by 9 if its digit sum is 0 or 9.
multiples of 7 algorithm block that takes any whole number as input and then puts it through this process:
Test it first on several multiples of 7 (small and large) and make sure that, for multiples of 7, it reports only the results 14, 7, 0, -7, and -14. Also test it on several numbers that are not multiples of 7; for those numbers, it should never report 14, 7, 0, -7, or -14. .png)
mod, but before computers were widespread, algorithms like these greatly simplified some computations.
style of programming is very common, pretty soon you'll learn a better way: functional programming, in which you never change the value of a variable. You're not quite ready to write functional programs yet (that'll come in Unit 3), but here are some examples from above, rewritten functionally, that you can probably understand: 
