MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / print_board

Function print_board

projects/Sudoku_solver/main.py:64–82  ·  view source on GitHub ↗
(bo)

Source from the content-addressed store, hash-verified

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

Callers 2

generate_boardFunction · 0.70
main.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected