Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created December 26, 2021 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/b4d5a158487dfc7834970535cf066d36 to your computer and use it in GitHub Desktop.
Save parzibyte/b4d5a158487dfc7834970535cf066d36 to your computer and use it in GitHub Desktop.
def imprimir_tablero(tablero):
# Imprime números de columnas
print("|", end="")
for f in range(1, len(tablero[0]) + 1):
print(f, end="|")
print("")
# Datos
for fila in tablero:
print("|", end="")
for valor in fila:
color_terminal = Fore.GREEN
if valor == COLOR_2:
color_terminal = Fore.RED
print(color_terminal + valor, end="")
print(Style.RESET_ALL, end="")
print("|", end="")
print("")
# Pie
print("+", end="")
for f in range(1, len(tablero[0]) + 1):
print("-", end="+")
print("")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment