Drawboxes and it's strings

Hello,

Why is it that in the following example the spaces seem not to matter. I thought in any language any space was negated as long as the strings ended in quotes. Thanks

Drawboxes(‘bob y y y’ ); should draw blue orange blue and three yellows) I’ll test it but just wanted to use the forum one time at least. Solution states it will draw two blue boxes. Cheers. Maybe I misread it and the question was how many blue boxes not how many boxes… lol

Hi! Your last sentence is correct: The question asks “How many blue boxes…”

The drawBoxes function does care about spaces. It interprets a space as a newLine(). The code drawBoxes('bob y y y'); should draw:

Blue   Orange   Blue
Yellow
Yellow
Yellow

And you can always test it in the playground if you want to be sure:)
–Frankie

2 Likes

PrintOut(’ thanks!!’)

1 Like

Hello! I hope I’m not too much off topic here. I was just really curious about one thing. When we learn about strings, we then proceed to write commands like drawBox (‘rrr yyy bbb’); for example. How does the computer know it should jump to the next line? Why is it not necessary to write the newLine command anymore? Does spacebar within the brackets always equal starting on a new line?

Thank you so much :pray: