Winter Is Coming explainer


The aim of this puzzle: Take 10 seeds away from the Ant and give them to the Grasshopper.

Walkthrough of the solution: The first 3 lines of code create the 3 variables: ant who has 40 seeds, grasshopper who has 0 seeds, and gift which has 10 seeds. The ant is paying for the gift, so the value of ant should go down by 10. The -= operator is used to decrease a variable’s value. The grasshopper is receiving the gift, so it gets the gift added to its value. Using grasshopper += gift will add the gift value (10) to grasshopper (0 --> 10).

Sample code solution:
(Tap below to reveal)

let ant = 40;
let grasshopper = 0;
let gift = 10;
ant -= gift;
grasshopper += gift;
print('The Ant has ' + ant + ' seeds, and the Grasshopper has '
      + grasshopper + ' seeds');

JavaScript Concepts: Assignment Operators (+=, -=), Binary Expression (+ concatenation)

Grasshopper Concepts: print()


I tried to do it, but I can’t. Please help. Thanks!


I did what it said but it still doesn’t work…help please.


Could you post a screenshot of your code?



I figured out, I was using the code without realizing it.


I can not figure out what’s wrong with is
Update I kept typing gift not selecting gift I’m good now


Gift is a var, not a string