Dependencies • Technologies • How To Check • Documentation • Contributing
With a correctly configured Go toolchain:
go get -u github.com/obarra-dev/minesweeper@latest
Let's game it out
func main() {
//start
mines := []minesweeper.Mine{{Row: 1, Column: 1}}
game := minesweeper.New(3, 8, mines)
//play
gameCopy := game.Play(0, 0, minesweeper.TypeMoveClean)
//show game state
switch gameCopy.State {
case minesweeper.StateGameNew:
fmt.Println("Game Start...")
case minesweeper.StateGameRunning:
fmt.Println("Running...")
case minesweeper.StateGameLost:
fmt.Println("Game lost...")
case minesweeper.StateGameWon:
fmt.Println("Game Won...")
default:
fmt.Println("Crash...")
}
}
Before running the project lints please ensure that all the dependencies are installed in your system. Then execute the following command:
make lint
In order to run the project tests you need to execute the following command:
make test
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Make your changes
- Run the tests, adding new ones for your own code if necessary (
junit5
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
- Questions?, write here