Did you use three back ticks at the head and foot of the code (see the FAQ)? I just learned about this and it fixes all the copy and paste formatting errors.
Guys. My code doesn’t work. Can u tell me what i did wrong?
loop: {
var coins = this.findItems();
var coinIndex = 0;
// Wrap this into a loop that iterates over all coins.
while (coinIndex < coins.length) {
var coin = coins[coinIndex];
// Gold coins are worth 3.
if (coin.value == 3) {
// Only pick up gold coins.
this.moveXY(coin.pos.x, coin.pos.y);
}
coinIndex += 1;
}
while True:
coins = hero.findItems()
coinIndex = 0
# Wrap this into a loop that iterates over all coins.
while True:
coin = coins[coinIndex]
# Gold coins are worth 3.
if coin.value == 3:
# Only pick up gold coins.
hero.moveXY(coin.pos.x, coin.pos.y)
coinIndex += 1
pass