-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbolt_list.py
More file actions
57 lines (36 loc) · 1.11 KB
/
bolt_list.py
File metadata and controls
57 lines (36 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from flash import *
from graphics import *
# Bolt list is a list of random sequences
# each sequence starts at (125n, 0), where 1<=n<=7
# and navigates to some point (x, 800)
class BoltList:
def __init__(self):
self.list = get_list()
self.size = 8
def get_list(self):
j = 0
count =0
while j < 800:
self.list.append(Lightning(j,0).get_sequence())
j = j+ 125
count = count +1
def get_size(self):
return self.size
#returns a 2-tuple (<size>, <index>)
def min_sequence(self):
min_size = 1000
min_idx = 0
idx = 0
for i in self.list:
if len(i) < min_size:
min_size = len(i)
min_idx = idx
idx = idx + 1
return (min_size,min_idx)
def get_list():
bolts = []
j = 0
while j < 800:
bolts.append(Lightning(j,0).get_sequence())
j = j+ 125
return bolts