Last active
October 21, 2019 12:03
-
-
Save AJFaraday/6634a7f381bb679ee7c2d90d93588d66 to your computer and use it in GitHub Desktop.
Rotate Bot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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