Skip to content

mariajdab/alien-invasion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alien-invasion

assumptions

  • If in the same city there are two aliens, then they will fight. If there are three or more is an assumption that the could have a good relationship.

  • The file containing the names of cities in the non-existent world of X will be at the root of the project, if is needed to test with a new file please update the constant worldMap with the name of the file.


The file will be read, and the data parsed in order to extract only the valuable information, each line of the file that contains the main city and its adjacent cities will be saved on a map of maps in Go. The directions will not be saved.

An example of this, consider that if the file cities_list.txt found in this repository is to be read by the program:

A possible map of the firts cities (main cities) that appers in each line of the file cities_list.txt, will be the following:

Screenshot from 2023-01-07 21-29-53

A possible map of the adjacents cities for the main city Foo

Screenshot from 2023-01-07 21-30-32

Note: The order is not restricted

Starting 🚀

To run the program please clone this repository:

git clone https://github.com/mariajdab/alien-invasion.git

run the file main.go it will need the argument of the number of aliens

go run main.go <number_of_aliens>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages