This repository contains the source-code of the saga-alien-invasion
CLI.
Demo.mp4
saga-alien-invasion [number of aliens invading] [flags]
-h, --help help for saga-alien-invasion
--mapfile string the file containing the map of the 🌍, [relative path] (default "map.txt")
--maxTurns int the number of turns before the mothership calls the aliens back home and the program ends (default 10000)
--numAliensForBattle int the number aliens required to start a battle that will end up destroying a city (default 2)
--verbose if True, sets the loglevel to show DEBUG messages
In this repository we leverage GoDoc and Docker, in order to view a self-hosted GoDoc site, run:
make godoc
and navigate to http://localhost:6060/pkg/github.com/deblasis/saga-alien-invasion/
You have a few options, Dockerized executable or compiled locally
You just have to build the container image with
make docker/build
and then execute the command
docker run deblasis-saga-alien-invasion saga-alien-invasion [number of aliens invading] [flags]
If you want to pass in a different map that's on your filesystem you can do that using a volume, something like:
docker run -v $(pwd)/anothermap.txt:/go/src/github.com/deblasis/saga-alien-invasion/map.txt deblasis-saga-alien-invasion saga-alien-invasion [number of aliens invading] [flags]
if you know your way around Docker there are other ways too! Feel free to PR a documentation change if this step can be simplified/improved in your opinion ;)
make build
./saga-alien-invasion [number of aliens invading] [flags]
go run ./... X --verbose
where X is the number of aliens you want to spawn
make test
and
make test/nocache
to make sure that there is no smoke and mirrors with the random stuff
make test/cover
and then navigate to http://localhost:8080/