Изменена проверка карт для запуска

This commit is contained in:
sitisll 2023-02-15 17:17:07 +03:00
parent 480ca97e1d
commit e397f67f56

22
dodo.py

@ -25,9 +25,9 @@ if x>0:
def print_line(text):
"Добавление тире вокруг текста, покраска"
print(colorama.Fore.YELLOW + "-"*25)
print(colorama.Fore.YELLOW + "-"*30)
print(colorama.Fore.GREEN + text)
print(colorama.Fore.YELLOW + "-"*25 + colorama.Style.RESET_ALL)
print(colorama.Fore.YELLOW + "-"*30 + colorama.Style.RESET_ALL)
def create_dir(directory):
@ -221,14 +221,22 @@ def start(map_server=list_config):
map_choise = []
while True:
"Проверка на выбор имеющихся карт"
check = True
for i in range(len(map_server)):
print(f"{i+1}) {map_server[i]}")
map_list = check_int("\n")
#for k in range(map_list):
# if 0>int(map_list[k])>map_list and len(str(map_list))>len(str(map_server)):
# print("Укажите карты для установки в формате 1,3,5 или 145 или 1 2 3")
# else:
map_list = input("Выбери карты для запуска в формате 1 2 3 или 1,2,3")
map_list = map_list.replace(',', ' ')
map_list = list(set(map_list.split()))
try:
for s in map_list:
if int(s) > len(map_server):
check = False
if len(map_list) <= len(map_server) and check == True:
break
except:
print("Неправильный ввод")
for j in str(map_list):
map_choise.append(map_server[int(j) - 1])