Files
learngo/x-tba/tictactoe/10-arrays/board_test.go

45 lines
711 B
Go
Raw Normal View History

package main
// Examples are normally used for showing how to use your package.
// But you can also use them as output testing.
func ExamplePrintBoard() {
initCells()
printBoard()
// Output:
// ~~~~~~~~~~~~~~~
// TIC~TAC~TOE
// ~~~~~~~~~~~~~~~
//
// /---+---+---\
// | | | |
// +---+---+---+
// | | | |
// +---+---+---+
// | | | |
// \---+---+---/
}
func ExamplePrintBoardCells() {
initCells()
cells[0] = player1
cells[4] = player2
cells[8] = player1
printBoard()
// Output:
// ~~~~~~~~~~~~~~~
// TIC~TAC~TOE
// ~~~~~~~~~~~~~~~
//
// /---+---+---\
// | X | | |
// +---+---+---+
// | | O | |
// +---+---+---+
// | | | X |
// \---+---+---/
}