Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zxq.co/howl/alien-invasion

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zxq.co/howl/alien-invasion

  • v1.0.0
  • Go
  • Socket score

Version published
Created
Source

Alien Invasion

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

The simulator reads a list of cities from a file (as a reference, the cities.txt file is provided, with a very simplified map of some major Japanese cities!).

Features

  • A parser of very simple text-based maps!
  • Very intelligent AI simulating the behaviour of real aliens!
  • A self-contained package containg the engine, with both the city parser and the AI!
  • ... Japanese aliens? 1

Installation

The project can be simply cloned with git, and then executed either by building/installing the binary first (with go build or go install), or otherwise simply by using go run

go run .
Usage: /home/howl/throw/tmp/go-build1192903492/b001/exe/alien-invasion [FLAG...] ALIEN_COUNT
  -cities string
        File containing the cities that will be invaded (default "cities.txt")
  -pad-size int
        Pad city names and directions up to int spaces, formatting as a table
  -show-aliens
        When printing the cities left, show the aliens in each of them as well
exit status 1

In order to run tests, a dependency is required, which you can obtain using go get.

Example invasion

$ go run . -show-aliens -pad-size 16 10
Mad aliens have just invaded earth.
10 aliens scatter around our world, in an attempt to conquer it... and destroy it.
Tesoseseri and Fumuso crossed paths in Tokyo. In an attempt to kill each other, they detonated several bombs, killing themselves and all the city inhabitants.
Mohenu and Koko crossed paths in Iwaki. In an attempt to kill each other, they detonated several bombs, killing themselves and all the city inhabitants.
Homehirisu, Monohitowa and Kata found themselves in a three-alien standoff in Osaka. While Kata was shooting at Homehirisu, they accidentally created a space-time portal surrounding all of Osaka, which is now floating in space, 300 years in the future.
Riso and Susoruhero crossed paths in Shizuoka. In an attempt to kill each other, they detonated several bombs, killing themselves and all the city inhabitants.
At the end of the Great Alien Wars, Menuwasu was the only survivor. After depleting earth of all its natural resources (or what the humans had left of them, anyway), lusting for more plans to consume, he settled to travel to Mars, where he was killed very shortly after landing.
Chiba[]
Fuji[]                            east=Yokohama
Hamamatsu[Menuwasu]
Kobe[]                            east=Kyoto                        west=Takamatsu
Kyoto[]                                                             west=Kobe
Nagoya[]
Niigata[]                         east=Sendai
Okayama[]                                          south=Takamatsu
Sendai[]                                                            west=Niigata
Takamatsu[]      north=Okayama    east=Kobe
Wakayama[]
Yokohama[]                                                          west=Fuji

Aside from the killing log messages, at the end of the output are provided, in the same format as the cities file (unless -show-aliens is specified), the surviving cities and their links.


Footnotes

  1. It simply seemed easier to generate names with Japanese syllables rather than trying to come up with syllables in another language.

FAQs

Package last updated on 25 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc