Generate planets and galaxies following the Acornsoft Elite planet generation algorithm.
require 'elite_universe/planet'
planet = EliteUniverse::Planet.new(44344, 5276, 5405)
planet.name # = Lave
require 'elite_universe/galaxy'
galaxy = EliteUniverse::Galaxy.new(23114, 584, 46931)
galaxy[129].name # = Zaonce
EliteUniverse::Galaxy
is an Enumerable class and so, for example, a full list
of planet names in the galaxy can be generated with:
galaxy.map(&:name)
galaxy.planets
will return an array of all instances of
EliteUniverse::Planet
in an EliteUniverse::Galaxy
. This is deprecated.
Instead of galaxy.planets[i]
use galaxy[i]
.
The Elite Universe gem is available to everyone under the terms of the MIT open source license. Take a look at the LICENSE file in the code.
The Elite planet generation algorithm is copyright (c) 1984 of David Braben and Ian Bell.
This ruby implementation is copyright (c) 2015 Joe Haig