This commit is contained in:
ada-dmitry
2023-08-22 23:55:00 +03:00
parent 5cc1433ab4
commit 0b2580592a
3 changed files with 16 additions and 2 deletions
+14
View File
@@ -1,3 +1,6 @@
from random import shuffle
def isEnd(cur, trueChatID): def isEnd(cur, trueChatID):
# cur.execute(f"SELECT ChatID FROM Chats WHERE TrueChatID = '{trueChatID}'") # cur.execute(f"SELECT ChatID FROM Chats WHERE TrueChatID = '{trueChatID}'")
# row = cur.fetchall() # row = cur.fetchall()
@@ -24,3 +27,14 @@ def isEnd(cur, trueChatID):
return "mafia" return "mafia"
return "" return ""
def role_cnt(user_count):
ls = [0, 0, 1, 1, 0]
ls[4] = user_count//4
ls[1] = user_count - ls[4]
return ls
def role_distribution(userIDs, count_r):
pass
+1
View File
@@ -57,5 +57,6 @@ def start(): # Команда принимает на вход
db.query_ins_user(id, curs) db.query_ins_user(id, curs)
db.close() db.close()
if __name__ == '__main__': if __name__ == '__main__':
app.run() app.run()
-1
View File
@@ -51,4 +51,3 @@ def query_change(x):
def close(cur): def close(cur):
cursor.close() cursor.close()