The aim of this puzzle: Create the Armenian flag with one line of code.
Walkthrough of the solution: When there is a space in the string given to
drawBoxes(), it will create a
Inside of the parentheses of
drawBoxes() you need to edit the string.
drawBoxes() will look at each character in its string: if it’s a letter, draw a box with the color that letter stands for; if it’s a space, go to a new line. So,
drawBoxes('g g') is the same as
drawBox(green); newLine(); drawBox(green);
To draw the Armenian flag, you need 9 boxes: red, red, red, new line, blue, blue, blue, new line, then orange, orange, orange. That means the string that goes inside of
'rrr bbb ooo'.
Sample code solution:
(Tap below to reveal)
drawBoxes('rrr bbb ooo');
Grasshopper Concepts: drawBoxes()