Rodripelto

Simulador _bingo

Mar 5th, 2022
80
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import random
  2. import time
  3. import colorama as co
  4. import os
  5. def borrar():
  6.   if os.name == "nt":
  7.     os.system("cls")
  8.   else:
  9.     os.system("clear")
  10. def panel(bingo=[]):
  11.   borrar()
  12.   def numeros(ini,fin):
  13.     for i in range(ini,fin):
  14.       n = str(i)
  15.       if i < 10 :
  16.         n = "0" + n  
  17.       if i in bingo:
  18.         print(co.Fore.GREEN,end="")
  19.       print(n,co.Fore.WHITE,end=" ")
  20.     print("")
  21.      
  22.   print(co.Back.RED,"B",co.Back.BLACK,end=" ")
  23.   numeros(1, 16)
  24.   print (co.Back.BLUE, "I",co.Back.BLACK,end=" ")
  25.   numeros(16,31)
  26.   print (co.Back.GREEN,"N",co.Back.BLACK,end=" ")
  27.   numeros(31,46)
  28.   print (co.Back.YELLOW,"G",co.Back.BLACK,end=" ")
  29.   numeros(46,61)
  30.   print (co.Back.WHITE + co.Fore.BLACK,"O",co.Back.BLACK + co.Fore.WHITE,end= " ")
  31.   numeros(61,76)
  32.  
  33. panel()
  34. numeros = []
  35. while len(numeros) < 75:
  36.   numero =random.randint(1, 75)
  37.   if numero not in numeros:
  38.     numeros.append(numero)
  39.     panel(numeros)
  40.     time.sleep(2)
RAW Paste Data Copied