mirror of
https://github.com/Sosokker/sudoku-terminal-game.git
synced 2025-12-18 21:24:05 +01:00
Create main.py (Input)
This commit is contained in:
parent
f056f3f66a
commit
de20f14e46
23
main.py
Normal file
23
main.py
Normal file
@ -0,0 +1,23 @@
|
||||
from rich.console import Console
|
||||
|
||||
def create_sudoku_table():
|
||||
table = []
|
||||
console = Console()
|
||||
|
||||
console.print("[bold green]Enter the Sudoku table row by row:[/bold green]")
|
||||
for i in range(9):
|
||||
row = []
|
||||
console.print(f"\n[bold yellow]Enter row {i+1}:[/bold yellow]")
|
||||
for j in range(9):
|
||||
value = console.input(f"Enter value for column {j+1}: ")
|
||||
row.append(value)
|
||||
table.append(row)
|
||||
|
||||
return table
|
||||
|
||||
sudoku_table = create_sudoku_table()
|
||||
|
||||
console = Console()
|
||||
console.print("\n[bold cyan]Sudoku Table:[/bold cyan]")
|
||||
for row in sudoku_table:
|
||||
console.print(" | ".join(row))
|
||||
Loading…
Reference in New Issue
Block a user