- ttt built using golang
- only on a 3 x 3 board
-
to check your go version
- run
$ go version
- my version is:
go1.11.1 darwin/amd64
- run
-
clone this repo
- run
$ git clone [email protected]:rrugamba/go-ttt.git
- run
-
add these lines in the
.bash_profile
export GOPATH=$HOME/path_to_your_cloned_repo export GOROOT=/usr/local/opt/go/libexec export PATH=$PATH:$GOPATH/bin export PATH=$PATH:$GOROOT/bin
- navigate to your root directory
- run
$ cd /
- then
$ cd usr/local/opt/go/libexec/src/
- then
$ go get github.com/franela/goblin
- run
-
core
-
to run all tests
- inside the
core/test
directory - run
$ go test ./...
- inside the
-
to run unit tests for packages
- run
go test
inside the specific package directory - forexample to run board tests
$ cd core/test/board
$ go test
- to run all tests for the board package
- to run moveStrategy tests
$ cd core/test/moveStrategy
$ go test
- to run all tests for the moveStrategy package
- run
-
-
console
-
to run all tests
- inside the
console/test
directory - run
$ go test ./...
- inside the
-
to run unit tests for packages
$ cd console/test/setup
$ go test
- to run all tests for the setup package
-
- console version
- within the cloned repo
$ cd console/src/main
$ go run main.go
- should start game options to play TTT
- within the cloned repo