Arrays


#1

Hi Guys,

I must be going mad, what am I doing wrong? My name is just coming up in red even though I've put in the other colors?

When I click save it's coming up with the below :neutral_face:

Oops, try again. Make sure to use the variables myName and letterColors in the drawName() function, like this: drawName(myName, letterColors).


#2

Now its colored but still won't save.

Hmmmmmm


#3

Hi Nattie,

The drawName() function takes two parameters - the text to draw (your name), and the color(s) to draw it in. Since it's only expecting two parameters, it ignores anything after that (in this case, the orange, green, blue, purple). So, you need to do this instead:

drawName("Nattie", letterColors);

We defined the letterColors array above, and it allows us to pass in all of the colors we want, with only two parameters, just like the program is expecting :slight_smile:

I hope this helps - please let me know if you're still having trouble or have any more questions :slight_smile:

Edit:
Oops, I missed your reply as I was typing this :smile:


#4

@nattie87 What do you mean by "won't save"? Could you post the error message you're getting?


#5

Thank you so much for getting back to me :relaxed:

I'm on the bubble shape part now but when I click on it, my name from the previous section isn't showing. Is this right?

so starting this section doesn't show my lovely colourful name?


#6

@nattie87 The line of code I posted above is how line 12 should look - you pass in the myName variable, then the letterColors variable to drawName(), not their values :slight_smile:


#9

7 posts were split to a new topic: "Write your name within the quotes" error


#16