Advertisement
MAKS_Enjoyer

I have been sentenced to life in prison for killing 450 civilians (in Minecraft)

Dec 15th, 2022 (edited)
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 79.42 KB | Cybersecurity | 0 0
  1. # coding=windows-1252
  2. import os
  3. import math
  4. import random
  5. import shutil
  6. import string
  7. import subprocess
  8. from typing import List, Any
  9. import customtkinter
  10. from os.path import exists as file_exists
  11. count = 2
  12. filelogging = True
  13. blue = "#0000FF"
  14. gray = "#C8C8C8"
  15. black = "#000000"
  16. white = "#FFFFFF"
  17. dark_gray = "#141414"
  18. light_blue = "#B4DDFF"
  19. darker_gray = "#A5A4A5"
  20. customtkinter.set_appearance_mode("Dark")
  21. customtkinter.set_default_color_theme("blue")
  22. customtkinter.set_widget_scaling(0.8)
  23. def open_input_dialog_event():
  24.     global count
  25.     global filelogging
  26.     #dialog = customtkinter.CTkInputDialog(text="Type in a number:", title="CTkInputDialog")
  27.     #print("CTkInputDialog:", dialog.get_input())
  28.     if type(count%2) != 0:
  29.         print(count%2)
  30.         filelogging = False
  31.     else: filelogging = True
  32.     count = count + 1
  33.     #return dialog.get_input()
  34. def MS(strings, tbc):
  35.     IsThere = False
  36.     for s in strings:
  37.         if strings[strings.index(s)] == tbc:
  38.             IsThere = True
  39.             break
  40.     return IsThere
  41. def rN(add, maxV):
  42.     return add + random.randint(0, maxV)
  43. def rando(array):
  44.     random.shuffle(array)
  45.     return random.choice(array)
  46. def split(txt, sep):
  47.     return txt.split(sep)
  48. def findex(array, search):
  49.     return array.index(search)
  50. def NumFormat(num):
  51.     return format(int(num), ",")
  52. def random_code():
  53.     def nameGen():
  54.         engine_Name1 = ["\"Argosy\"", "\"Galileo\"", "\"Callisto\"", "\"Nauka\"", "\"Insider\"", "\"Granis\"","\"Cercozoa\"",
  55.                         "\"Rassvet\"", "\"Zvezda\"", "\"Zarya\"", "\"Orion\"", "\"Ares\"", "\"Delta\"", "\"Atlas\"","\"Dreadnought\"",
  56.                         "\"Daedalus\"", "\"Baltia\"", "\"Dizhou\"", "\"Hermes\"", "\"Icarus\"", "\"Connestoga\"","\"Yupiter\"",
  57.                         "\"Emphasis\"", "\"Olympus\"", "\"Kronos\"", "\"Helios\"", "\"Alabaster\"", "\"Falcon\"","\"Saturn\"",
  58.                         "\"Eagle\"", "\"Endeavour\"", "\"Atlantis\"", "\"Cygnus\"", "\"Apollo\"", "\"Horizon\"","\"Bulava\"",
  59.                         "\"Pioneer\"", "\"Voyager\"", "\"Exploration\"", "\"Expedition\"", "\"Vulcan\"", "\"Vysota\"","\"Aspin\"",
  60.                         "\"Federation\"", "\"Sojourner\"", "\"Nautilus\"", "\"Jubilance\"", "\"Lagrange\"", "\"Volna\"",
  61.                         "\"Prometheus\"", "\"Tellus\"", "\"Alpha\"", "\"Delta\"", "\"Proton\"", "\"Neutron\"","\"Topol\"",
  62.                         "\"Electron\"", "\"Pluton\"", "\"Poodle\"", "\"Skipper\"", "\"Convair\"", "\"Nexus\"","\"Oko\"",
  63.                         "\"Vector\"", "\"Terrier\"", "\"Rhino\"", "\"Panther\"", "\"Goliath\"", "\"Juno\"", "\"Shrimp\"",
  64.                         "\"Thumper\"", "\"Mainsail\"", "\"Dart\"", "\"Twitch\"", "\"Stratus\"", "\"Oscar\"", "\"Kosmos\"",
  65.                         "\"Sentinel\"", "\"Pegasus\"", "\"Kelus\"", "\"Starshot\"", "\"Vernor\"", "\"Mammoth\"", "\"Liberty\"",
  66.                         "\"Douglas\"", "\"Heimdall\"", "\"Dynetics\"", "\"Pathfinder\"", "\"Horizon\"", "\"Poisk\"", "\"Cryptomonada",
  67.                         "\"Pirs\"", "\"Philae\"", "\"Mariner\"", "\"Centaur\"", "\"Orel\"", "\"Pratt\"", "\"Hyperion\"",
  68.                         "\"Sagittarius\"", "\"Apollo\"", "\"Bryton\"", "\"Volga\"", "\"Harmony\"", "\"Cassini\"", "\"Contour\"",
  69.                         "\"Altair\"", "\"Dream\"", "\"Baikal\"", "\"Zenith\"", "\"Urpinod\"", "\"Bernal\"", "\"Condor\"",
  70.                         "\"Athena\"", "\"Astra\"", "\"Aerolus\"", "\"Rombus\"", "\"Lunokhod\"", "\"Fregat\"", "\"Glonass\"",
  71.                         "\"Dragon\"", "\"Salyut\"", "\"Starliner\"", "\"Skylab\"", "\"Briz\"", "\"Colombus\"", "\"Rosetta\"",
  72.                         "\"Redstone\"", "\"Antares\"", "\"Philae\"", "\"Prospero\"", "\"Leonardo\"", "\"Parker\"", "\"Dyson\"",
  73.                         "\"Oberon\"", "\"DragonFly\"", "\"Energia\"", "\"Buran\"", "\"Urgan\"", "\"Angara\"", "\"Vostok\"",
  74.                         "\"Voskhod\"", "\"Shenzhou\"", "\"Ingenuity\"", "\"Oberon\"", "\"Discovery\"", "\"Horizon\"", "\"Visionalis\"",
  75.                         "\"Cerasus\"", "\"Progress\"", "\"Unity\"", "\"Surveyor\"", "\"Prospector\"", "\"Ikar\"", "\"Redstone\"",
  76.                         "\"Lapis\"", "\"Caesius\"", "\"Iridium\"", "\"Daedlus\"", "\"Aelita\"", "\"Beta\"", "\"Gamma\"","\"Filosa\"",
  77.                         "\"Alpha\"", "\"Epsilon\"", "\"Omega\"", "\"Discoverer\"", "\"Explorer\"", "\"Hornet\"","\"Serenity\"",
  78.                         "\"Ariane\"", "\"Hornet\"", "\"Asimov\"", "\"Pegasus\"", "\"Venture\"", "\"Antares\"", "\"Star\"",
  79.                         "\"Archimedes\"", "\"Hera\"", "\"Iris\"", "\"Titan\"", "\"Artemis\"", "\"Phoenix\"", "\"Ross\"", "\"Heliozoa\""
  80.                         "\"Sarychev\"", "\"Nemesis\"", "\"Heimdall\"", "\"Sturt\"", "\"Odin\"", "\"Aethelred\"", "\"Vesper\"",
  81.                         "\"Aces\"", "\"Argon\"", "\"Olympia\"", "\"Perseus\"", "\"Chyron\"", "\"Proxima\"", "\"Arminus\"",
  82.                         "\"Destiny\"", "\"Valient\"", "\"FireFly\"", "\"Obsidian\"", "\"Leviathan\"", "\"Magellan\"", "\"Voyager\"",
  83.                         "\"Mariner\"", "\"Joist\"", "\"Crimson\"", "\"Fortune\"", "\"Vanguard\"", "\"Aurora\"", "\"Ulysses\"",
  84.                         "\"Crusader\"", "\"Python\"", "\"Kuiper\"", "\"Insurgent\"", "\"Pathfinder\"", "\"Kvant\"", "\"Spektr\"",
  85.                         "\"Cassini\"", "\"Zemlya\"", "\"Dawn\"", "\"Kepler\"", "\"Parom\"", "\"Elektron\"", "\"Aeonian\"",
  86.                         "\"Node\"", "\"Burya\"", "\"Voyager\"", "\"Ceres\"", "\"Bayern\"", "\"Chasovoy\"", "\"Copernicus\"",
  87.                         "\"Quaoar\"", "\"Minotaur\"", "\"Agena\"", "\"Thor\"", "\"Vega\"", "\"Scout\"", "\"Coeus\"", "\"Minerva\"",
  88.                         "\"Kratos\"", "\"Neith\"", "\"Omoikane\"", "\"Gayamun\"", "\"Odin\"", "\"Kronos\"", "\"Hope\"", "\"Poles\"",
  89.                         "\"Polyot\"", "\"Sputnik\"", "\"Clementine\"", "\"Sojourner\"", "\"Ingenuity\"", "\"Perseverence\"",
  90.                         "\"Onatchesko\"", "\"Atlantis\"", "\"Tsyklon\"", "\"Zenit\"", "\"Almaz\"", "\"Soyuz\"", "\"Molniya\"",
  91.                         "\"Oreo\"", "\"Yantar\"", "\"Foton\"", "\"Meteor\"", "\"Ekran\"", "\"Strela\"", "\"Bion\"", "\"Piroda\"",
  92.                         "\"Salyut\"", "\"Strela\"", "\"Luch\"", "\"Potok\"", "\"Prognoz\"", "\"Orlets\"", "\"Etalon\"", "\"Astron\"",
  93.                         "\"Efir\"", "\"Kometa\"", "\"Fram\"", "\"Zemlya\"", "\"Gorizont\"", "\"Arkon\"", "\"Gamma\"", "\"Ekspress\"",
  94.                         "\"Gonets\"", "\"Taifun\"", "\"Okean\"", "\"Reflektor\"", "\"Kolibr\"", "\"Sever\"", "\"Comet\"", "\"Peewee\""
  95.                         "\"Roton\"", "\"Solaris\"", "\"Altaris\"", "\"Ithacus\"", "\"Dekto\"", "\"Dream\"", "\"Impuls\"",
  96.                         "\"Aves\"", "\"Vremya\"", "\"Portal\"", "\"Zodiak\"", "\"Slava\"", "\"Inertsiya\"", "\"Stimuls\"",
  97.                         "\"Ambross\"","\"Amal\"", "\"Thea\"", "\"Orphelia\"", "\"Polyot\"", "\"Mudrost\"", "\"Carrack\"", "\"Artak\"","\"Anapsida\""
  98.                         "\"Questar\"", "\"Artyom\"", "\"Tsyclon\"", "\"Ascension\"", "\"Tenacity\"", "\"Contour\"","\"Zephyr\"",
  99.                         "\"Atlanta\"", "\"Polaris\"", "\"Aeolus\"", "\"Mayak\"", "\"Pamir\"", "\"Taimyr\"","\"Cheget\"","\"Sirius\"",
  100.                         "\"Uragan\"", "\"Agat\"", "\"Skiph\"", "\"Kristall\"", "\"Altair\"", "\"Uran\"", "\"Ingul\"","\"Carat\"",
  101.                         "\"Pulsar\"", "\"Titan\"", "\"Eridanus\"", "\"Parus\"", "\"Cepheus\"", "\"Varagian\"","\"Olympus\"",
  102.                         "\"Tarkhaniy\"", "\"Astraeus\"", "\"Antares\"", "\"Kazbek\"", "\"Burlak\"", "\"Borei\"","\"Favor\"",
  103.                         "\"Rubin\"", "\"Almaz\"", "\"Granit\"", "\"Ruby\"", "\"Sokol\"", "\"Argon\"", "\"Kavkaz\"","\"Ural\"",
  104.                         "\"Berkut\"", "\"Dunay\"", "\"Yastreb\"", "\"Terek\"", "\"Radon\"", "\"Taymyr\"", "\"Pamir\"","\"Photon\"",
  105.                         "\"Elbrus\"", "\"Isayiev\"", "\"Shmel\"", "\"Kobra\"", "\"Shturn\"", "\"Metis\"","\"Malyutka\"","\"Fleyta\"",
  106.                         "\"Konkurs\"", "\"Bastion\"", "\"Svir\"", "\"Ataka\"", "\"Vodopad\"", "\"Veter\"", "\"Vyuga\"","\"Vulga\"",
  107.                         "\"Tochka\"", "\"Oka\"", "\"Dvina\"", "\"Almaz\"", "\"Araks\"", "\"Kanopus\"", "\"Kliper\"","\"Kobalt\"",
  108.                         "\"Siluet\"", "\"Kondor\"", "\"Lotos\"", "\"Luch\"", "\"Mir\"", "\"Neman\"", "\"Obzor\"","\"Okean\"",
  109.                         "\"Oktan\"", "\"Orlets\"", "\"Poisk\"", "\"Potok\"", "\"Pirs\"", "\"Prognoz\"", "\"Resurs\"","\"Rodna\"",
  110.                         "\"Romb\"", "\"Kapustin\"", "\"Oplot\"", "\"Tsygan\"", "\"Teplokhod\"", "\"Sokosha\"","\"Rubezh\"",
  111.                         "\"Zircon\"", "\"Moskovitz\"", "\"Tryol\"", "\"Ustinov\"", "\"Belyayev\"", "\"Novgorod\"","\"Argos\"",
  112.                         "\"Nerthus\"", "\"Janus\"", "\"Hephaestus\"", "\"Themis\"", "\"Chronos\"", "\"Tethys\"","\"Minos\"",
  113.                         "\"Autumn\"", "\"Resilience\"", "\"Aelita\"", "\"Rheus\"", "\"Solntspek\"", "\"Spitzer\"","\"Cartago\"",
  114.                         "\"Melibea\"", "\"Spartacus\"", "\"Pulsar\"", "\"Fusion\"", "\"Reliant\"", "\"Thunder\"","\"Novo\"",
  115.                         "\"Panthera\"", "\"Nematoda\"", "\"Anelida\"", "\"Chordata\"", "\"Tetrapoda\"", "\"Cyclero\"","\"Carrier\"",
  116.                         "\"Gaia\"", "\"Irtysh\"", "\"Wyvern\"", "\"Tarsier\"", "\"Alpina\"", "\"Espadon\"", "\"Parlos\"","\"Nebula\"",
  117.                         "\"Lazarus\"", "\"Rufus\"", "\"Dornier\"", "\"Argus\"", "\"Kybau\"", "\"Kalau\"", "\"Chasvoy\"", "\"Zephyr\"",
  118.                         "\"Temny\"", "\"Gorizont\"", "\"Yars\"", "\"Krugazor\"", "\"Soprotivlenye\"", "\"Shtil\"","\"Layner\"",
  119.                         "\"Arthropoda\"", "\"Hexapoda\"", "\"Crustacea\"", "\"Tardigrada\"", "\"Mollusca\"","\"Annelida\"",
  120.                         "\"Bryozoa\"", "\"Rotifera", "\"Brachiopoda\"", "\"Echinodermata\"", "\"Hemichordata\"","\"Cnidaria\"",
  121.                         "\"Staurozoa\"", "\"Hydrozoa\"", "\"Porifera", "\"Placozoa\"", "\"Craniata\"", "\"Tunicata\"","\"Conodonta\"",
  122.                         "\"Tetrapoda\"", "\"Amniota\"", "\"Synapsida\"", "\"Sauropsida", "\"Mammalia\"", "\"Sarcodina\"",
  123.                         "\"Sporozoa\"", "\"Ciliata\"", "\"Toxoplasma\"", "\"Plasmodium\"", "\"Heterokonta\"", "\"Haptophyta\""]
  124.         firstPart = ["RD", "RS", "AJ", "XLR", "NK", "RL", "KDTU", "AR", "BE", "MV", "YF", "PKA", "J", "RSA", "MJ", "XS",
  125.                      "LM10", "HM", "LE", "LRE", "CE", "DST", "DOK", "KDU", "KRD", "RO", "LMS", "LMP", "RT", "F", "E",
  126.                      "A", "B", "S.10", "JDK", "SPP", "TYS", "SOK", "RES", "FWR", "NAA75", "LR", "MA", "GE", "OSA",
  127.                      "OBA",
  128.                      "NA", "RM02", "RM", "H", "MBB", "MB", "DF", "DE", "BF", "X", "BW", "BADR", "HS", "DC", "UA", "FG",
  129.                      "P", "KMV", "M", "SRMU", "V", "KVD", "JD", "PS", "CE"]
  130.         engNameFinalf = " " + rando(engine_Name1)
  131.         firstPart_f = rando(firstPart) + "-"
  132.         finalNumber = rN(12, 1098)
  133.         if finalNumber % 8 == 0:
  134.             engine_Namee = str(firstPart_f) + str(finalNumber) + str(engNameFinalf)
  135.         else:
  136.             uio93 = rN(1, 1000)
  137.             uio94 = rN(1, 12)
  138.             if uio93 % uio94 == 0:
  139.                 randomizedCharacter = random.choice(string.ascii_lowercase)
  140.                 while (randomizedCharacter == "l") or (randomizedCharacter == "o") or (randomizedCharacter == "i") or \
  141.                         (randomizedCharacter == "q") or (randomizedCharacter == "e") or (randomizedCharacter == "h") or \
  142.                         (randomizedCharacter == "g") or (randomizedCharacter == "c") or (randomizedCharacter == "j"):
  143.                     randomizedCharacter = random.choice(string.ascii_lowercase)
  144.                     if (randomizedCharacter != "l") and (randomizedCharacter != "o") and (
  145.                             randomizedCharacter != "i") and \
  146.                             (randomizedCharacter != "q") and (randomizedCharacter != "e") and (
  147.                             randomizedCharacter != "h") \
  148.                             and (randomizedCharacter != "g") and (randomizedCharacter != "c") and (
  149.                             randomizedCharacter != "j"):
  150.                         break
  151.             else:
  152.                 randomizedCharacter = random.choice(string.ascii_uppercase)
  153.                 while (randomizedCharacter == "O") or (randomizedCharacter == "I") or (randomizedCharacter == "Q"):
  154.                     randomizedCharacter = random.choice(string.ascii_uppercase)
  155.                     if (randomizedCharacter != "O") and (randomizedCharacter != "I") and (randomizedCharacter != "Q"):
  156.                         break
  157.             engine_Namee = str(firstPart_f) + str(finalNumber) + str(randomizedCharacter) + str(engNameFinalf)
  158.         return engine_Namee
  159.     def isHypergolic(OCC, FCC):
  160.         isHyper = False
  161.         match OCC:
  162.             case "N2O4 (Nitrogen Tetroxide)":
  163.                 match FCC:
  164.                     case "50% CH6N2 + 50% N2H4 (Aerosine-50)" | "75% CH6N2 + 25% N2H4 (UH-25)" | "C6H5NH2 (Aniline)" | \
  165.                          "C2H8N2 (UnsymmetricalDimethylHydrazine)" | "CH6N2 (MonomethylHydrazine)" | "N2H4 (Hydrazine)":
  166.                         isHyper = True
  167.                     case _:
  168.                         isHyper = False
  169.             case "H2O2 (Hydrogen Peroxide) 95%" | "H2O2 (Hydrogen Peroxide) 85%", "O2 (Oxygen)":
  170.                 isHyper = False
  171.             case "O3 (Ozone)" | "F2 (Fluorine)" | "F2 (Fluorine) + O2 (Oxygen)":
  172.                 isHyper = True
  173.             case "AK20F: 80% HNO3 + 20% N2O4 (Nitric Acid)" | "AK20I: 80% HNO3 + 20% N2O4 (Nitric Acid)" | \
  174.                  "AK20K: 80% HNO3 + 20% N2O4 (Nitric Acid)" | "AK27I: 73% HNO3 + 27% N2O4 (Nitric Acid)" | \
  175.                  "AK27P: 73% HNO3 + 27% N2O4 (Nitric Acid)":
  176.                 match FCC:
  177.                     case "CH6N2 (MonomethylHydrazine)" | "N2H4 (Hydrazine)":
  178.                         isHyper = True
  179.                     case _:
  180.                         isHyper = False
  181.         return isHyper
  182.     def propDataFind(fuel, oxid):
  183.         match oxid:
  184.             case "O2 (Oxygen)":
  185.                 fuel_ListSample = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  186.                                    "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)",
  187.                                    "N2H4 (Hydrazine)",
  188.                                    "CH3OH (Methanol)", "C12H26 (n-Dodecane)"]
  189.                 combustionTemps = [3304, 3379, 3314, 3167, 3657, 3020, 3399, 3275, 3214, 3526]
  190.                 mixRatios = [5.00, 2.77, 1.49, 1.29, 1.72, 1.28, 1.15, 0.74, 1.19, 2.29]
  191.                 exhaustVels = [3738, 2932, 2713, 2635, 2708, 2815, 2938, 2973, 2687, 2834]
  192.             case "F2 (Fluorine)":
  193.                 fuel_ListSample = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  194.                                    "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "C2H8N2 (UnsymmetricalDimethylHydrazine)",
  195.                                    "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)", "CH3OH (Methanol)",
  196.                                    "C12H26 (n-Dodecane)"]
  197.                 combustionTemps = [3689, -1, -1, 4344, -1, 4469, -1, -1, 4544, 4402, -1]
  198.                 mixRatios = [6.00, -1.00, -1.00, 2.26, -1.00, 2.81, -1.00, -1.00, 1.82, 2.20, -1.00]
  199.                 exhaustVels = [3925, -1, -1, 3106, -1, 3278, -1, -1, 3315, 3146, -1]
  200.             case "F2 (Fluorine) + O2 (Oxygen)":
  201.                 fuel_ListSample = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  202.                                    "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)",
  203.                                    "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  204.                                    "CH6N2 (MonomethylHydrazine)", "CH3OH (Methanol)", "C12H26 (n-Dodecane)",
  205.                                    "N2H4 (Hydrazine)"]
  206.                 combustionTemps = [-1, 4530, 4437, -1, 4517, 4584, 4575, 4583, -1, 4571, -1]
  207.                 mixRatios = [-1.00, 4.82, 2.56, -1.00, 2.41, 2.41, 2.22, 2.33, -1.00, 3.67, -1.00]
  208.                 exhaustVels = [-1, 3281, 3134, -1, 3006, 3255, 3273, 3264, -1, 3166, -1]
  209.             case "O3 (Ozone)":
  210.                 fuel_ListSample = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  211.                                    "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)",
  212.                                    "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  213.                                    "CH6N2 (MonomethylHydrazine)", "C12H26 (n-Dodecane)", "CH3OH (Methanol)",
  214.                                    "N2H4 (Hydrazine)",
  215.                                    "NH3 (Ammonia)"]
  216.                 combustionTemps = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
  217.                 mixRatios = [-1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00]
  218.                 exhaustVels = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
  219.             case "AK20F: 80% HNO3 + 20% N2O4 (Nitric Acid)" | "AK20I: 80% HNO3 + 20% N2O4 (Nitric Acid)" | \
  220.                  "AK20K: 80% HNO3 + 20% N2O4 (Nitric Acid)" | "AK27I: 73% HNO3 + 27% N2O4 (Nitric Acid)" | \
  221.                  "AK27P: 73% HNO3 + 27% N2O4 (Nitric Acid)":
  222.                 fuel_ListSample = ["H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "CH6N2 (MonomethylHydrazine)",
  223.                                    "N2H4 (Hydrazine)",
  224.                                    "CH3OH (Methanol)"]
  225.                 combustionTemps = [2795, 2905, 3033, 2932, 2824]
  226.                 mixRatios = [8.00, 2.75, 2.13, 1.28, 2.13]
  227.                 exhaustVels = [3112, 2449, 2635, 2702, 2441]
  228.             case "N2O4 (Nitrogen Tetroxide)":
  229.                 fuel_ListSample = ["H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%", "C6H5NH2 (Aniline)",
  230.                                    "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  231.                                    "C2H8N2 (UnsymmetricalDimethylHydrazine)",
  232.                                    "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)", "CH3OH (Methanol)",
  233.                                    "C12H26 (n-Dodecane)"]
  234.                 combustionTemps = [2973, 3151, 3006, 3468, 3268, 3229, 3296, 3252, 3137, 3058, 3342]
  235.                 mixRatios = [6.50, 2.26, 1.93, 2.64, 1.85, 1.59, 2.10, 1.73, 1.08, 1.78, 3.53]
  236.                 exhaustVels = [3334, 2540, 2479, 2538, 2730, 2750, 2713, 2742, 2803, 2528, 2619]
  237.             case "H2O2 (Hydrogen Peroxide) 85%":
  238.                 fuel_ListSample = ["H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%", "C6H5NH2 (Aniline)",
  239.                                    "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  240.                                    "C2H8N2 (UnsymmetricalDimethylHydrazine)",
  241.                                    "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)", "CH3OH (Methanol)",
  242.                                    "C12H26 (n-Dodecane)"]
  243.                 combustionTemps = [2544, 2552, 2447, 2719, 2681, 2668, 2690, 2681, 2630, 2511, 2666]
  244.                 mixRatios = [14.00, 4.62, 3.77, 5.95, 4.02, 3.39, 4.63, 3.76, 2.15, 3.55, 7.84]
  245.                 exhaustVels = [2882, 2476, 2425, 2495, 2592, 2604, 2582, 2600, 2642, 2464, 2530]
  246.             case "H2O2 (Hydrogen Peroxide) 95%":
  247.                 fuel_ListSample = ["H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%", "C6H5NH2 (Aniline)",
  248.                                    "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  249.                                    "C2H8N2 (UnsymmetricalDimethylHydrazine)",
  250.                                    "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)", "CH3OH (Methanol)",
  251.                                    "C12H26 (n-Dodecane)"]
  252.                 combustionTemps = [2666, 2762, 2653, 2934, 2870, 2852, 2884, 2871, 2801, 2709, 2878]
  253.                 mixRatios = [11.00, 3.97, 3.27, 4.94, 3.32, 2.82, 3.82, 3.13, 1.82, 3.06, 6.50]
  254.                 exhaustVels = [1918, 1599, 1566, 1610, 1683, 1692, 1676, 1688, 1718, 1590, 1639]
  255.         x = fuel_ListSample.index(fuel)
  256.         combust_temp = str(combustionTemps[x])
  257.         mixRatio = str(mixRatios[x])
  258.         exhaustVelF = str(exhaustVels[x])
  259.         return combust_temp + ", " + mixRatio + ", " + exhaustVelF
  260.     def NzlParameters(alt_Of_Operation):
  261.         nozzle_Type_Chosen, OExpansionRatio = "", ""
  262.         match alt_Of_Operation:
  263.             case "0-20 km (Sea Level)":
  264.                 nozzle_Type_List_SL = ["Contour Bell Nozzle", "Parabolic Bell Nozzle", "Conical Nozzle",
  265.                                        "Stepped Dual Bell Nozzle"]
  266.                 nozzle_Type_Chosen = rando(nozzle_Type_List_SL)
  267.                 if nozzle_Type_Chosen == "Conical Nozzle":
  268.                     OExpansionRatio = str(rN(10, 9)) + ":1"
  269.                 else:
  270.                     OExpansionRatio = str(rN(10, 12)) + ":1"
  271.             case "20-30 km (Medium Atmosphere)":
  272.                 nozzle_Type_List_HA = ["Contour Bell Nozzle", "Parabolic Bell Nozzle", "Stepped Dual Bell Nozzle"]
  273.                 nozzle_Type_Chosen = rando(nozzle_Type_List_HA)
  274.                 OExpansionRatio = str(rN(32, 14)) + ":1"
  275.             case "30-80 km (High Atmosphere)":
  276.                 nozzle_Type_List_HAi = ["Contour Bell Nozzle", "Parabolic Bell Nozzle", "Stepped Dual Bell Nozzle"]
  277.                 nozzle_Type_Chosen = rando(nozzle_Type_List_HAi)
  278.                 OExpansionRatio = str(rN(47, 43)) + ":1"
  279.             case "80 km+ (Vacuum)":
  280.                 nozzle_Type_List_VA = ["Contour Bell Nozzle", "Parabolic Bell Nozzle", "Expanding Nozzle"]
  281.                 nozzle_Type_Chosen = rando(nozzle_Type_List_VA)
  282.                 OExpansionRatio = str(rN(90, 110)) + ":1"
  283.             case "Any Altitude (0-80 km+)":
  284.                 nozzle_Type_List_Aero = ["Linear Aerospike Nozzle", "Toroidal Aerospike Nozzle",
  285.                                          "Stepped Dual Bell Nozzle"]
  286.                 nozzle_Type_Chosen = rando(nozzle_Type_List_Aero)
  287.                 if nozzle_Type_Chosen == "Stepped Dual Bell Nozzle":
  288.                     OExpansionRatio = str(rN(10, 9)) + ":1"
  289.                 else:
  290.                     OExpansionRatio = "None (Nozzle doesnt have a throat)"
  291.         return nozzle_Type_Chosen + ", " + OExpansionRatio
  292.     def StndrdDet(eng_Name, eng_Cycle, oxid_C, fuel_C, tank_RepressA, alt_Operation):
  293.         Eng_Data = split(propDataFind(fuel_C, oxid_C), ", ")
  294.         f_regen, propProperties, F_gimbalangle, chamberN = "", "", "", ""
  295.         combust_temp, mixRatio, exhaustVelFinal = Eng_Data[0], Eng_Data[1], Eng_Data[2]
  296.         tank_Repress = rando(tank_RepressA)
  297.  
  298.         Operational_Alt = rando(alt_Operation)
  299.         NzlData = split(NzlParameters(Operational_Alt), ", ")
  300.         nozzle_Type_Chosen, AR_exit = NzlData[0], NzlData[1]
  301.         isHyp = isHypergolic(oxid_C, fuel_C)
  302.         isCryo = isCryogenic(oxid_C, fuel_C)
  303.         purp = uses(isHypergolic, isCryogenic, Operational_Alt, eng_Cycle)
  304.         search_for = ["Upper", "Payload", "Space"]
  305.  
  306.         if isCryo and isHyp:
  307.             propProperties = "Hypergolic and cryogenic"
  308.         elif isCryo and not isHyp:
  309.             propProperties = "Not Hypergolic but cryogenic"
  310.         elif not isCryo and isHyp:
  311.             propProperties = "Hypergolic but not cryogenic"
  312.         else:
  313.             propProperties = "Neither Hypergolic nor cryogenic"
  314.  
  315.         uio96, uio97 = rN(1, 999), rN(1, 11)
  316.         if uio96 % uio97 == 0:
  317.             Throttle_MinV, Throttle_MaxV = rN(1, 90), rN(100, 5)
  318.             ThrottleRange = str(Throttle_MinV) + "-" + str(Throttle_MaxV) + "%"
  319.         else:
  320.             ThrottleRange = "Not Throttleable"
  321.  
  322.         longDur = MS(search_for, purp)
  323.         if longDur:
  324.             cooling_mechanismA = ["Radiative Cooling", "Dump Cooling", "Film Cooling", "Regenerative Cooling",
  325.                                   "Transpiration Cooling"]
  326.         else:
  327.             cooling_mechanismA = ["Ablative Cooling", "Radiative Cooling", "Dump Cooling", "Film Cooling",
  328.                                   "Regenerative Cooling", "Transpiration Cooling"]
  329.         cooling_Mechanism_Chosen = rando(cooling_mechanismA)
  330.         if cooling_Mechanism_Chosen == "Regenerative Cooling":
  331.             f_regen = "Oxidizer "
  332.  
  333.         if purp in "Vernier":
  334.             gimbalangle = rN(0, 30)
  335.             if not gimbalangle >= 1 or alt_Operation == "80 km+ (Vacuum)":
  336.                 F_gimbalangle = "None"
  337.             else:
  338.                 F_gimbalangle = "±" + gimbalangle + "°"
  339.         elif purp in "Course Correction" and not purp in "Lower Stage":
  340.             F_gimbalangle = "None"
  341.         else:
  342.             gimbalangle = rN(0, 10)
  343.             if not gimbalangle >= 1 or alt_Operation == "80 km+ (Vacuum)":
  344.                 F_gimbalangle = "None"
  345.             else:
  346.                 F_gimbalangle = "±" + str(gimbalangle) + "°"
  347.  
  348.         chambers = rN(1, 2)
  349.         if chambers == 1 or nozzle_Type_Chosen in "Aerospike":
  350.             chamberN = "Single Chamber"
  351.         elif chambers == 2:
  352.             chamberN = "Dual Chamber"
  353.         elif chambers == 3:
  354.             chamberN = "Quadruple Chamber"
  355.  
  356.         cooling_Mechanism_C = f_regen + cooling_Mechanism_Chosen
  357.         injector = Injector(cooling_Mechanism_C, eng_Cycle)
  358.         output = output_def(eng_Name, eng_Cycle, oxid_C, fuel_C, Operational_Alt, nozzle_Type_Chosen, tank_Repress,
  359.                    cooling_Mechanism_C, propProperties, purp, injector, AR_exit, combust_temp, mixRatio,
  360.                    exhaustVelFinal, ThrottleRange, chamberN, F_gimbalangle)
  361.         return output
  362.     def isCryogenic(oxidizer_chosen, fuel_chosen):
  363.         isCryo = False
  364.         match oxidizer_chosen:
  365.             case "O3 (Ozone)" | "F2 (Fluorine)" | "F2 (Fluorine) + O2 (Oxygen)" | "O2 (Oxygen)": isCryo = True
  366.         match fuel_chosen:
  367.             case "CH3OH (Methanol)" | "C12H26 (n-Dodecane)" | "H2 (Hydrogen)" | "C2H5OH(Ethanol) 95%" | "C2H5OH(Ethanol) 75%" | \
  368.                  "NH3 (Ammonia)" | "CH4 (Methane)": isCryo = True
  369.         return isCryo
  370.     def uses(isHypergol, isCryogen, alt, En_Cycle):
  371.         compleX = False
  372.         if En_Cycle.upper == "Combustion Tap" or En_Cycle.upper == "Staged" or En_Cycle.upper == "Full Flow":
  373.             compleX = True
  374.         if alt == "0-20 km (Sea Level)" or alt == "20-30 km (Medium Atmosphere)":
  375.             if compleX:
  376.                 pot_usesA = ["Lower Stage (Main Propulsion)"]
  377.             else:
  378.                 pot_usesA = ["Lower Stage (Main Propulsion)", "Lower Stage (Course Correction)",
  379.                              "Lower Stage (Vernier)"]
  380.             useA = rando(pot_usesA)
  381.         elif alt == "30-80 km (High Atmosphere)" or alt == "80 km+ (Vacuum)":
  382.             if isHypergol and isCryogen:
  383.                 if compleX:
  384.                     pot_usesA = ["Upper Stage (Main Propulsion)"]
  385.                 else:
  386.                     pot_usesA = ["Upper Stage(Main Propulsion)", "Upper Stage(Course Correction)",
  387.                                  "Upper Stage(Vernier)",
  388.                                  "Upper Stage (Ullage)", "Payload (Main Propulsion)", "Payload (ACS)"]
  389.                 useA = rando(pot_usesA)
  390.             elif not isHypergol and isCryogen:
  391.                 if compleX:
  392.                     pot_usesA = ["Upper Stage (Main Propulsion)"]
  393.                 else:
  394.                     pot_usesA = ["Upper Stage (Main Propulsion)", "Upper Stage (Vernier)"]
  395.                 useA = rando(pot_usesA)
  396.             elif isHypergol and not isCryogen:
  397.                 if compleX:
  398.                     pot_usesA = ["Upper Stage(Main Propulsion)", "Payload (Main Propulsion)",
  399.                                  "Space Tug (Main Propulsion)"]
  400.                 else:
  401.                     pot_usesA = ["Upper Stage(Main Propulsion)", "Upper Stage(Course Correction)",
  402.                                  "Upper Stage(Vernier)",
  403.                                  "Upper Stage (Ullage)", "Payload (Main Propulsion)", "Payload (ACS)",
  404.                                  "Payload (Course Correction)",
  405.                                  "Payload (Vernier)", "Space Tug (Main Propulsion)", "Space Tug (Course Correction)",
  406.                                  "Space Tug (Vernier)", "Space Tug (Ullage)"]
  407.                 useA = rando(pot_usesA)
  408.         else:
  409.             pot_usesA = ["Lower Stage (Main Propulsion)", "Upper Stage(Main Propulsion)", "Payload (Main Propulsion)"]
  410.             useA = rando(pot_usesA)
  411.         return useA
  412.     def Injector(cooling_Mechanism, engine_Cycle_Chose):
  413.         fuel_state = "Liquid"
  414.         if cooling_Mechanism in "Regenerative Cooling" or engine_Cycle_Chose in "Expander":
  415.             fuel_state = "Gas"
  416.         injector = ["Showerhead Injector", "Self-impinging Injector", "Cross-impinging Injector", "Swirl Injector",
  417.                     "Pintle Injector"]
  418.         return fuel_state + " " + rando(injector)
  419.     def output_monod(ENN, ECC, AOOC, PLC, NTLC, CMC, CCC, purposeB):
  420.         output = [f"Engine Designation: {ENN}", f"Fuel Flow Cycle: {ECC}", f"Propellant: {PLC}", f"Altitude Of Operation: {AOOC}",
  421.                   f"Exhaust Nozzle Geometry: {NTLC}", f"Engine Use Case: {purposeB}", f"Nozzle Cooling Mechanism: {CMC}",
  422.                   f"Propellant catalyst: {CCC}"]
  423.         if filelogging:
  424.             file = open("./GenFiles/GenData/obf_rex.txt", "at")
  425.             file.write(f"\n\nEngine Designation: {ENN}\n")
  426.             file.write(f"Fuel Flow Cycle: {ECC}\n")
  427.             file.write(f"Propellant: {PLC}\n")
  428.             file.write(f"Altitude Of Operation: {AOOC}\n")
  429.             file.write(f"Exhaust Nozzle Geometry: {NTLC}\n")
  430.             file.write(f"Engine Use Case: {purposeB}\n")
  431.             file.write(f"Nozzle Cooling Mechanism: {CMC}\n")
  432.             file.write(f"Propellant catalyst: {CCC}")
  433.             file.close()
  434.         return output
  435.     def output_mono(ENN, ECC, AOOC, PLC, NTLC, CMC, purposeE):
  436.         output = [f"Engine Designation: {ENN}", f"Fuel Flow Cycle: {ECC}", f"Propellant: {PLC}",
  437.                   f"Altitude Of Operation: {AOOC}", f"Exhaust Nozzle Geometry: {NTLC}",
  438.                   f"Engine Use Case: {purposeE}", f"Nozzle Cooling Mechanism: {CMC}"]
  439.         if filelogging:
  440.             file = open("./GenFiles/GenData/obf_rex.txt", "at")
  441.             file.write(f"\n\nEngine Designation: {ENN}\n")
  442.             file.write(f"Fuel Flow Cycle: {ECC}\n")
  443.             file.write(f"Propellant: {PLC}\n")
  444.             file.write(f"Altitude Of Operation: {AOOC}\n")
  445.             file.write(f"Exhaust Nozzle Geometry: {NTLC}\n")
  446.             file.write(f"Engine Use Case: {purposeE}\n")
  447.             file.write(f"Nozzle Cooling Mechanism: {CMC}")
  448.             file.close()
  449.         return output
  450.     def output_et(ENN, ECC, AOOC, PLC, NTLC, PGLC, purposeE, pwr):
  451.         output = [f"Engine Designation: {ENN}", f"Fuel Flow Cycle: {ECC}", f"Propellant(Remass): {PLC}",
  452.                   f"Altitude Of Operation: {AOOC}", f"Exhaust Nozzle Geometry: {NTLC}",
  453.                   f"Engine Use Case: {purposeE}", f"Engine Power Source: {PGLC}", f"Rated Power Level: {pwr}"]
  454.         if filelogging:
  455.             file = open("./GenFiles/GenData/obf_rex.txt", "at")
  456.             file.write(f"\n\nEngine Designation: {ENN}\n")
  457.             file.write(f"Fuel Flow Cycle: {ECC}\n")
  458.             file.write(f"Propellant(Remass): {PLC}\n")
  459.             file.write(f"Altitude Of Operation: {AOOC}\n")
  460.             file.write(f"Exhaust Nozzle Geometry: {NTLC}\n")
  461.             file.write(f"Engine Use Case: {purposeE}\n")
  462.             file.write(f"Engine Power Source: {PGLC}\n")
  463.             file.write(f"Rated Power Level: {pwr}")
  464.             file.close()
  465.         return output
  466.     def output_nt(ENN, ECC, AOOC, NCC, PLC, RFC, NTLC, EEV, TRC, CMC, purposeF, react_gen, bimodal, ERC, PRS, ARR, ECT):
  467.         MaxElecP = NumFormat((ECT / 100) * 18)
  468.         MaxP = NumFormat(((ECT / 90) * 100) / 1000)
  469.         output = [f"Engine Designation: {ENN}"]
  470.         if not ECC == "Nuclear SaltWater" and not ECC == "Radioisotope Engine" and not NCC == "":
  471.             output.append(f"Fuel Flow Cycle: {NCC} {ECC}")
  472.         else:
  473.             output.append(f"Fuel Flow Cycle: {ECC}")
  474.         output.append(f"Propellant (Remass): {PLC}")
  475.         output.append(f"Propellant State: {PRS}")
  476.         output.append(f"Reactor Generation: {react_gen}")
  477.         output.append(f"Reactor Maximum Power: {MaxP} GW")
  478.         output.append(f"Reactor Fuel Material: {RFC}")
  479.         if NCC == "LANTR":
  480.             output.append(f"Engine Exhaust Velocity: ({NumFormat(EEV)}/~3850) m/s")
  481.         else:
  482.             output.append(f"Engine Exhaust Velocity: {NumFormat(EEV)} m/s")
  483.         output.append(f"Reactor Core Temperature: {NumFormat(ECT)}°K")
  484.         output.append(f"Reactor Coolant: {ERC}")
  485.         if not bimodal or ECC == "Nuclear SaltWater":
  486.             output.append(f"Engine Bimodality: Engine isn't bimodal")
  487.             output.append(f"Engine Electrical Output: None")
  488.         else:
  489.             output.append(f"Engine Bimodality: Engine is bimodal")
  490.             output.append(f"Engine Electrical Output: {MaxElecP} MW")
  491.         output.append(f"Altitude Of Operation: {AOOC}")
  492.         output.append(f"Exhaust Nozzle Geometry: {NTLC}")
  493.         output.append(f"Exhaust Nozzle Area Ratio: {ARR}")
  494.         output.append(f"Exhaust Nozzle Cooling Mechanism: {CMC}")
  495.         output.append(f"Engine Use Case: {purposeF}")
  496.         output.append(f"Tank repressurisation Method: {TRC}")
  497.         if filelogging:
  498.             file = open("./GenFiles/GenData/obf_rex.txt", "at")
  499.             file.write(f"\n\nEngine Designation: {ENN}\n")
  500.             if not ECC == "Nuclear SaltWater" and not ECC == "Radioisotope Engine" and not NCC == "":
  501.                 file.write(f"Fuel Flow Cycle: {NCC} {ECC}\n")
  502.             else:
  503.                 file.write(f"Fuel Flow Cycle: {ECC}\n")
  504.             file.write(f"Propellant (Remass): {PLC}\n")
  505.             file.write(f"Propellant State: {PRS}\n")
  506.             file.write(f"Reactor Generation: {react_gen}\n")
  507.             file.write(f"Reactor Maximum Power: {MaxP} GW\n")
  508.             file.write(f"Reactor Fuel Material: {RFC}\n")
  509.             if NCC == "LANTR":
  510.                 file.write(f"Engine Exhaust Velocity: ({NumFormat(EEV)}/~3850) m/s\n")
  511.             else:
  512.                 file.write(f"Engine Exhaust Velocity: {NumFormat(EEV)} m/s\n")
  513.             file.write(f"Reactor Core Temperature: {NumFormat(ECT)}°K\n")
  514.             file.write(f"Reactor Coolant: {ERC}\n")
  515.             if not bimodal or ECC == "Nuclear SaltWater":
  516.                 file.write(f"Engine Bimodality: Engine isn't bimodal\n")
  517.                 file.write(f"Engine Electrical Output: None\n")
  518.             else:
  519.                 file.write(f"Engine Bimodality: Engine is bimodal\n")
  520.                 file.write(f"Engine Electrical Output: {MaxElecP} MW\n")
  521.             file.write(f"Altitude Of Operation: {AOOC}\n")
  522.             file.write(f"Exhaust Nozzle Geometry: {NTLC}\n")
  523.             file.write(f"Exhaust Nozzle Area Ratio: {ARR}\n")
  524.             file.write(f"Exhaust Nozzle Cooling Mechanism: {CMC}\n")
  525.             file.write(f"Engine Use Case: {purposeF}\n")
  526.             file.write(f"Tank repressurisation Method: {TRC}")
  527.             file.close()
  528.         return output
  529.     def output_def(ENN, ECC, OCC, FCC, AOOC, NTC, TRC, CMC, propProp, purp, injector, FinalAreaRatio, combust_temp,
  530.                    mixRatio, exhaustVel, ThrottleRange, chamberN, F_gimbalangle):
  531.         output = [f"Engine Designation: {ENN}", f"Fuel Flow Cycle: {ECC}", f"Engine Oxidizer: {OCC}",
  532.                   f"Engine Fuel: {FCC}", f"Average Mixture Ratio: {mixRatio}", f"Propellant properties: {propProp}",
  533.                   f"Altitude Of Operation: {AOOC}", f"Exhaust Nozzle Geometry: {NTC}",
  534.                   f"Exhaust Nozzle Area Ratio: {FinalAreaRatio}", f"Characteristic Exhaust Velocity: {exhaustVel} m/s",
  535.                   f"Adiabatic Combustion Temperature: {combust_temp}°K", f"Engine Gimbal Range: {F_gimbalangle}",
  536.                   f"Engine Injector Design: {injector}", f"Engine chamber configuration: {chamberN}",
  537.                   f"Engine Use Case: {purp}", f"Tank repressurisation Method: {TRC}\n", f"Nozzle Cooling Mechanism: {CMC}",
  538.                   f"Engine Throttle Range: {ThrottleRange}"]
  539.         if filelogging:
  540.             file = open("./GenFiles/GenData/obf_rex.txt", "at")
  541.             file.write(f"\n\nEngine Designation: {ENN}\n")
  542.             file.write(f"Fuel Flow Cycle: {ECC}\n")
  543.             file.write(f"Engine Oxidizer: {OCC}\n")
  544.             file.write(f"Engine Fuel: {FCC}\n")
  545.             file.write(f"Average Mixture Ratio: {mixRatio}\n")
  546.             file.write(f"Propellant properties: {propProp}\n")
  547.             file.write(f"Altitude Of Operation: {AOOC}\n")
  548.             file.write(f"Exhaust Nozzle Geometry: {NTC}\n")
  549.             file.write(f"Exhaust Nozzle Area Ratio: {FinalAreaRatio}\n")
  550.             file.write(f"Characteristic Exhaust Velocity: {exhaustVel} m/s\n")
  551.             file.write(f"Adiabatic Combustion Temperature: {combust_temp}°K\n")
  552.             file.write(f"Engine Gimbal Range: {F_gimbalangle}\n")
  553.             file.write(f"Engine Injector Design: {injector}\n")
  554.             file.write(f"Engine chamber configuration: {chamberN}\n")
  555.             file.write(f"Engine Use Case: {purp}\n")
  556.             file.write(f"Tank repressurisation Method: {TRC}\n")
  557.             file.write(f"Nozzle Cooling Mechanism: {CMC}\n")
  558.             file.write(f"Engine Throttle Range: {ThrottleRange}")
  559.             file.close()
  560.         return output
  561.  
  562.     repeatCommand, y, fNum, maxN = "YES", 0, 2, 50
  563.     org = "./GenFiles"
  564.     org1 = "./GenFiles/DevData"
  565.     org2 = "./GenFiles/GenData"
  566.     pathe = "./GenFiles/GenData/obf_rex.txt"
  567.     logPF = "./GenFiles/GenData/FullFolders/obf_rex[Full]1.txt"
  568.     engine_Cycle = ["Gas Generator", "Staged Combustion (Oxidizer Rich)", "Staged Combustion (Fuel Rich)",
  569.                     "Expander (Open/Bleed)", "Expander (Closed)", "Dual Expander (Open/Bleed)", "Dual Expander (Closed)",
  570.                     "Pressure-Fed", "Full Flow Staged", "Electric Pump Fed", "Combustion Tap Off", "Monopropellant (Cold Gas)",
  571.                     "Monopropellant (Decomposition)", "Gas Core", "Droplet Core", "Liquid Core", "Solid Core","Vapor Core",
  572.                     "Nuclear SaltWater", "Radioisotope Engine", "MagnetoPlasmaDynamic Thruster", "Hall Effect Thruster",
  573.                     "Gridded Ion Thruster", "Colloid Thruster", "Variable Specific Impulse Magnetoplasma Rocket (VASIMR)"]
  574.     altitude_Of_Operation = ["0-20 km (Sea Level)", "20-30 km (Medium Atmosphere)", "30-80 km (High Atmosphere)", "80 km+ (Vacuum)",
  575.                              "Any Altitude (0-80 km+)"]
  576.     tank_Repressurisation = ["Autogenous", "Inert Gas"]
  577.     if not file_exists(org):
  578.         os.mkdir(org)
  579.     if not file_exists(org1):
  580.         os.mkdir(org1)
  581.     if not file_exists(org2):
  582.         os.mkdir(org2)
  583.  
  584.     if maxN >= fNum:
  585.         if not file_exists(pathe):
  586.             init = open(pathe, "x")
  587.             init.close()
  588.         sizeInbytes = os.path.getsize(pathe)
  589.         sizeInKilobytes = (sizeInbytes / 1024)
  590.         if sizeInKilobytes >= 50:
  591.             if file_exists(logPF):
  592.                 if file_exists("./GenFiles/GenData/FullFolders/obf_rex[Full]" + str(fNum) + ".txt"):
  593.                     fNum += 1
  594.                 else:
  595.                     shutil.copy2(pathe, "./GenFiles/GenData/FullFolders/obf_rex[Full]" + str(fNum) + ".txt")
  596.                     rset = open(pathe, 'wt')
  597.                     rset.write("")
  598.                     rset.close()
  599.             else:
  600.                 org3 = "./GenFiles/GenData/FullFolders"
  601.                 os.mkdir(org3)
  602.                 shutil.copy2(
  603.                     "./GenFiles/GenData/obf_rex.txt", logPF)
  604.         engine_Name = nameGen()
  605.         engine_Cycle_Chosen = rando(engine_Cycle)
  606.         match engine_Cycle_Chosen:
  607.             case "Gas Core" | "Droplet Core" | "Liquid Core" | "Solid Core" | "Vapor Core" | "Nuclear SaltWater" | \
  608.                  "Radioisotope Engine":
  609.                 match engine_Cycle_Chosen:
  610.                     case "Radioisotope Engine":
  611.                         remass_List = ["Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
  612.                                        "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"]
  613.                         remass_EVD = [1.782, 14.6, 4.25, 6.587, 16, 14.6, 28]
  614.                         remass_List_Chosen = rando(remass_List)
  615.                         propellant_List_Chosen = remass_List_Chosen
  616.                         nuclear_Cycle_Chosen = ""
  617.                         reactor_fuel = ["Polonium-210", "Fermium-252", "Uranium-233", "Plutonium-238"]
  618.                         reactor_Fuel_Chosen = rando(reactor_fuel)
  619.                         propellantState = "Cryogenic Liquid"
  620.                         coreTemp = rN(2000, 200)
  621.                         molmassi = findex(remass_List, remass_List_Chosen)
  622.                         molmass = remass_EVD[molmassi]
  623.                         exhaustVel = (12400 / math.pow(molmass, 0.531))
  624.                     case "Solid Core":
  625.                         remass_List = ["Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
  626.                                        "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"]
  627.                         remass_EVD = [1.782, 14.6, 4.25, 6.587, 16, 14.6, 28]
  628.                         remass_List_Chosen = rando(remass_List)
  629.                         propellant_List_Chosen = remass_List_Chosen
  630.                         nuclear_cycle = ["LANTR", "LEUNTR", "LPNTR", "CERMET", "Pebble-Bed", ""]
  631.                         nuclear_Cycle_Chosen = rando(nuclear_cycle)
  632.                         reactor_fuel = ["Uranium-235", "Plutonium-238"]
  633.                         propellantState = "Cryogenic Liquid"
  634.                         if nuclear_Cycle_Chosen.upper == "LANTR":
  635.                             remass_List_Chosen = "Hydrogen (H2)"
  636.                             enr_level = rN(8, 87)
  637.                             reactor_Fuel_Chosen = str(enr_level) + "% " + rando(reactor_fuel)
  638.                             coreTemp = rN(1900 + (enr_level * 5), 1000)
  639.                             molmassi = findex(remass_List, remass_List_Chosen)
  640.                             molmass = remass_EVD[molmassi]
  641.                             exhaustVel = (17600 / math.pow(molmass, 0.531))
  642.                         elif nuclear_Cycle_Chosen.upper == "LEUNTR":
  643.                             remass_List_Chosen = rando(remass_List)
  644.                             enr_level = rN(5, 10)
  645.                             reactor_Fuel_Chosen = str(enr_level) + "% " + rando(reactor_fuel)
  646.                             coreTemp = rN(1900 + (enr_level * 5), 1000)
  647.                             molmassi = findex(remass_List, remass_List_Chosen)
  648.                             molmass = remass_EVD[molmassi]
  649.                             exhaustVel = (17600 / math.pow(molmass, 0.531))
  650.                         elif nuclear_Cycle_Chosen.upper == "LPNTR":
  651.                             remass_List_Chosen = rando(remass_List)
  652.                             enr_level = rN(8, 87)
  653.                             reactor_Fuel_Chosen = str(enr_level) + "% " + rando(reactor_fuel)
  654.                             coreTemp = rN(1900 + (enr_level * 5), 1000)
  655.                             molmassi = findex(remass_List, remass_List_Chosen)
  656.                             molmass = remass_EVD[molmassi]
  657.                             exhaustVel = (17600 / math.pow(molmass, 0.531))
  658.                         elif nuclear_Cycle_Chosen.upper == "CERMET":
  659.                             remass_List_Chosen = rando(remass_List)
  660.                             enr_level = rN(8, 87)
  661.                             reactor_Fuel_Chosen = str(enr_level) + "% " + rando(reactor_fuel)
  662.                             coreTemp = rN(1900 + (enr_level * 5), 1000)
  663.                             molmassi = findex(remass_List, remass_List_Chosen)
  664.                             molmass = remass_EVD[molmassi]
  665.                             exhaustVel = (17600 / math.pow(molmass, 0.531))
  666.                         elif nuclear_Cycle_Chosen.upper == "Pebble-Bed":
  667.                             remass_List_Chosen = rando(remass_List)
  668.                             propellantState = "Cryogenic Liquid"
  669.                             propellant_List_Chosen = "Uranium(VI) Fluoride (UF6) and " + remass_List_Chosen
  670.                             nuclear_Cycle_Chosen = rando(nuclear_cycle)
  671.                             enr_level = rN(8, 87)
  672.                             reactor_Fuel_Chosen = str(enr_level) + "% " + "Uranium-235"
  673.                             coreTemp = rN(1400 + (enr_level * 5), 1000)
  674.                             molmassi = findex(remass_List, remass_List_Chosen)
  675.                             molmass = remass_EVD[molmassi]
  676.                             exhaustVel = ((9530 * 2) / math.pow(molmass, 0.531))
  677.                         else:
  678.                             remass_List_Chosen = rando(remass_List)
  679.                             enr_level = rN(8, 87)
  680.                             reactor_Fuel_Chosen = str(enr_level) + "% " + rando(reactor_fuel)
  681.                             coreTemp = rN(1900 + (enr_level * 5), 1000)
  682.                             molmassi = findex(remass_List, remass_List_Chosen)
  683.                             molmass = remass_EVD[molmassi]
  684.                             exhaustVel = (11000 / math.pow(molmass, 0.531))
  685.                     case "Colloid Core":
  686.                         remass_List = ["Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
  687.                                        "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"]
  688.                         remass_EVD = [1.782, 14.6, 4.25, 6.587, 16, 14.6, 28]
  689.                         remass_List_Chosen = rando(remass_List)
  690.                         propellant_List_Chosen = "Uranium Zirconium Carbide(UC2 + ZrC) Colloid and " + remass_List_Chosen
  691.                         nuclear_Cycle_Chosen = ""
  692.                         propellantState = "Cryogenic Liquid"
  693.                         enr_level = rN(8, 87)
  694.                         reactor_Fuel_Chosen = enr_level + "% " + "Uranium-235"
  695.                         coreTemp = rN(2500 + (enr_level * 5), 1000)
  696.                         molmassi = findex(remass_List, remass_List_Chosen)
  697.                         molmass = remass_EVD[molmassi]
  698.                         exhaustVel = (11800 / math.pow(molmass, 0.531))
  699.                     case "Liquid Core":
  700.                         nuclear_cycle = ["\"Expander Bleed\"", "\"Expander Closed\"", "\"Vortex Confined\"", "LARS"]
  701.                         remass_List = ["Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
  702.                                        "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"]
  703.                         remass_EVD = [1.782, 14.6, 4.25, 6.587, 16, 14.6, 28]
  704.                         materials = ["Tungsten", "Osmium", "Rhenium", "Tantalum"]
  705.                         remass_List_Chosen = rando(remass_List)
  706.                         material = rando(materials)
  707.                         propellantState = "Cryogenic Liquid"
  708.                         propellant_List_Chosen = "Uranium impregnated " + material + " and " + remass_List_Chosen
  709.                         nuclear_Cycle_Chosen = rando(nuclear_cycle)
  710.                         enr_level = rN(8, 87)
  711.                         reactor_Fuel_Chosen = str(enr_level) + "% " + "Uranium-235"
  712.                         coreTemp = rN(3500 + (enr_level * 5), 1000)
  713.                         molmassi = findex(remass_List, remass_List_Chosen)
  714.                         molmass = remass_EVD[molmassi]
  715.                         exhaustVel = (19620 / math.pow(molmass, 0.531))
  716.                     case "Droplet Core":
  717.                         nuclear_cycle = ["\"Expander Bleed\"", "\"Expander Closed\"", "\"Vortex Confined\""]
  718.                         remass_List = ["Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
  719.                                        "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"]
  720.                         remass_EVD = [1.782, 14.6, 4.25, 6.587, 16, 14.6, 28]
  721.                         remass_List_Chosen = rando(remass_List)
  722.                         propellantState = "Cryogenic Liquid"
  723.                         propellant_List_Chosen = "Uranium(VI) Fluoride (UF6) and " + remass_List_Chosen
  724.                         nuclear_Cycle_Chosen = rando(nuclear_cycle)
  725.                         enr_level = rN(8, 87)
  726.                         reactor_Fuel_Chosen = str(enr_level) + "% " + "Uranium-235"
  727.                         coreTemp = rN(5400 + (enr_level * 5), 1000)
  728.                         molmassi = findex(remass_List, remass_List_Chosen)
  729.                         molmass = remass_EVD[molmassi]
  730.                         exhaustVel = (19600 / math.pow(molmass, 0.531))
  731.                     case "Vapor Core":
  732.                         remass_List = ["Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
  733.                                        "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"]
  734.                         remass_EVD = [1.782, 14.6, 4.25, 6.587, 16, 14.6, 28]
  735.                         remass_List_Chosen = rando(remass_List)
  736.                         propellant_List_Chosen = "Uranium(VI) Fluoride (UF6) and " + remass_List_Chosen
  737.                         nuclear_Cycle_Chosen = ""
  738.                         reactor_Fuel_Chosen = "93% Uranium-235"
  739.                         propellantState = "Cryogenic Liquid"
  740.                         coreTemp = rN(5500, 1000)
  741.                         molmassi = findex(remass_List, remass_List_Chosen)
  742.                         molmass = remass_EVD[molmassi]
  743.                         exhaustVel = (11800 / math.pow(molmass, 0.531))
  744.                     case "Gas Core":
  745.                         remass_List = ["Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
  746.                                        "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"]
  747.                         nuclear_cycle = ["\"Nuclear Lightbulb\"", "\"Vortex Confined\"", "\"Wheel Flow\"",
  748.                                          "\"Magnetohydrodynamic(MHD) vortex\"", "\"Open Cycle\""]
  749.                         remass_EVD = [1.782, 14.6, 4.25, 6.587, 16, 14.6, 28]
  750.                         remass_List_Chosen = rando(remass_List)
  751.                         propellant_List_Chosen = "Uranium(VI) Fluoride (UF6) and " + remass_List_Chosen
  752.                         nuclear_Cycle_Chosen = rando(nuclear_cycle)
  753.                         reactor_Fuel_Chosen = "93% Uranium-235"
  754.                         propellantState = "Cryogenic Liquid"
  755.                         coreTemp = rN(13650, 1000)
  756.                         molmass = remass_EVD[findex(remass_List, remass_List_Chosen)]
  757.                         exhaustVel = (20405 / math.pow(molmass, 0.531))
  758.                     case "Nuclear SaltWater":
  759.                         nuclear_cycle = ["\"Nuclear Lightbulb\"", "\"Vortex Confined\"", "\"Wheel Flow\"",
  760.                                          "\"Magnetohydrodynamic(MHD) vortex\"", "\"Open Cycle\""]
  761.                         fissile_salts = ["Uranium", "Plutonium"]
  762.                         fissile_salt = rando(fissile_salts)
  763.                         nuclear_Cycle_Chosen = rando(nuclear_cycle)
  764.                         if not fissile_salt == "Plutonium":
  765.                             propellant_List_Chosen = fissile_salt + "(IV) TetraBromide (UBr4) + Water (H2O)"
  766.                         else:
  767.                             propellant_List_Chosen = fissile_salt + "(III) TriBromide (PuBr3) + Water (H2O)"
  768.                         remass_List_Chosen = "Water (H2O)"
  769.                         propellantState = "Aqueous"
  770.                         enri_level = rN(1, 2)
  771.                         if enri_level == 1:
  772.                             coreTemp = rN(25000, 1000)
  773.                             exhaustVel = rN(65500, 1000)
  774.                             reactor_Fuel_Chosen = "3% " + fissile_salt
  775.                         else:
  776.                             coreTemp = rN(126800, 1000)
  777.                             exhaustVel = rN(4725000, 1000)
  778.                             reactor_Fuel_Chosen = "98% " + fissile_salt
  779.                 # ============================================================================================
  780.                 if engine_Cycle_Chosen == "Solid Core" or engine_Cycle_Chosen == "Radioisotope Engine":
  781.                     nzll = ["Contour Bell Nozzle", "Parabolic Bell Nozzle"]
  782.                 else:
  783.                     nzll = ["Contour Bell Nozzle", "Parabolic Bell Nozzle", "Magnetic Virtual Nozzle"]
  784.                 nozzle_Type_List_Chosen = rando(nzll)
  785.                 # ============================================================================================
  786.                 cooling_mechanism = ["Radiative Cooling", "Dump Cooling", "Film Cooling", "Regenerative Cooling",
  787.                                      "Transpiration Cooling"]
  788.                 pot_uses = ["Upper Stage(Main Propulsion)", "Payload (Main Propulsion)", "Space Tug (Main Propulsion)"]
  789.                 # ============================================================================================
  790.                 use = rando(pot_uses)
  791.                 altitude_Of_Operation_Chosen = "80 km+ (Vacuum)"
  792.                 tank_Repressurisation_Chosen = rando(tank_Repressurisation)
  793.                 cooling_Mechanism_Chosen = rando(cooling_mechanism)
  794.                 # ============================================================================================
  795.                 if engine_Cycle_Chosen == "Liquid Core" or engine_Cycle_Chosen == "Solid Core" or engine_Cycle_Chosen == "Pulsed Nuclear":
  796.                     reactor_gen = ["Generation III+", "Generation IV", "Generation V", "Generation V+"]
  797.                 elif engine_Cycle_Chosen == "Nuclear SaltWater":
  798.                     reactor_gen = ["Engine has no reactor"]
  799.                 elif engine_Cycle_Chosen == "Radioisotope Engine":
  800.                     reactor_gen = ["Generation I"]
  801.                 else:
  802.                     reactor_gen = ["Generation II", "Generation III", "Generation III+",
  803.                                    "Generation IV", "Generation V", "Generation V+"]
  804.                 # ============================================================================================
  805.                 reactor_gen_Chosen = rando(reactor_gen)
  806.                 uio97 = rN(1, 456)
  807.                 uio98 = rN(1, 77)
  808.                 if uio97 % uio98 != 0:
  809.                     isBimodal = True
  810.                 else:
  811.                     isBimodal = False
  812.                 NzlReturnP = NzlParameters(altitude_Of_Operation_Chosen)
  813.                 parts = NzlReturnP.split(", ")
  814.                 AreaRatio = parts[1]
  815.                 output = output_nt(engine_Name, engine_Cycle_Chosen, altitude_Of_Operation_Chosen, nuclear_Cycle_Chosen,
  816.                           propellant_List_Chosen, reactor_Fuel_Chosen, nozzle_Type_List_Chosen, exhaustVel,
  817.                           tank_Repressurisation_Chosen, cooling_Mechanism_Chosen, use, reactor_gen_Chosen,
  818.                           isBimodal, remass_List_Chosen, propellantState, AreaRatio, coreTemp)
  819.             # ============================================================================================
  820.             case "MagnetoPlasmaDynamic Thruster" | "Hall Effect Thruster" | "Gridded Ion Thruster" | "Colloid Thruster" | \
  821.                  "Variable Specific Impulse Magnetoplasma Rocket (VASIMR)":
  822.                 match engine_Cycle_Chosen:
  823.                     case "Hall Effect Thruster":
  824.                         propellant_List = ["Xe (Xenon)", "Kr (Krypton)", "Ar (Argon)", "Bi (Bismuth)",
  825.                                            "I2 (Iodine)", "Mg (Magnesium)", "Zn (Zinc)", "C10H16 (Adamantane)"]
  826.                         propellant_List_Chosen = rando(propellant_List)
  827.                         nozzle_Type_List_Chosen = "Hall Effect Thruster Nozzle"
  828.                     case "Gridded Ion Thruster":
  829.                         propellant_List = ["Xe (Xenon)", "Hg (Mercury)", "Cs (Caesium)"]
  830.                         propellant_List_Chosen = rando(propellant_List)
  831.                         nozzle_Type_List_Chosen = "Electrostatic Ion Nozzle"
  832.                     case "Colloid Thruster":
  833.                         propellant_List_Chosen = "NH2OH+NO3 (Hydroxylammonium nitrate)"
  834.                         nozzle_Type_List_Chosen = "Capillary Emitter-Electrode Cone"
  835.                     case "Variable Specific Impulse Magnetoplasma Rocket (VASIMR)":
  836.                         propellant_List = ["Xe (Xenon)", "Kr (Krypton)", "Ar (Argon)"]
  837.                         propellant_List_Chosen = rando(propellant_List)
  838.                         nozzle_Type_List_Chosen = "VASIMR Magnetic Confinement Nozzle"
  839.                     case "MagnetoPlasmaDynamic Thruster":
  840.                         propellant_List = ["Xe (Xenon)", "Ne (Neon)", "Ar (Argon)", "H2 (Hydrogen)", "N2H4 (Hydrazine)",
  841.                                            "Li (Lithium)"]
  842.                         propellant_List_Chosen = rando(propellant_List)
  843.                         nozzle_Type_List_Chosen = "Cathode Plug Magnetic Confinement Nozzle"
  844.                 pot_uses = ["Payload (Main Propulsion)", "Space Tug (Main Propulsion)"]
  845.                 use = rando(pot_uses)
  846.                 powerGen_List = ["Hydrogen Fuel cell", "Nuclear Fission Reactor", "Nuclear Fusion Reactor",
  847.                                  "Photovoltaic Panel", "Solar Thermal Panel",
  848.                                  "Radioisotope Thermoelectric Generator (RTG)"]
  849.                 powerGen_List_Chosen = rando(powerGen_List)
  850.                 altitude_Of_Operation_Chosen = "80 km+ (Vacuum)"
  851.                 pwr = str((round(rN(20, 980) / 10)) * 10) + " kW"
  852.                 output = output_et(engine_Name, engine_Cycle_Chosen, altitude_Of_Operation_Chosen, propellant_List_Chosen,
  853.                           nozzle_Type_List_Chosen, powerGen_List_Chosen, use, pwr)
  854.             # ============================================================================================
  855.             case "Monopropellant (Decomposition)":
  856.                 propellant_List1 = ["H2O2 (Hydrogen Peroxide)", "N2H4 (Hydrazine)",
  857.                                     "NH2OH+NO3 (Hydroxylammonium nitrate)",
  858.                                     "65% NH4N(NO2)2 (Ammonium Dinitramide) + 35% CH3OH(Methanol)"]
  859.                 nozzle_Type_List1 = ["Conical Nozzle", "Contour Bell Nozzle", "Parabolic Bell Nozzle"]
  860.                 propellant_List_Chosen = rando(propellant_List1)
  861.                 altitude_Of_Operation_Chosen = "80 km+ (Vacuum)"
  862.                 nozzle_Type_List_Chosen = rando(nozzle_Type_List1)
  863.                 cooling_mechanism = ["Ablative Cooling", "Radiative Cooling"]
  864.                 cooling_Mechanism_Chosen = rando(cooling_mechanism)
  865.                 catalyst_Chosen = ""
  866.                 match propellant_List_Chosen:
  867.                     case "N2H4 (Hydrazine)" | "65% NH4N(NO2)2 (Ammonium Dinitramide) + 35% CH3OH(Methanol)":
  868.                         catalyst_Chosen = "Iridium coated Alumina Pellets"
  869.                     case "H2O2 (Hydrogen Peroxide)":
  870.                         catalyst = ["KMnO4 (Potassium Permanganate) Honeycomb", "Ag (Silver) Honeycomb",
  871.                                     "MnO2 (Manganese Dioxide) Honeycomb", "K2Cr2O7 (Potassium dichromate) Honeycomb",
  872.                                     "FeO (Iron (II) oxide)"]
  873.                         catalyst_Chosen = rando(catalyst)
  874.                     case "NH2OH+NO3 (Hydroxylammonium nitrate)":
  875.                         catalyst_Chosen = "Iridium coated Copper Pellets"
  876.                 pot_uses = ["Upper Stage(Ullage)", "Upper Stage(Vernier)", "Payload (Main Propulsion)",
  877.                             "Payload (Vernier)", "Space Tug (Ullage)", "Space Tug (Vernier)"]
  878.                 use = rando(pot_uses)
  879.                 output = output_monod(engine_Name, engine_Cycle_Chosen, altitude_Of_Operation_Chosen, propellant_List_Chosen,
  880.                              nozzle_Type_List_Chosen, cooling_Mechanism_Chosen, catalyst_Chosen, use)
  881.             # ============================================================================================
  882.             case "Monopropellant (Cold Gas)":
  883.                 propellant_List2 = ["Nitrogen (N2)", "Helium (He)", "Carbon Dioxide (CO2)", "Ammonia (NH3)",
  884.                                     "Hydrogen (H2)",
  885.                                     "Methane (CH4)"]
  886.                 nozzle_Type_List1 = ["Conical Nozzle", "Contour Bell Nozzle", "Parabolic Bell Nozzle"]
  887.                 propellant_List_Chosen = rando(propellant_List2)
  888.                 altitude_Of_Operation_Chosen = "80 km+ (Vacuum)"
  889.                 nozzle_Type_List_Chosen = rando(nozzle_Type_List1)
  890.                 cooling_Mechanism_Chosen = "Ablative Cooling"
  891.                 pot_uses = ["Upper Stage(Ullage)", "Upper Stage(Vernier)", "Payload (Main Propulsion)",
  892.                             "Payload (Vernier)", "Space Tug (Ullage)", "Space Tug (Vernier)"]
  893.                 purpose = rando(pot_uses)
  894.                 output = output_mono(engine_Name, engine_Cycle_Chosen, altitude_Of_Operation_Chosen,
  895.                             propellant_List_Chosen, nozzle_Type_List_Chosen, cooling_Mechanism_Chosen, purpose)
  896.             # ============================================================================================
  897.             case "Expander (Closed)" | "Expander (Open/Bleed)":
  898.                 oxidizer_List = ["O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)"]
  899.                 oxidizer_Chosen = rando(oxidizer_List)
  900.                 fuel_Chosen = ""
  901.                 match oxidizer_Chosen:
  902.                     case "O2 (Oxygen)":
  903.                         fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  904.                                      "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)",
  905.                                      "N2H4 (Hydrazine)",
  906.                                      "CH3OH (Methanol)", "C12H26 (n-Dodecane)"]
  907.                         random.shuffle(fuel_List)
  908.                         fuel_Chosen = random.choice(fuel_List)
  909.                     case "F2 (Fluorine)":
  910.                         fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  911.                                      "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "C2H8N2 (UnsymmetricalDimethylHydrazine)",
  912.                                      "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)", "CH3OH (Methanol)",
  913.                                      "C12H26 (n-Dodecane)"]
  914.                         random.shuffle(fuel_List)
  915.                         fuel_Chosen = random.choice(fuel_List)
  916.                     case "F2 (Fluorine) + O2 (Oxygen)" | "O3 (Ozone)":
  917.                         fuel_List = ["H2 (Hydrogen)", "N2H4 (Hydrazine)", "CH3OH (Methanol)", "C12H26 (n-Dodecane)"]
  918.                         random.shuffle(fuel_List)
  919.                         fuel_Chosen = random.choice(fuel_List)
  920.                 output = StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen,
  921.                           tank_Repressurisation, altitude_Of_Operation)
  922.             # ============================================================================================
  923.             case "Dual Expander (Closed)" | "Dual Expander (Open/Bleed)":
  924.                 oxidizer_List = ["O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)"]
  925.                 oxidizer_Chosen = rando(oxidizer_List)
  926.                 fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)"]
  927.                 fuel_Chosen = ""
  928.                 match oxidizer_Chosen:
  929.                     case "O2 (Oxygen)" | "F2 (Fluorine)":
  930.                         random.shuffle(fuel_List)
  931.                         fuel_Chosen = random.choice(fuel_List)
  932.                     case "F2 (Fluorine) + O2 (Oxygen)":
  933.                         fuel_Chosen = "H2 (Hydrogen)"
  934.                 output = StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen,
  935.                           tank_Repressurisation, altitude_Of_Operation)
  936.             # ============================================================================================
  937.             case "Staged Combustion (Fuel Rich)":
  938.                 oxidizer_List = ["O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)"]
  939.                 oxidizer_Chosen = rando(oxidizer_List)
  940.                 fuel_Chosen = ""
  941.                 match oxidizer_Chosen:
  942.                     case "O2 (Oxygen)" | "F2 (Fluorine)":
  943.                         fuel_List = ["H2 (Hydrogen)", "NH3 (Ammonia)", "N2H4 (Hydrazine)"]
  944.                         random.shuffle(fuel_List)
  945.                         fuel_Chosen = random.choice(fuel_List)
  946.                     case "F2 (Fluorine) + O2 (Oxygen)" | "O3 (Ozone)":
  947.                         fuel_Chosen = "H2 (Hydrogen)"
  948.                 output = StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen,
  949.                           tank_Repressurisation, altitude_Of_Operation)
  950.             # ============================================================================================
  951.             case "Staged Combustion (Oxidizer Rich)":
  952.                 oxidizer_List = ["O2 (Oxygen)", "O3 (Ozone)", "N2O4 (Nitrogen Tetroxide)"]
  953.                 oxidizer_Chosen = rando(oxidizer_List)
  954.                 fuel_Chosen = ""
  955.                 match oxidizer_Chosen:
  956.                     case "O2 (Oxygen)" | "O3 (Ozone)":
  957.                         fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  958.                                      "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)",
  959.                                      "N2H4 (Hydrazine)",
  960.                                      "CH3OH (Methanol)"]
  961.                         random.shuffle(fuel_List)
  962.                         fuel_Chosen = random.choice(fuel_List)
  963.                     case "N2O4 (Nitrogen Tetroxide)":
  964.                         fuel_List = ["C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)",
  965.                                      "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  966.                                      "C2H8N2 (UnsymmetricalDimethylHydrazine)"]
  967.                         random.shuffle(fuel_List)
  968.                         fuel_Chosen = random.choice(fuel_List)
  969.                 output = StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen,
  970.                           tank_Repressurisation, altitude_Of_Operation)
  971.             # ============================================================================================
  972.             case "Full Flow Staged Combustion" | "Combustion Tap Off":
  973.                 oxidizer_List = ["O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)",
  974.                                  "N2O4 (Nitrogen Tetroxide)"]
  975.                 oxidizer_Chosen = rando(oxidizer_List)
  976.                 fuel_Chosen = ""
  977.                 match oxidizer_Chosen:
  978.                     case "O2 (Oxygen)":
  979.                         fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  980.                                      "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)",
  981.                                      "N2H4 (Hydrazine)",
  982.                                      "CH3OH (Methanol)"]
  983.                         random.shuffle(fuel_List)
  984.                         fuel_Chosen = random.choice(fuel_List)
  985.                     case "F2 (Fluorine)":
  986.                         fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  987.                                      "NH3 (Ammonia)", "C2H8N2 (UnsymmetricalDimethylHydrazine)",
  988.                                      "CH6N2 (MonomethylHydrazine)",
  989.                                      "N2H4 (Hydrazine)", "CH3OH (Methanol)"]
  990.                         random.shuffle(fuel_List)
  991.                         fuel_Chosen = random.choice(fuel_List)
  992.                     case "F2 (Fluorine) + O2 (Oxygen)" | "O3 (Ozone)":
  993.                         fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  994.                                      "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)",
  995.                                      "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  996.                                      "CH6N2 (MonomethylHydrazine)"]
  997.                         random.shuffle(fuel_List)
  998.                         fuel_Chosen = random.choice(fuel_List)
  999.                     case "N2O4 (Nitrogen Tetroxide)":
  1000.                         fuel_List = ["H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  1001.                                      "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)",
  1002.                                      "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  1003.                                      "C2H8N2 (UnsymmetricalDimethylHydrazine)", "CH3OH (Methanol)"]
  1004.                         random.shuffle(fuel_List)
  1005.                         fuel_Chosen = random.choice(fuel_List)
  1006.                 output = StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen, tank_Repressurisation,
  1007.                           altitude_Of_Operation)
  1008.             # ============================================================================================
  1009.             case _:
  1010.                 oxidizer_List = ["O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)",
  1011.                                  "N2O4 (Nitrogen Tetroxide)",
  1012.                                  "H2O2 (Hydrogen Peroxide) 95%", "H2O2 (Hydrogen Peroxide) 85%", "O3 (Ozone)",
  1013.                                  "AK20F: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK20I: 80% HNO3 + 20% N2O4 (Nitric Acid)",
  1014.                                  "AK20K: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK27I: 73% HNO3 + 27% N2O4 (Nitric Acid)",
  1015.                                  "AK27P: 73% HNO3 + 27% N2O4 (Nitric Acid)"]
  1016.                 oxidizer_Chosen = rando(oxidizer_List)
  1017.                 if oxidizer_Chosen == "O2 (Oxygen)":
  1018.                     fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  1019.                                  "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)",
  1020.                                  "N2H4 (Hydrazine)",
  1021.                                  "CH3OH (Methanol)", "C12H26 (n-Dodecane)"]
  1022.                     random.shuffle(fuel_List)
  1023.                     fuel_Chosen = random.choice(fuel_List)
  1024.                 elif oxidizer_Chosen == "F2 (Fluorine)":
  1025.                     fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  1026.                                  "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "C2H8N2 (UnsymmetricalDimethylHydrazine)",
  1027.                                  "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)", "CH3OH (Methanol)",
  1028.                                  "C12H26 (n-Dodecane)"]
  1029.                     random.shuffle(fuel_List)
  1030.                     fuel_Chosen = random.choice(fuel_List)
  1031.                 elif oxidizer_Chosen == "F2 (Fluorine) + O2 (Oxygen)" or oxidizer_Chosen == "O3 (Ozone)":
  1032.                     fuel_List = ["H2 (Hydrogen)", "CH3OH (Methanol)", "C12H26 (n-Dodecane)"]
  1033.                     random.shuffle(fuel_List)
  1034.                     fuel_Chosen = random.choice(fuel_List)
  1035.                 elif oxidizer_Chosen == "AK20F: 80% HNO3 + 20% N2O4 (Nitric Acid)" or oxidizer_Chosen == "AK20I: 80% HNO3 + 20% N2O4 (Nitric Acid)" or \
  1036.                         oxidizer_Chosen == "AK20K: 80% HNO3 + 20% N2O4 (Nitric Acid)" or oxidizer_Chosen == "AK27I: 73% HNO3 + 27% N2O4 (Nitric Acid)" or \
  1037.                         oxidizer_Chosen == "AK27P: 73% HNO3 + 27% N2O4 (Nitric Acid)":
  1038.                     fuel_List = ["H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "CH6N2 (MonomethylHydrazine)",
  1039.                                  "N2H4 (Hydrazine)",
  1040.                                  "CH3OH (Methanol)"]
  1041.                     random.shuffle(fuel_List)
  1042.                     fuel_Chosen = random.choice(fuel_List)
  1043.                 elif oxidizer_Chosen == "N2O4 (Nitrogen Tetroxide)" or oxidizer_Chosen == "H2O2 (Hydrogen Peroxide) 95%" or \
  1044.                         oxidizer_Chosen == "H2O2 (Hydrogen Peroxide) 85%":
  1045.                     fuel_List = ["H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  1046.                                  "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)",
  1047.                                  "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  1048.                                  "C2H8N2 (UnsymmetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)",
  1049.                                  "N2H4 (Hydrazine)",
  1050.                                  "CH3OH (Methanol)", "C12H26 (n-Dodecane)"]
  1051.                     random.shuffle(fuel_List)
  1052.                     fuel_Chosen = random.choice(fuel_List)
  1053.                 output = StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen, tank_Repressurisation,
  1054.                           altitude_Of_Operation)
  1055.         return output
  1056. def change_scaling_event(new_scaling: str):
  1057.     new_scaling_float = int(new_scaling.replace("%", "")) / 125
  1058.     print(f"scaling button click {new_scaling_float}")
  1059. class App(customtkinter.CTk):
  1060.     def __init__(self):
  1061.         super().__init__()
  1062.         self.checkbox_1 = None
  1063.         self.output = None
  1064.         self.t_output = None
  1065.         self.dev_explorer = None
  1066.         self.interiorTitle = None
  1067.         self.interiorText = None
  1068.         self.open_explorer = None
  1069.         self.filelog = None
  1070.         self.reload = None
  1071.         self.label = None
  1072.         self.labelTitle = None
  1073.         self.labelText = None
  1074.         self.interior = None
  1075.         self.textboxTitle = None
  1076.  
  1077.         self.state("zoomed")
  1078.         self.title("Procedural Rocket Engine Generator")
  1079.         self.iconbitmap("./Assets/reddit.png")
  1080.  
  1081.         self.sidebar = customtkinter.CTkFrame(self, width=305, height=1200, corner_radius=5)
  1082.         self.sidebar.place(x=0, y=120)
  1083.         self.random = customtkinter.CTkButton(self.sidebar, corner_radius=6, height=50, width=200, border_spacing=10, text="Automated Generation",
  1084.                                               font=("Helvetica",16), command=self.auto)
  1085.         self.random.place(x=53, y=35)
  1086.         self.basic = customtkinter.CTkButton(self.sidebar, corner_radius=6, height=50, width=200, border_spacing=10, text="Basic Generation",
  1087.                                               font=("Helvetica",16), command=self.basic)
  1088.         self.basic.place(x=53, y=110)
  1089.         self.extended = customtkinter.CTkButton(self.sidebar, corner_radius=6, height=50, width=200, border_spacing=10, text="Extended Generation",
  1090.                                               font=("Helvetica",16), command=self.adv)
  1091.         self.extended.place(x=53, y=185)
  1092.         self.about = customtkinter.CTkButton(self.sidebar, corner_radius=6, height=50, width=160, border_spacing=10, text="About Us",
  1093.                                               font=("Helvetica",16), command=self.about)
  1094.         self.about.place(x=73, y=260)
  1095.  
  1096.         self.mainFrame = customtkinter.CTkFrame(self, width=1500, height=1200, corner_radius=5, fg_color="#242424")
  1097.         self.mainFrame.place(x=305, y=120)
  1098.         self.mainTitle = customtkinter.CTkFrame(self, width=1500, height=120, corner_radius=5, fg_color="#242424")
  1099.         self.mainTitle.place(x=0, y=0)
  1100.         self.line = customtkinter.CTkFrame(self, width=1800, height=3, fg_color="#404040")
  1101.         self.line.place(x=0, y=120)
  1102.         self.auto()
  1103.     def reload_b(self):
  1104.         for widgets in self.interiorTitle.winfo_children():
  1105.             widgets.destroy()
  1106.         for widgets in self.interiorText.winfo_children():
  1107.             widgets.destroy()
  1108.         self.output = random_code()
  1109.         self.labelTitle = customtkinter.CTkLabel(self.interiorTitle, text=str(f"""  {self.output[0]}"""), font=("Segoe UI", 30))
  1110.         self.labelTitle.place(x=15, y=10)
  1111.         y_coor = 0
  1112.         for i in range(1, len(self.output)):
  1113.             self.labelText = customtkinter.CTkLabel(self.interiorText, text=str(f"   {self.output[i]}\n"), font=("Segoe UI", 18))
  1114.             self.labelText.place(x=15, y=y_coor + 30)
  1115.             y_coor = y_coor + 30
  1116.         self.t_output = self.output
  1117.     def auto(self):
  1118.         for widgets in self.mainFrame.winfo_children():
  1119.             widgets.destroy()
  1120.         for widgets in self.mainTitle.winfo_children():
  1121.             widgets.destroy()
  1122.         self.label = customtkinter.CTkLabel(self.mainTitle, text="Automated Generation", font=("Sans-Serif", 65, "bold"))
  1123.         self.label.grid(padx=20, pady=(20, 100))
  1124.         self.label.place(x=405, y=98, anchor="s")
  1125.         self.reload = customtkinter.CTkButton(self.mainFrame, command=self.reload_b, text="Reload")
  1126.         self.reload.grid(padx=20, pady=10)
  1127.         self.reload.place(x=70, y=760)
  1128.         self.open_explorer = customtkinter.CTkButton(self.mainFrame, command=lambda: subprocess.run(["C:\Windows\explorer.exe", './The New Age/Assets']), text="Open Files")
  1129.         self.open_explorer.grid(padx=20, pady=10)
  1130.         self.open_explorer.place(x=230, y=760)
  1131.         self.dev_explorer = customtkinter.CTkButton(self.mainFrame, command=lambda: subprocess.run(["C:\Windows\explorer.exe", './The New Age/Assets']), text="Open Dev Data")
  1132.         self.dev_explorer.grid(padx=20, pady=10)
  1133.         self.dev_explorer.place(x=390, y=760)
  1134.         self.filelog = customtkinter.CTkSwitch(master=self.mainFrame, text="File logging", command=open_input_dialog_event, state="normal")
  1135.         self.filelog.select()
  1136.         self.filelog.grid(pady=10, padx=20, sticky="n")
  1137.         self.filelog.place(x=605, y=785, anchor="s")
  1138.         self.interiorTitle = customtkinter.CTkFrame(self.mainFrame, width=1425, height=65, corner_radius=5)
  1139.         self.interiorTitle.grid(padx=(20, 20), pady=(0, 0), sticky="nsew")
  1140.         self.interiorTitle.place(x=45, y=25)
  1141.         self.interiorText = customtkinter.CTkFrame(self.mainFrame, width=1425, height=650, corner_radius=5)
  1142.         self.interiorText.place(x=45, y=95)
  1143.         if self.t_output is None:
  1144.             self.reload_b()
  1145.         else:
  1146.             self.labelTitle = customtkinter.CTkLabel(self.interiorTitle, text=str(f"""  {self.t_output[0]}"""), font=("Segoe UI", 30))
  1147.             self.labelTitle.place(x=15, y=10)
  1148.             y_coor = 0
  1149.             for i in range(1, len(self.t_output)):
  1150.                 self.labelText = customtkinter.CTkLabel(self.interiorText, text=str(f"   {self.t_output[i]}\n"), font=("Segoe UI", 18))
  1151.                 self.labelText.place(x=15, y=y_coor + 30)
  1152.                 y_coor = y_coor + 30
  1153.     def basic(self):
  1154.         for widgets in self.mainFrame.winfo_children():
  1155.             widgets.destroy()
  1156.         for widgets in self.mainTitle.winfo_children():
  1157.             widgets.destroy()
  1158.         self.label = customtkinter.CTkLabel(self.mainTitle, text="Basic Generation", font=("Sans-Serif", 65, "bold"))
  1159.         self.label.grid(padx=20, pady=(20, 100))
  1160.         self.label.place(x=325, y=98, anchor="s")
  1161.     def adv(self):
  1162.         for widgets in self.mainFrame.winfo_children():
  1163.             widgets.destroy()
  1164.         for widgets in self.mainTitle.winfo_children():
  1165.             widgets.destroy()
  1166.         self.label = customtkinter.CTkLabel(self.mainTitle, text="Extended Generation", font=("Sans-Serif", 65, "bold"))
  1167.         self.label.grid(padx=20, pady=(20, 100))
  1168.         self.label.place(x=385, y=98, anchor="s")
  1169.     def about(self):
  1170.         for widgets in self.mainFrame.winfo_children():
  1171.             widgets.destroy()
  1172.         for widgets in self.mainTitle.winfo_children():
  1173.             widgets.destroy()
  1174.         self.label = customtkinter.CTkLabel(self.mainTitle, text="About Us", font=("Sans-Serif", 65, "bold"))
  1175.         self.label.grid(padx=20, pady=(20, 100))
  1176.         self.label.place(x=205, y=98, anchor="s")
  1177.  
  1178. if __name__ == "__main__":
  1179.     app = App()
  1180.     app.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement