Deja Brew (code doesn't work)


#1

Hey guys, please help me with that code.
It doesn’t work.

var potionsOnTheWall = 10;
var numToTakeDown = 1;
while(true) {
    hero.say(potionsOnTheWall + " potions of health on the wall!");
    
    hero.say(potionsOnTheWall + " potions of health!");
    
    hero.say("Take " + numToTakeDown + " down, pass it around!");
    potionsOnTheWall -= numToTakeDown;
    
    hero.say(potionsOnTheWall + " potion of health on the wall.");
}

#2

Please format your code according to the FAQ please using the </> button.


#3

The last line must be:
hero.say(potionsOnTheWall + " potions of health on the wall!");
instead of
hero.say(potionsOnTheWall + " potion of health on the wall.");
so put s and replace . with !
The error is a little bit absurd! :grinning:
I used https://www.diffchecker.com/diff to compare my and your solution!


#5

Unbelievable
Thanks man!
Appreciate it!


#6

See also here: