MCPcopy Create free account
hub / github.com/ndleah/python-mini-project / print_board

Function print_board

Sudoku_solver/main.py:68–86  ·  view source on GitHub ↗
(bo)

Source from the content-addressed store, hash-verified

66
67
68def print_board(bo):
69 # looping every line in the array
70 for i in range(len(bo)):
71 # printing line if the vertical "box" changes
72 if i % 3 == 0 and i != 0:
73 print("- - - - - - - - - - - - - ")
74 # looping every character in one line
75 for j in range(len(bo[0])):
76 # printing lines if the horizontal box changes
77 # printing each character with spaces except for the last
78 if j % 3 == 0 and j != 0:
79 print(" | ", end="")
80 if j == 8:
81 # last character is printed without spaces behind
82 print(bo[i][j])
83 else:
84 # printing each character with spaces
85 print(str(bo[i][j]) + " ", end="")
86 print("")
87
88
89def possible(bo, pos, num):

Callers 2

generate_boardFunction · 0.85
main.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected