// Patrol the village entrances.
// If you find an enemy, attack it.
while(true,
moveXY(35, 34)
leftEnemy := findNearestEnemy
if(leftEnemy) then(
self.attack(leftEnemy)
self.attack(leftEnemy)
)
// Now move to the right entrance.
// Use "if" to attack if there is an enemy.
moveXY(60, 31)
rightEnemy := findNearestEnemy
if(rightEnemy) then(
self.attack(rightEnemy)
self.attack(rightEnemy)
)
)
Says maximum call stack exceeded.The other error I get sometimes is "Expecting ‘EOF’
As to the code itself, it looks like proper Io (as far as I can tell, only having a very superficial knowledge of Io).
The expecting EOF, is a weird error since it looks like your parenthesis are matched up. So that I would guess is either a loading the level/etc, a memory corruption, or temperamental parser error.
The Io parser definitely isn’t complete enough to run that code, unfortunately. Try switching it back to Python from the game menu - change hero modal.