-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.py
26 lines (21 loc) · 924 Bytes
/
project.py
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
class Project():
def __init__(self, total_steps=4, levers=4, current_step=0, sequence={}):
self.levers = levers
self.current_step=current_step
self.sequence={int(key):sequence[key] for key in sequence}
self.total_steps=total_steps
def get_sequence(self, step):
return self.sequence[step]
def get_next_sequence(self):
self.current_step = self.current_step+1
if self.current_step == self.total_steps:
self.current_step = 0
return self.sequence[self.current_step]
def get_previous_sequence(self):
self.current_step = self.current_step-1
if self.current_step < 0:
self.current_step = self.total_steps-1
return self.sequence[self.current_step]
def initialize(self):
for step in range(self.total_steps):
self.sequence[step] = [1 for x in range(self.levers)]