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');
(you can fullscreen it if you put your curser on the picture and go to the lower right hand corner, there will be a full screen button, it looks like arrows that are facing the opposite side (Diagonally)and if you click it, you will be in full screen mode) (If you didn’t know)
If you guys are stuck, take a look at the concept example ‘Using += and -= operators’ and practice them on your own. If you guys still stuck, then mention my name @Pummarin_The_gamer and describe your problem, plus a screenshot.