-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbutton-logic.py
40 lines (27 loc) · 974 Bytes
/
button-logic.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from datetime import datetime, timedelta
list = [[], []]
button_counter = 0
signal = None
timeout_limit = 5
while signal != 0:
signal = int(input("Please input a number: "))
def appender(signal, button_counter):
list[0].append(datetime.now())
timer_start = datetime.now()
while datetime.now() < timer_start + timedelta(seconds=timeout_limit):
button = int(input("Chance to append with 1-4: "))
button_counter += 1
if button_counter == 1:
if datetime.now() < timer_start + timedelta(seconds=timeout_limit):
list[1].append(button)
else:
list[1].append(0)
button_counter += 1
button_counter = 0
def printer():
print("list len: ", len(list))
for i in range(len(list)):
print(list[i])
printer()
appender(signal, button_counter)
print("Done")