Created
October 25, 2019 00:39
-
-
Save Brilliand/49d7afbe8bb6d542acc871ac40d12e83 to your computer and use it in GitHub Desktop.
"Cage Bar Cutter" 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
const turn = api.turn(); | |
const opening = "EEESSSEEESSEEEEEEEEEESSSEEESSSENEEENSNSSSSEEEEEEEEESSSEEESSEEEESE"; | |
if(turn < opening.length) { | |
switch (opening[turn]) { | |
case 'W': | |
api.awayX(); | |
break; | |
case 'N': | |
api.awayY(); | |
break; | |
case 'E': | |
api.towardsX(); | |
break; | |
case 'S': | |
api.towardsY(); | |
break; | |
} | |
} else if(turn >= 120) { | |
if(api.spawning_turn()) api.towardsY(); | |
else api.towardsX(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment