Last active
October 29, 2019 23:27
-
-
Save willuwontu/46b9d27b1994c35a8ef214c1b2067609 to your computer and use it in GitHub Desktop.
Twin City bot for Grid Game KotH
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
//Twin Cities | |
const turn = api.turn(); | |
if (turn < 31) { | |
switch(turn % 2) { | |
case 0: | |
api.awayY(); | |
break; | |
case 1: | |
api.awayX(); | |
break; | |
} | |
} else if (turn < 80) { | |
switch(turn % 3) { | |
case 0: | |
api.towardsY(); | |
break; | |
case 1: | |
api.towardsX(); | |
break; | |
case 2: | |
api.towardsX(); | |
break; | |
} | |
} else if (turn < 127) { | |
api.towardsX(); | |
} else if (turn < 246) { | |
api.towardsY(); | |
} else if (turn < 350) { | |
api.awayX(); | |
} else if (turn < 400) { | |
api.towardsY(); | |
} else if (turn < 500) { | |
api.towardsX(); | |
} else { | |
const late = turn % 200; | |
if (late < 50) { | |
api.awayY(); | |
} else if (late < 100) { | |
api.awayX(); | |
} else if (late < 150) { | |
api.towardsY(); | |
} else if (late < 200) { | |
api.towardsX(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment