https://github.com/x1unix/alien-invasion
https://github.com/x1unix/alien-invasion
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/x1unix/alien-invasion
- Owner: x1unix
- Created: 2023-08-06T18:52:29.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-08-07T15:00:49.000Z (over 1 year ago)
- Last Synced: 2025-01-31T07:16:14.979Z (3 months ago)
- Language: Go
- Size: 37.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Alien Invasion
Alien invasion simulation game.
## Assumptions
- City name is unique and case-sensitive.
- Number of aliens cannot exceed the number of cities.
- This solution assumes that each city should contain correct connections on both sides
- City A should connect to city B and city B connects to city A.
- Each direction from and to a city is one-to-one only. Many to many is unsupported.
- At this solution, collision check performed right after the move.
- This leads to case when only 2 aliens max can end up in the same city.## Usage
```shell
# Run game with 20 aliens and 'us-cities' map file.go run ./cmd/invasion -c 20 -f ./dataset/us-cities.txt
```Datasets are available in [datasets](dataset) directory.
Use `-v` flag for verbose debug output. Debug log will be written to stderr.
Use `--help` to get brief about all flags.
## Tests
```shell
make test# With coverage
make cover
```