Giter VIP home page Giter VIP logo

alien-invasion's Introduction

alien-invasion

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

A command line interface is provided to simulate the alien invasion of the world of X. The program outputs details of the simulation and the final map state after it completes.

  • World map inputs are stored in alien-invasion/internal/worldmap/mapsdata, assumed to be of format [CITY direction=CITY ...]
  • Names created with https://github.com/brianvoe/gofakeit

Build

  • From main directory run go build cmd/invasioncli/main.go

Run

  • Run main with flag 'aliens' for number of aliens in simulation: ./main -aliens=20
  • Can add optional flag 'infile' for other test maps: ./main -aliens=5 -infile=map.txt
    • default map location is /mapsdata/map_test.txt
  • ./main with no options given will default to a 20 alien simulation on the default test map

Test

  • Includes basic tests for /internal, can run go test for:
    • /aliens
    • /invasion
    • /pkg
    • /worldmap

Sample Output:

  • ./main -aliens=10
10 aliens are invading!
Qu-ux has been destroyed by Quamvoluptas and Consequaturet!
Foo has been destroyed by Minimaoptio, Nihilvelit, and Eumnon!
Baz has been destroyed by Quiillo, Etet, and Porrosed!
Final map output:
Bar west=Bee 
Bee east=Bar 

alien-invasion's People

Contributors

npoet avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.