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

Animate Your Name Forum

View Course » View Exercise

1023 points
14bad1dfbc25937681a241c32e0dd526?s=140&d=retro
Submitted by
theoricalMan
over 2 years ago

12/15 Error en la condición IF

Me da el siguiente error y no entiendo el por qué:

¡Uy! Probá otra vez. Write an if/else statement that makes the bubbles circle-shaped. Adapt the if/else statement from the the example on the left.

Si realmente tengo el if adaptado para que cumpla esa condición:

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 = "Mario";
var letterColors = [red,orange,green,blue,purple];
if(15 > 5){
bubbleShape = "circle-shaped";
}
else {
bubbleShape = "square";
}

drawName(myName, letterColors);

He probado a cambiar circle-shaped por circle solo y otras opciones y nada.


0 votes

permalink

Hi Mario,

The program only understands circle not circle-shaped.

Also, if statements work like this:

    if (this is true) {
        do this thing;
    } else {
        do this other thing;
    }

If you want to do the first thing, which in this case is, bubbleShape = "circle"; then you will have to put something true in the ( ).

3691 points
55df2afa95e3787b9200005e_359368177
Submitted by
Judy
over 2 years ago

2 Comments

14bad1dfbc25937681a241c32e0dd526?s=140&d=retro theoricalMan over 2 years ago

You´re right thanks. I think I proved it, but it not the case.

55df2afa95e3787b9200005e_359368177 Judy over 2 years ago

What did you put in the ( )?


0 votes

permalink

if(15 > 5){
bubbleShape = "circle-shaped"; // remove -shaped ---> bubbleShape = "circle";
}
else {
bubbleShape = "square";
}
drawName(myName, letterColors);

575 points
Picture
Submitted by
Richard Cain
over 2 years ago

2 Comments

B5ca17feb831de0c368875a5466a3fb5?s=140&d=retro mrcrazyg over 2 years ago

this didn't work for me

2334b6f47da94e7784d7f5c11b3a7865?s=140&d=retro Dason Hrynkiw over 2 years ago

me too