mirror of
https://github.com/ovosimpatico/bingo.git
synced 2026-01-15 16:33:36 -03:00
Minor QoL changes
* Random generator is now more functional * Add more comments * table is now easier to understand
This commit is contained in:
@@ -114,7 +114,7 @@ def maketable(elemento_inicial, lista, playerselect, backend_results, modelovito
|
||||
|
||||
#Montagem e apresentação da tabela usando PrettyTable
|
||||
x = PrettyTable()
|
||||
x.field_names = ["Dono", "1", "2", "3", "4", "5"]
|
||||
x.field_names = ["Dono", "B", "I", "N", "G", "O"]
|
||||
x.add_rows(
|
||||
[
|
||||
[playerselect[0], lista[0][0], lista[0][1], lista[0][2], lista[0][3], lista[0][4]],
|
||||
@@ -144,13 +144,15 @@ def TUI_principal():
|
||||
principal = ""
|
||||
playerselect = [0] * 4
|
||||
backend_results = [0] * 4
|
||||
listaaleatoria = geralistaaleatoria()
|
||||
for i in range(len(backend_results)):
|
||||
backend_results[i] = [0] * 5
|
||||
|
||||
#Busca as 4 cartelas aleatórias de cartelas_show()
|
||||
lista = cartelas_show()
|
||||
|
||||
#Busca a lista de números à serem sorteados
|
||||
listaaleatoria = geralistaaleatoria(50, 50)
|
||||
|
||||
#Loop que roda maketable() até que haja algum status (Vitória ou derrota)
|
||||
i = -1
|
||||
while principal == "":
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
def aleatorio(x, y):
|
||||
#Retorna um valor aleatório de tamanho a ser determinado
|
||||
import random
|
||||
return random.randint(x, y)
|
||||
import random
|
||||
|
||||
def geralistaaleatoria():
|
||||
def aleatorio(min, max):
|
||||
#Retorna um valor aleatório de tamanho a ser determinado
|
||||
return random.randint(min, max)
|
||||
|
||||
def geralistaaleatoria(max, quantelementos):
|
||||
#Gera uma lista de números à serem sorteados - Esses números são
|
||||
#únicos e aleatórios, entre 0 e 50
|
||||
import random
|
||||
x = random.sample(range(50), k=50)
|
||||
return x
|
||||
#únicos e aleatórios.
|
||||
return random.sample(range(max), k=quantelementos)
|
||||
Reference in New Issue
Block a user