Skip to content

Instantly share code, notes, and snippets.

@AJFaraday
Last active October 21, 2019 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AJFaraday/6634a7f381bb679ee7c2d90d93588d66 to your computer and use it in GitHub Desktop.
Save AJFaraday/6634a7f381bb679ee7c2d90d93588d66 to your computer and use it in GitHub Desktop.
Rotate Bot
if (typeof this.n === 'undefined') {
this.n = 0;
} else {
this.n = (this.n + 1) % 4
}
if((api.turn() % 3) == 0) {
directions = ['towardsY', 'towardsX', 'awayY', 'awayX'];
api[directions[this.n]]();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment