Skip to content

Instantly share code, notes, and snippets.

@nticaric
Created February 5, 2018 23:14
Show Gist options
  • Save nticaric/0bab55b84810a3f0ffce862a41f4597f to your computer and use it in GitHub Desktop.
Save nticaric/0bab55b84810a3f0ffce862a41f4597f to your computer and use it in GitHub Desktop.
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