-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-random-data.py
59 lines (48 loc) · 1.74 KB
/
generate-random-data.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from datetime import datetime
import random
choices = ["Cards", "Decks"]
id = 0
username = "SingularisArt"
score = 0
number_of_items = 0
number_of_correctly_memorized_items = 0
number_of_incorrectly_memorized_items = 0
actual_card_data = "{}"
memorized_card_data = "{}"
hour = 0
minute = 0
second = 0
month = 7
day = 0
for i in range(35):
day += 1
id += 1
item = random.choice(choices)
date = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
finished_time = random.randint(1, 120)
hour = random.randint(0, 23)
minute = random.randint(0, 59)
second = random.randint(0, 59)
try:
time = datetime(2023, month, day, hour, minute, second)
except ValueError:
day = 1
month += 1
time = datetime(2023, month, day, hour, minute, second)
if item == "Cards":
number_of_items = random.randint(1, 52)
number_of_correctly_memorized_items = random.randint(1, number_of_items)
number_of_incorrectly_memorized_items = (
number_of_items - number_of_correctly_memorized_items
)
score = round(number_of_correctly_memorized_items / number_of_items, 4)
elif item == "Decks":
number_of_items = random.randint(1, 3)
number_of_correctly_memorized_items = random.randint(1, number_of_items * 52)
number_of_incorrectly_memorized_items = (
number_of_items * 52 - number_of_correctly_memorized_items
)
score = round(number_of_correctly_memorized_items / (number_of_items * 52), 4)
print(
f"({id}, '{username}', '{time}', {finished_time}, {score}, '{item}', {number_of_items}, '{actual_card_data}', '{memorized_card_data}', {number_of_correctly_memorized_items}, {number_of_incorrectly_memorized_items})"
)