Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tawanda-profuse/2886ae1f1962d5e749d8123fd21d017d to your computer and use it in GitHub Desktop.
Save tawanda-profuse/2886ae1f1962d5e749d8123fd21d017d to your computer and use it in GitHub Desktop.
The solution for the code combat game level called "Backwoods standoff"
loop {
hero.shield();
if (hero.isReady ("cleave")) {
hero.findNearestEnemy();
hero.cleave(enemy);
}
else {
var enemy = hero.findNearestEnemy();
hero.attack(enemy);
hero.attack(enemy);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment