Skip to content

Commit a77ed63

Browse files
committedOct 30, 2018
Add bot descriptions
1 parent 41b6437 commit a77ed63

10 files changed

+26
-6
lines changed
 

‎basic.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env python3
22

3+
# Choose a random direction and move in that direction forever,
4+
# but move one tile over when crossing the board so we don't hit our trail
5+
36
from LightningBot import LightningBot
47
from random import randint
58
from sys import argv

‎depth.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
#!/usr/bin/env python3
22

3+
# Turn whichever way leads to the longest possible path, or go straight if there's a tie
4+
35
from LightningBot import LightningBot
46
from random import randint
57

6-
bot = LightningBot('Depth' + '%04d' % randint(0, 9999))
8+
bot = LightningBot(
9+
bot_name = 'Depth' + '%04d' % randint(0, 9999),
10+
)
711

812
while bot.waitForNextTurnDirections():
913

‎fibonacci.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env python3
22

3+
# Move straight by turn randomly when lengths in the fibonacci sequence
4+
# are reached
5+
36
from LightningBot import LightningBot
47
from random import randint
58
from sys import argv

‎hilbert.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/usr/bin/env python3
22

3+
# Move along a hilbert curve which fills the board
4+
35
from LightningBot import LightningBot
46
from random import randint, shuffle
57
from sys import argv
68

79
bot = LightningBot(
810
bot_name = 'Hilbert' + '%03d' % randint(0, 999),
9-
api_token = argv[1] if len(argv) > 1 else None
1011
)
1112

1213

‎loser.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/usr/bin/env python3
22

3+
# Lose on the first turn by breaking the rules
4+
35
from LightningBot import LightningBot
46
from random import randint
57
from sys import argv
68

79
bot = LightningBot(
810
bot_name = 'Loser' + '%05d' % randint(0, 99999),
9-
api_token = argv[1] if len(argv) > 1 else None
1011
)
1112

1213
bot.move(-1)

‎rando.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
#!/usr/bin/env python3
22

3+
# Move in a random direction
4+
35
from LightningBot import LightningBot
46
from random import randint
57
from sys import argv
68

79
bot = LightningBot(
810
bot_name = 'Rando' + '%04d' % randint(0, 9999),
9-
api_token = argv[1] if len(argv) > 1 else None
1011
)
1112

12-
1313
move_direction = randint(0, 3)
1414

1515
while bot.waitForNextTurnDirections():
1616

17-
turn_direction = -1 if randint(0, 1) == 0 else 1
17+
turn_direction = randint(-1, 1)
1818

1919
move_direction = (move_direction + turn_direction) % 4
2020

‎snowflake.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env python3
22

3+
# Follow a cycle of turns
4+
35
from LightningBot import LightningBot
46
from random import randint, shuffle
57
from sys import argv

‎spiral.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env python3
22

3+
# Continuously turn in one direction to make a spiral
4+
35
from LightningBot import LightningBot
46
from random import randint
57
from sys import argv

‎stepdown.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env python3
22

3+
# Make like a root and step down
4+
35
from LightningBot import LightningBot
46
from random import randint
57
from sys import argv

‎swerve.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env python3
22

3+
# Go straight but turn before crashing or if an opponent is moving in front of you
4+
35
from LightningBot import LightningBot
46
from random import randint
57
from pprint import pprint

0 commit comments

Comments
 (0)
Please sign in to comment.