This project is a mini project for me to learn test-driven development (TDD) using golang.
In this project, user will be asked to guess a person
age.
The age of the person
is random 0 to 100 inclusive at initalization.
There are three conditions:
- when user guesses too high, system will return message "too high"
- when user guesses too low, system will return message "too low"
- when user guesses right, system will return message "correct"
If go isn't installed yet, you can install it by going to this link
Choose go version go1.11.4
based on your system.
To check the version, type this command on your terminal:
go version
To test the project, go to this project root directory. In the directory, type the following command in your terminal:
go test --cover ./...
To build the project, go to this project root directory. In the directory, type the following command in your terminal:
go build -o guess_person main.go
To run the project, go to this project root directory. If it's not built yet, build the project. After that, in the directory, type the following command in your terminal:
./guess_person