master
IljaP 2024-04-25 11:22:28 +03:00
parent 2abaddde11
commit 4179a54943
1 changed files with 13 additions and 13 deletions

View File

@ -9,13 +9,13 @@ DOMINO_H = 200
DOMINOS = []
values = range(7)
# for v_up in values:
# for v_down in values:
# if not [v_up, v_down] in DOMINOS and not [v_down, v_up] in DOMINOS:
# DOMINOS.append([v_up, v_down])
for v_up in values:
for v_down in values:
if not [v_up, v_down] in DOMINOS and not [v_down, v_up] in DOMINOS:
DOMINOS.append([v_up, v_down])
for _ in range(10):
DOMINOS.append([[1, '1'], [1, '1']])
# for _ in range(10):
# DOMINOS.append([[1, '1'], [1, '1']])
print(DOMINOS)
@ -30,13 +30,13 @@ str_values = {
6: ["3!", "2+2*2", "round(pi)*2", "(if 6>1)*6", "10-4", "24/4", "sqrt(12*3)", "3^2-3", "2*(4-1)", "{1,3,6}[2]"]
}
# for i in range(len(DOMINOS)):
# v_up = choice(str_values[DOMINOS[i][0]])
# str_values[DOMINOS[i][0]].remove(v_up)
# v_down = choice(str_values[DOMINOS[i][1]])
# str_values[DOMINOS[i][1]].remove(v_down)
#
# DOMINOS[i] = [[DOMINOS[i][0], v_up], [DOMINOS[i][1], v_down]]
for i in range(len(DOMINOS)):
v_up = choice(str_values[DOMINOS[i][0]])
str_values[DOMINOS[i][0]].remove(v_up)
v_down = choice(str_values[DOMINOS[i][1]])
str_values[DOMINOS[i][1]].remove(v_down)
DOMINOS[i] = [[DOMINOS[i][0], v_up], [DOMINOS[i][1], v_down]]
print(DOMINOS)