Console snake game as test task for SkyCoin made within 3 hours
After feedback following was fixed:
- Using
fmt.Scanln
rather thanbufio.Scanner
- Returning proper error rather than default value
- Removing loop label
Run
make build
for building project. Then run
./main {height} {width}
for starting the game. Height and width are integers of the game frame. During game enter every move as single letter:
l
- leftr
- rightu
- upd
- down
Height and width as well as round and score count printed at the top. Symbols within game:
q
- snake heado
- snake body@
- food#
- game frame
mockery --name={interface} --filename=mock.go
- generate mock classes (in package)
make lint
- lint with golangci-lint
make format
- format with goimport
make test
- run unit tests
make cover
- run unit tests and show coverage report
make build
- build project