|
CLASS {Star_system}, SAFE :
IMPORT {Planet_or_star} ;
{Planet} All_planets|_and_stars[]
STR Name|_of_star_system
{Planet} Current_parent|_for_new_planets_and_stars
METHOD Last|_planet ==> {Planet} := All_planets[*] .
METHOD New_planet(STR Name|_planet) ==> {Planet}, NEW :
RESULT = {Planet}(Star_ = THIS,
Parent_ = Current_parent,
Name = Name), >> All_planets[]
Current_parent.Satellit[] << RESULT
CASE All_planets[].Count == 0 ? Current_parent = RESULT ; .
METHOD Make|_planet(STR Name|_planet) :
CASE "," IN Name ?
STR
names|_splitted[].Split(Name, ",")
FOR
n IN names[] : NONE = New_planet(n) ;
ELSE NONE
= New_planet(Name) ; .
FUNCTION Create_Sol_system ==> {Star_system}, NEW :
RESULT = {Star_system}
{Star_system} R|esulting_shortcut = RESULT
{Planet} sun|_star = R.New_planet("Sun")
...Is_star = TRUE
--------------------------------- 'inner planets'
R.Make("Mercury,Venus")
R.Make("Earth"])
PUSH R.Current_parent = R.Last :
R.Make("Moon") ;
PUSH R.Current_parent = R.New_planet("Mars") :
R.Make("Fobos,Deimos")
;
--------------------------------- 'asteroid
belt (>200km size)'
PUSH R.Current_parent = sun:
R.Make("Ceres,Vesta,Pallas,Hygiea,Interamnia,Europa,Davida,Sylvia")
R.Make("Eunomia,Euphrosyne,Cybele,Hektor,Juno,Camilla,Patientia,Banberga")
R.Make("Psyche,Thisbe,Doris,Fortuna,Themis,Amphitrite,Egeria,Elektra,Iris")
R.Make("Diotima,Aurora")
;
--------------------------------- 'Jupiter
+ satellites > 100km'
PUSH R.Current_planet = R.New_planet("Jupiter") :
R.Make("Io,Europa,Ganimede,Callisto,Himalia") ;
--------------------------------- 'Saturn
+ satellites > 100km'
PUSH R.Current_planet = R.New_planet("Saturn") :
R.Make("Prometheus,Pandora,Epimetheus,Janus")
R.Make("Mimas,Enceladus,Tethys")
R.Make("Dione,Helene,Rhea,Titan,Hyperion,Iapetus,Phoebe")
;
--------------------------------- 'Uranus
+ satellites > 100km'
PUSH R.Current_planet = R.New_planet("Uran") :
R.Make("Juliet,Portia,Miranda,Ariel,Umbriel,Titania,Oberon,Sycorax")
;
--------------------------------- 'Neptune
+ satellites > 200km'
PUSH R.Current_planet = R.New_planet("Neptune") :
R.Make("Despina,Galatea,Larissa,Proteus,Triton,Nereid")
;
--------------------------------- 'Pluto
+ all known satellites'
PUSH R.Current_planet = R.New_planet("Pluto") :
R.Make("Charon,Styx,Nix,Kerberos,Hydra")
;
--------------------------------- 'trans-pluto
> 500km only'
R.Make("Orcus,2002
XV93,2003 VS2,2007 JH43,Ixion,2004 GV9,2005 RN43")
R.Make("1995
SM55,2002 MS4,Haumea,2014 US224,2002 AW197,2014 EZ51")
R.Make("2004
XR190,2013 FY27,Sedna")
.
END
|
|
|
|