-
Notifications
You must be signed in to change notification settings - Fork 457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lesson07 #889
base: master
Are you sure you want to change the base?
Lesson07 #889
Conversation
import random | ||
for i in range(3): | ||
self._matrix_3x9.append([0 for x in range(9)]) | ||
list_number = sorted(random.sample(range(self.vsego_bochenok+1),5)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
кажется что может оказаться так что в карточке будет несколько одинаковых чисел
|
||
class Game(): | ||
def __init__(self): | ||
self.Meshok_ = Meshok() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
с большой буквы мы именуем только названия классов, все остальное - с маленькой
try: | ||
resp_str = input("Введите номера позиций на карточке в формате (i1,j1), (i2,j2), ... - где i1-номер строки, " | ||
"j1 - номер столбца в карточке. Номера начинаются с 1 \n>>") | ||
#Преобразуем введенную строку в список кортежей, где кортеж - координаты поля | ||
s = resp_str[1:][:-1].split("),(") | ||
resp = [tuple([int(y)-1 for y in x.split(",")]) for x in s] | ||
return resp | ||
except Exception as e: | ||
print("Ошибка ввода, для продолжения нажмите Enter.\n",e) | ||
input() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
бедный пользователь, заставили его вбивать координаты числа) - не очень юзерфрендли))
Все сделал