Haiti to Ukraine explainer


#22

Yeah.
Im confused too.i get This result but nothing happens


#23

AM i not the only one? Please, im making This solution and is not accepting. What i do?


#24

Hi,

Heather addressed why var x = yellow won’t pass this puzzle.

Each time you use var in your code you’re creating a new variable. Since the 1st line creates the x variable, you don’t need to use var x anymore in your code. You can change the value of x by simply using x = ....

var x = blue; - create a new variable called x and store blue inside of it
x = red - take the existing variable named x, empty it out and then store red inside of it.

Again, only use var if you’re creating a new variable.

–Frankie


#25

In general, you only want to use var once, at the top.


#26

Hi, Frank

Thanks for the answer. Learning code while is in english is a challange but im winning so far.


#27

I changed x=red into x=yellow but i can’t go to the next exercise.Screenshot_20180819-001444_Grasshopper


#28

Your x variable is never being used. Instead of putting a color directly in drawBox(), you can put the x variable in the parentheses. As your code runs each line, it will use the current value of x.

Try replacing all the drawBox(blue) and drawBox(yellow) with drawBox(x).

–Frankie


#29

Hi, I’ve written the code correctly but it just sticks there. I cannot move forward to next activity


#30

Are you able to take a screenshot of your code and post it here? Myself and other users can help double check that there are no mistakes in your code. If there are no mistakes, then it may be a bug.


#31

RetroJLO https://support.grasshopper.codes/u/retrojlo
April 26

Are you able to take a screenshot of your code and post it here? Myself and
other users can help double check that there are no mistakes in your code.
If there are no mistakes, then it may be a bug.


#32

@ruben_mestry Thanks for taking a screenshot! Now I see what’s going on. We’ve declared the variable twice rather than just updating the variable. While technically this code will draw the correct color boxes, the puzzle is looking for us to update the variable x to be a new color. Since we’ve already used var to declare x as a variable earlier in the code, we can simply put x = yellow; to update the variable. You only need to use var again in your code if you wanted to declare a new variable.

Try deleting var x = yellow; and replace it with x = yellow; and the app should accept your answer.


#33

Missing part of the lesson


#34


Ok so I don’t know what to do anymore… Any thoughts?

N


#35

The most common error is this puzzle is using var x... twice. var x will create a new variable called x. Once it’s created, the value can be assigned using x = ....

The 1st line of code should create x and assign it to blue using var x = blue.

Later in the code, to change the value of x to yellow, you only need to use x = yellow, not var x = yellow since the x variable was already created in the 1st line.

–Frankie


#36

Please help i am struct there


#37

Make sure you’re only using var x once. var will create a new variable. Once it’s created, you can change the value just using the = symbol.

–Frankie