File tree 10 files changed +26
-6
lines changed
10 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
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
+
3
6
from LightningBot import LightningBot
4
7
from random import randint
5
8
from sys import argv
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
3
+ # Turn whichever way leads to the longest possible path, or go straight if there's a tie
4
+
3
5
from LightningBot import LightningBot
4
6
from random import randint
5
7
6
- bot = LightningBot ('Depth' + '%04d' % randint (0 , 9999 ))
8
+ bot = LightningBot (
9
+ bot_name = 'Depth' + '%04d' % randint (0 , 9999 ),
10
+ )
7
11
8
12
while bot .waitForNextTurnDirections ():
9
13
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
3
+ # Move straight by turn randomly when lengths in the fibonacci sequence
4
+ # are reached
5
+
3
6
from LightningBot import LightningBot
4
7
from random import randint
5
8
from sys import argv
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
3
+ # Move along a hilbert curve which fills the board
4
+
3
5
from LightningBot import LightningBot
4
6
from random import randint , shuffle
5
7
from sys import argv
6
8
7
9
bot = LightningBot (
8
10
bot_name = 'Hilbert' + '%03d' % randint (0 , 999 ),
9
- api_token = argv [1 ] if len (argv ) > 1 else None
10
11
)
11
12
12
13
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
3
+ # Lose on the first turn by breaking the rules
4
+
3
5
from LightningBot import LightningBot
4
6
from random import randint
5
7
from sys import argv
6
8
7
9
bot = LightningBot (
8
10
bot_name = 'Loser' + '%05d' % randint (0 , 99999 ),
9
- api_token = argv [1 ] if len (argv ) > 1 else None
10
11
)
11
12
12
13
bot .move (- 1 )
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
3
+ # Move in a random direction
4
+
3
5
from LightningBot import LightningBot
4
6
from random import randint
5
7
from sys import argv
6
8
7
9
bot = LightningBot (
8
10
bot_name = 'Rando' + '%04d' % randint (0 , 9999 ),
9
- api_token = argv [1 ] if len (argv ) > 1 else None
10
11
)
11
12
12
-
13
13
move_direction = randint (0 , 3 )
14
14
15
15
while bot .waitForNextTurnDirections ():
16
16
17
- turn_direction = - 1 if randint (0 , 1 ) == 0 else 1
17
+ turn_direction = randint (- 1 , 1 )
18
18
19
19
move_direction = (move_direction + turn_direction ) % 4
20
20
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
3
+ # Follow a cycle of turns
4
+
3
5
from LightningBot import LightningBot
4
6
from random import randint , shuffle
5
7
from sys import argv
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
3
+ # Continuously turn in one direction to make a spiral
4
+
3
5
from LightningBot import LightningBot
4
6
from random import randint
5
7
from sys import argv
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
3
+ # Make like a root and step down
4
+
3
5
from LightningBot import LightningBot
4
6
from random import randint
5
7
from sys import argv
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
3
+ # Go straight but turn before crashing or if an opponent is moving in front of you
4
+
3
5
from LightningBot import LightningBot
4
6
from random import randint
5
7
from pprint import pprint
You can’t perform that action at this time.
0 commit comments