-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelper.py
58 lines (49 loc) · 1.53 KB
/
helper.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
import requests
from random import choice, randint
def is_valid(word):
url = f"https://api.dictionaryapi.dev/api/v2/entries/en/{word.lower().replace('q', 'qu')}"
request = requests.get(url)
return isinstance(request.json(), list)
def letter_gen():
DICE = [
"RIFOBX",
"IFEHEY",
"DENOWS",
"UTOKND",
"HMSRAO",
"LUPETS",
"ACITOA",
"YLGKUE",
"QBMJOA",
"EHISPN",
"VETIGN",
"BALIYT",
"EZAVND",
"RALESC",
"UWILRG",
"PACEMD",
]
while DICE:
die = DICE.pop(randint(0, len(DICE) - 1))
yield choice(die)
# Testing:
# x = [
# ["A", "X", "G", "A"],
# ["S", "A", "N", "T"],
# ["Q", "I", "E", "D"],
# ["E", "L", "O", "T"],
# ]
# yield from x
A = r""" ___ .--.
( ) (_ |
| |.-. .--. .--. .--. | | .--.
| / \ / \ / \ / \ | | / \
| .-. | | .-. ; ; ,-. ' ; ,-. ' | | | .-. ; """
B = r""" | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | |/ |
| | | | | | | | | | | | | | | | | | | ' _.' """
C = r""" | ' | | | ' | | | ' | | | ' | | | | | .'.-.
' `-' ; ' `-' / ' `-' | ' `-' | | | ' `-' /
`.__. `.__.' `.__. | `.__. | (___) `.__.'
( `-' ; ( `-' ;
`.__. `.__. """