/alien-invasion

Mad​ ​aliens​ ​are​ ​about​ ​to​ ​invade​ ​the​ ​earth​ ​and​ ​you​ ​are​ ​tasked​ ​with​ ​simulating​ ​the invasion.

Primary LanguageGo

Alien Invasion

Mad​ ​aliens​ ​are​ ​about​ ​to​ ​invade​ ​the​ ​earth​ ​and​ ​you​ ​are​ ​tasked​ ​with​ ​simulating​ ​the invasion.

Setup

Requirements

From Source

$ make
// OR
$ go run main.go

Docker

Build and run from local Dockerfile:

$ docker-compose up

Arguments

-w string
    world file name (default "test/world_1.txt").
-a int
    number of aliens (default 10).
-i int
    number of iterations (default 10000).

E.g.:

$ go run main.go -w test/world_2.txt

$ go run main.go -w test/world_2.txt -a 20 -i 1000

$ go run main.go -w test/world_2.txt -a 2 -i 10

$ go run main.go -a 20 -i 1000

All test files are located inside the test folder.

Useful Commands

Unit tests

$ make test

Help

$ make help