PG: And, of course, I'd be inconsistent here if I said keep this, though I love the project. Here, too, I'd want to check the supports. I'm really not sure we've done enough to prepare students to be able to /do/ this with confidence and independence. Of course, it should be a challenge, but one that /we/ are confident they can manage. Otherwise, we're teaching them that they /can't/ program and that CS is really /not/ for them. If we're going to do pages 2-5 here, we need to have done much more earlier (which, of course, I think we /should/ do).
Generic editing: I find the constantly flicking gifs enormously distracting, annoying and, frankly, show-offy. Two /static/ pictures—or three if we desperately need them—are enough. The constant motion is like these distracting pop-up ads, and serves only to show off how clever we all are. Please let us let the /students/ be the clever ones who show off /their/ creations without having to compete with ours.
BH: See Paul's comment in the big red box.
Recursion is not just for fractals...
Mondrian did not use a computer, but we can use recursion to model his paintings and create similar images:
Mondrian
is already set up.
rectangle
block. Use a line of color with a pen size the width of the rectangle to paint the inside and then create the black border. Maintain state transparency.
rectangle
block already contains two custom blocks for you to use. Look inside these two custom blocks to see how they work.
rectangle
set up correctly. Each time, you should get a big rectangle with one of the five colors inside and a black border, like this:
Then, program the code for the recursive case. The
Mondrian
block already contains some structure. Your job is to figure out what inputs it will need based on how the script should work.
Mondrian
subdivides the space it has into two rectangles (which will further subdivide if more levels are required). For example, in level 2, Mondrian
will randomly divide the area specified by its width and height inputs in two pieces, and draw a rectangle
in each piece. For level 3, Mondrian
uses a level-2 Mondrian
to subdivide the two smaller rectangles (for a total of four filled-in rectangles). Level 4 will subdivide again, creating eight rectangles, and so on.Mondrian
working, it should produce pictures like this: