commit cd6c5af1419c035f1cda61e134ab0859b91aa0fb Author: Paul Liverman III Date: Thu Mar 7 13:15:06 2019 -0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d907c43 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.lua diff --git a/I am a piece of shit.txt b/I am a piece of shit.txt new file mode 100644 index 0000000..6692ba4 --- /dev/null +++ b/I am a piece of shit.txt @@ -0,0 +1,15 @@ +Cloaking Device +Flight Deck +Hanger +Cargo Space +Maintenance Supplies +Medbay +Sickbay +Engineering Section +Main Engineering +Medical Hall +Hospital Section +Cryogenic Storage System +Cryogenic Transport Module +Terraforming Module +Habitat diff --git a/ideas.notes.txt b/ideas.notes.txt new file mode 100644 index 0000000..2c3e09e --- /dev/null +++ b/ideas.notes.txt @@ -0,0 +1,16 @@ +J3 Cloaking Device +Mk.4 Experimental Ventilator (that would be life support/medical) +J-class Deflector (type of shielding or engine/nav equipment) +Type B2 Coil (weapon? sensor? battery?) +Class 6 Uranium Containment System +S-Type Nuclear Generator +ECM Computer Mark 7 +"Intrepid" Warp Manifold +Kelvin-class Reactor +"Machinator" Destructor +AK-Type Radio Sensor +Type Yg Thermal Radiation Disperser +Insulator #423-J +Metallic Compound 7 (armor) + +Use a more broad form of generator, then assign properties based on their name. diff --git a/src/main.moon b/src/main.moon new file mode 100644 index 0000000..bbf7ea8 --- /dev/null +++ b/src/main.moon @@ -0,0 +1,149 @@ +G = {} +G.split = (str, pattern=".") -> + tab = {} + for i in string.gmatch str, pattern + table.insert tab, i + tab + +grammar = { + brand: { "Intrepid", "Chakra", "Kelvin", "Lotus", "Sovereign", "Chad" } + numeral: { "{digit}", "{digit}{digit}", "{digit}{digit}{digit}" } + Seq: { "{capital}", "{capital}{capital}", "{capital}{letter}", "{capital}{digit}" } + seq: { "{Seq}", "{numeral}" } + mark_: { "Mk.", "Mark ", "Class ", "Type " } + _mark: { "-class", "-Type" } + unique: { + "{Seq}" + "{Seq}{_mark}" + "{mark_}{seq}" + "{brand}{_mark}" + "\"{brand}\"" + "\#{numeral}" + "\#{numeral}-{capital}" + "\#{numeral}-{letter}" + } + + sensor_: { + "Geometric", "Geographic", "Planteoid", "Surface", "Heat", "Thermal", + "Energy", "Higgs", "Gravity", "G", "Boson", "EM", "Electronic", "Dust", + "Electromagnetic", "Mag", "Radio", "Microwave", "UV", "Infrared", "Gas", + } + _sensor: { "Detector", "Sensor", "Scanner" } + sensor: { "Magnometer", "{sensor_}{_sensor}", "Spectrometer" } + + fn_: { + "Cloaking", "Medical", "Ventilation", "Warp", "Containment"--, "Charge" + } + -- _device: { "Device" } + auto: { "Automated", "Automatic", "Computerized" } + adj_: { + "Nuclear", "Experimental", "Augmented", "Emergency", "Active"--, "{auto}" + "Main", "Hardened", "Battle", "Support", "Secondary", "Backup"--, "Lithium" + } + _fn: { + "Generator", "Thruster", "Deflector", "Shield"--, "Hospital", "Infirmary", + "Reactor", "Charger", "Battery", "Capacitor" + } + _suffix: { + "Bay", "Module", "Deck", "Section", "Hall"--, "System" + } + ship: { "Fighter", "Shuttle", "Ship", "Craft", "Parasite", "Pod" } + content_: { + "Uranium", "Radioactive", "Fuel", "Thorium", "Hydrogen", "Helium", + "Deuterium", "Oxygen", "Lithium", "Metallic" + } + item: { "Coil", "Manifold", "Compound" } +} + + +classes = { + Supply, Colonization, Support, Manufacture, Offense, Command, Recon +} +-- old system had module prefixes and suffixes + + ECM Computer # + # Destructor + # # Radiation Disperser + Insulator # + + "hanger suffix": { "Hanger", G.unpack "module suffix" } + "{hanger prefix} {hanger suffix}" + "{module prefix} {hanger prefix} {hanger suffix}" + } + } + + "sickbay prefix": { "Medical", "Hospital", "Infirmary" } + "sickbay": { + props: { support: true } + blacklist: { "Hospital Facility", "Infirmary Facility"} + { + "Sickbay": 0.05 + "{sickbay prefix} {module suffix}" + "{module prefix} Sickbay": 0.05 + "{module prefix} {sickbay prefix} {module suffix}" + "{module prefix} Infirmary" + "{module prefix} Hospital" + } + } + + "engineering": { + props: { support: true } + "Engineering {module suffix}", "Maintenance {module suffix}", + "{module prefix} Engineering", "{module prefix} Maintenance {module suffix}" + } + + "tankage": { + "Fuel Tank", "{module prefix} Fuel Tank" + } + + "cargo": { + "Cargo {module suffix}", "Cargo Handling {module suffix}", + "{module prefix} Cargo {module suffix}" + } + + "quarters prefix": { "Troop Transport", "Troop Quarters", "Crew Quarters", "Cryogenic" } + "quarters": { + props: { supply: true, colonization: true } + "{quarters prefix}": 0.1 + "{quarters prefix} {module suffix}" + "Troop {module suffix}", "{module prefix} Troop {module suffix}" + "{module prefix} Transport", "Transport {module suffix}" + "{module prefix} {quarters prefix}" + "{module prefix} Crew {module suffix}" + "Crew {module suffix}" + } + + "magazine type": { "Missile", "Ballistic", "Shell" } + "magazine": { + "{magazine type} Magazine", "{module prefix} Magazine" + "{module prefix} {magazine type} Magazine" + "Magazine {module suffix}", "{module prefix} Magazine {module suffix}" + "{module prefix} {magazine type} Magazine {module suffix}" + } + + "geosensor": { + props: { colonization: true, scouting: true } + "{geosensor type} Sensor", "{geosensor type} Sensor {module suffix}" + "{module prefix} {geosensor type} Sensor" + "{module prefix} {geosensor type} Sensor {module suffix}" + } + + "terraforming": { + props: { colonization: true } + "Terraforming {module suffix}" + "{module prefix} Terraforming {module suffix}" + "Terraforming System": 0.05 + "Terraforming Systems {module suffix}" + "Atmospheric Processing {module suffix}" + "Atmospheric Processing System": 0.05 + "Atmospheric Processor" + } + + -- continue: cloak, c&c, etc + + -- these generics should be available built-ins + "letter": G.split "abcdefghijklmnopqrstuvwxyz" + "capital": G.split "abcdefghijklmnopqrstuvwxyz"\upper! + digit: G.split "0123456789" + symbol: "!@#$%^&*()_+-=[]{}\\|~`'\";:<>,./?" +} diff --git a/src/original.moon b/src/original.moon new file mode 100644 index 0000000..331aaac --- /dev/null +++ b/src/original.moon @@ -0,0 +1,134 @@ +G = {} +G.split = (str, pattern=".") -> + tab = {} + for i in string.gmatch str, pattern + table.insert tab, i + tab + +local grammar +grammar = { + "module prefix": { "Automated", "Emergency", "Advanced", "Main", "Hardened" } + "module suffix": { "Bay", "Deck", "Module", "Facility", "Section" } + + "hanger prefix": { "Hanger", "Flight", "Parasite", "Fighter", "Ship", "Craft", "Shuttle" } + "hanger suffix": { "Hanger", G.unpack "module suffix" } + "hanger": { + props: { support: true } -- depending on mode, either requires this or sets this + -- TODO replace these w a default blacklist removing duplicated words + blacklist: { "Hanger Hanger", "Module Module" } -- if appears anywhere in results, it will be regenerated + { -- assigning individual probabilities (numbered keys are divided among remaining probability) + "{hanger prefix} {hanger suffix}" + "{hanger prefix} {hanger suffix} Module": 0.05 + "{hanger prefix} Module" + "{module prefix} {hanger prefix} {hanger suffix}" + "{module prefix} {hanger prefix} {hanger suffix} Module": 0.05 + "{module prefix} {hanger prefix} Module" + } + } + + "sickbay prefix": { "Medical", "Hospital", "Infirmary" } + "sickbay": { + props: { support: true } + blacklist: { "Hospital Facility", "Infirmary Facility"} + { + "Sickbay": 0.05 + "{sickbay prefix} {module suffix}" + "{module prefix} Sickbay": 0.05 + "{module prefix} {sickbay prefix} {module suffix}" + "{module prefix} Infirmary" + "{module prefix} Hospital" + } + } + + "engineering": { + props: { support: true } + "Engineering {module suffix}", "Maintenance {module suffix}", + "{module prefix} Engineering", "{module prefix} Maintenance {module suffix}" + } + + "tankage": { + props: { supply: true } + "Fuel Tank", "{module prefix} Fuel Tank" + } + + "cargo": { + props: { supply: true } + "Cargo {module suffix}", "Cargo Handling {module suffix}", + "{module prefix} Cargo {module suffix}" + } + + "quarters prefix": { "Troop Transport", "Troop Quarters", "Crew Quarters", "Cryogenic" } + "quarters": { + props: { supply: true, colonization: true } + "{quarters prefix}": 0.1 + "{quarters prefix} {module suffix}" + "Troop {module suffix}", "{module prefix} Troop {module suffix}" + "{module prefix} Transport", "Transport {module suffix}" + "{module prefix} {quarters prefix}" + "{module prefix} Crew {module suffix}" + "Crew {module suffix}" + } + + "magazine type": { "Missile", "Ballistic", "Shell" } + "magazine": { + props: { supply: true } + "{magazine type} Magazine", "{module prefix} Magazine" + "{module prefix} {magazine type} Magazine" + "Magazine {module suffix}", "{module prefix} Magazine {module suffix}" + "{module prefix} {magazine type} Magazine {module suffix}" + } + + "geosensor type": { "Geometric", "Geographic", "Planteoid", "Surface" } + "geosensor": { + props: { colonization: true, scouting: true } + "{geosensor type} Sensor", "{geosensor type} Sensor {module suffix}" + "{module prefix} {geosensor type} Sensor" + "{module prefix} {geosensor type} Sensor {module suffix}" + } + + "terraforming": { + props: { colonization: true } + "Terraforming {module suffix}" + "{module prefix} Terraforming {module suffix}" + "Terraforming System": 0.05 + "Terraforming Systems {module suffix}" + "Atmospheric Processing {module suffix}" + "Atmospheric Processing System": 0.05 + "Atmospheric Processor" + } + + "thermal words": { "Heat", "Thermal", "Energy" } + "thermalsensor": { + props: { scouting: true } + "{thermal words} Sensor" + "{thermal words} Sensor {module suffix}" + "{module prefix} {thermal words} Sensor" + "{module prefix} {thermal words} Sensor {module suffix}" + } + + "gravity words": { "Higgs", "Gravity", "G", "Boson" } + "gravsensor": { + props: {scouting: true } + "{gravity words} Sensor" + "{gravity words} Sensor {module suffix}" + "{module prefix} {gravity words} Sensor" + "{module prefix} {gravity words} Sensor {module suffix}" + } + + "em words": { "EM", "Electronic", "Electromagnetic", "Mag" } + "emsensor": { + props: { scouting: true } + "{em words} Sensor" + "{em words} Sensor {module suffix}" + "{module prefix} {em words} Sensor" + "{module prefix} {em words} Sensor {module suffix}" + } + + -- continue: cloak, c&c, etc + + -- these generics should be available built-ins + "letter": G.split "abcdefghijklmnopqrstuvwxyz" + "capital": G.split "abcdefghijklmnopqrstuvwxyz"\upper! + digit: G.split "0123456789" + symbol: "!@#$%^&*()_+-=[]{}\\|~`'\";:<>,./?" +}