Created
February 5, 2018 23:14
-
-
Save nticaric/0bab55b84810a3f0ffce862a41f4597f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func printBoard(board [9][9]int) { | |
fmt.Println("+-------+-------+-------+") | |
for row := 0; row < 9; row++ { | |
fmt.Print("| ") | |
for col := 0; col < 9; col++ { | |
if col == 3 || col == 6 { | |
fmt.Print("| ") | |
} | |
fmt.Printf("%d ", board[row][col]) | |
if col == 8 { | |
fmt.Print("|") | |
} | |
} | |
if row == 2 || row == 5 || row == 8 { | |
fmt.Println("\n+-------+-------+-------+") | |
} else { | |
fmt.Println() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment