This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Animate Your Name Forum

View Course » View Exercise

90 points
C20e63b5e39b1f59acdb9afc2a2fc4e2?s=140&d=retro
Submitted by
smoles45
over 2 years ago

whats wrong with my code? it says write the if/else statement above and i did

var red = [0, 100, 63];
var orange = [40, 100, 60];
var green = [75, 100, 40];
var blue = [196, 77, 55];
var purple = [280, 50, 60];

var myName = "Cole Amos";
letterColors = [red, orange, blue, green, black ]
if(10 < 3) {
bubbleShape = "circle";
}

else {
bubbleShape = "square";
}

drawName(myName, letterColors);


0 votes

permalink

im not sure I'm having the same problem i tried changing the numbers and the spaces but nothing happened

76 points
6db4b7f1572716d8a71f9ba619084159?s=140&d=retro
Submitted by
Jordan Duenas
over 2 years ago


0 votes

permalink

black is not defined anywhere so it can't be used in the definition for letterColors. you'll need to change it to purple, which you've defined. also, the if/else statement is supposed to generate the shape of the bubbles is circle.. 10 is not less than 3 so your statement reads false and moves to the else code, which you have written to make the bubbles square shaped. you can either change the boolean to be true of the if/else statement. Or, reverse the bubbleShape = so the circle shape generates from a false statement.

236 points
54b9279ed3292fa07300506b_323829169
Submitted by
mattl11
over 2 years ago


0 votes

permalink

put a semicolon after defining the letterColors .
e.g:

letterColors = [red, orange, blue, green, black ];

865 points
Bc6d90a1c44be9ddc189a99c9ed87a36?s=140&d=retro
Submitted by
Marin Nedea
over 1 year ago