MAKS_Enjoyer

i have committed various infractions against the geneva convention (in Minecraft ofc)

Aug 22nd, 2022 (edited)
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 108.06 KB | Source Code | 0 0
  1. package com;
  2.  
  3. // gigachad converters
  4. import java.io.File;
  5. import java.io.FileInputStream;
  6. import java.io.FileNotFoundException;
  7. import java.io.FileOutputStream;
  8. import java.io.IOException;
  9. import java.nio.file.Files;
  10. import java.nio.file.Path;
  11. import java.nio.file.Paths;
  12. import java.time.LocalDateTime;
  13. import java.time.format.DateTimeFormatter;
  14. import java.util.Arrays;
  15. import java.util.Collections;
  16. import java.util.Random;
  17. import java.util.Scanner;
  18.  
  19. import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
  20. import org.apache.poi.xwpf.usermodel.XWPFDocument;
  21. import org.apache.poi.xwpf.usermodel.XWPFParagraph;
  22. import org.apache.poi.xwpf.usermodel.XWPFRun;
  23.  
  24. public class Operational_Functional_Block {
  25.     public static void main(String[] args) throws IOException {
  26.         File pathn1 = new File("C:/Users/Public/Operational_Functional_Block/src/com/obf_rex.docx");
  27.         if (!(new File(String.valueOf(pathn1)).exists())){
  28.             XWPFDocument docx1 = new XWPFDocument();
  29.             XWPFParagraph par1 = docx1.createParagraph();
  30.             par1.setAlignment(ParagraphAlignment.CENTER);
  31.             XWPFRun run1 = par1.createRun();
  32.             run1.setText("Rocket Engine Generator");
  33.             run1.setFontFamily("Calibri");
  34.             run1.setBold(true);
  35.             run1.setFontSize(33);
  36.             run1.setTextPosition(60);
  37.             // -----------------------------------------------------------------------------
  38.             XWPFParagraph par2 = docx1.createParagraph();
  39.             par2.setAlignment(ParagraphAlignment.RIGHT);
  40.             XWPFRun run2 = par2.createRun();
  41.             LocalDateTime date = LocalDateTime.now();
  42.             DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MMM yyyy, HH:mm:ss");
  43.             String dt = date.format(formatter);
  44.             run2.setText("Created on: " + dt);
  45.             run2.setFontFamily("Calibri");
  46.             run2.setBold(true);
  47.             run2.setFontSize(10);
  48.             run2.setTextPosition(60);
  49.             // ----------------------------------------------------------------------------------------------------
  50.             try (FileOutputStream out1 = new FileOutputStream(String.valueOf(pathn1))) {
  51.                 docx1.write(out1);
  52.                 out1.close();
  53.                 docx1.close();
  54.             }
  55.         }
  56.         int i = 1;
  57.         System.out.println("Welcome to the rocket engine generator!" + '\n');
  58.         Scanner scanner = new Scanner(System.in);
  59.         String repeatCommand = "Y";
  60.         while (!repeatCommand.equals("N")) {
  61.             System.out.println("Do you want to generate a new engine? [Y/N]");
  62.             System.out.print("> ");
  63.             repeatCommand = scanner.next();
  64.             repeatCommand = repeatCommand.toUpperCase();
  65.             if (repeatCommand.equals("N")) {
  66.                 System.exit(0);
  67.             } else if (repeatCommand.equals("Y")) {
  68.                 double sizeInbytes = pathn1.length();
  69.                 double sizeInKilobytes = (sizeInbytes/1000);
  70.                 if (sizeInKilobytes < 50) {
  71.                     System.out.println("size" + "------>" + pathn1.length());
  72.                 } else {
  73.                     File logM = new File("C:/Users/Public/Operational_Functional_Block/src/com/Data");
  74.                     logM.mkdir();
  75.                     // ------------------------------
  76.                     Path normPF = Path.of(String.valueOf(pathn1));
  77.                     if ((new File("C:/Users/Public/Operational_Functional_Block/src/com/Data/obf_rex[Full].docx")).exists()) {
  78.                         Path logPF = Paths.get("C:/Users/Public/Operational_Functional_Block/src/com/Data/obf_rex[Full]" + i + ".docx");
  79.                         Files.copy(normPF, logPF);
  80.                         i++;
  81.                     } else {
  82.                         Path logPF = Paths.get("C:/Users/Public/Operational_Functional_Block/src/com/Data/obf_rex[Full].docx");
  83.                         Files.copy(normPF, logPF);
  84.                     }
  85.                     XWPFDocument docx1 = new XWPFDocument();
  86.                     XWPFParagraph par1 = docx1.createParagraph();
  87.                     par1.setAlignment(ParagraphAlignment.CENTER);
  88.                     XWPFRun run1 = par1.createRun();
  89.                     run1.setText("Rocket Engine Generator");
  90.                     run1.setFontFamily("Calibri");
  91.                     run1.setBold(true);
  92.                     run1.setFontSize(33);
  93.                     run1.setTextPosition(60);
  94.                     // -----------------------------------------------------------------------------
  95.                     XWPFParagraph par2 = docx1.createParagraph();
  96.                     par2.setAlignment(ParagraphAlignment.RIGHT);
  97.                     XWPFRun run2 = par2.createRun();
  98.                     LocalDateTime date = LocalDateTime.now();
  99.                     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MMM yyyy, HH:mm:ss");
  100.                     String dt = date.format(formatter);
  101.                     run2.setText("Created on: " + dt);
  102.                     run2.setFontFamily("Calibri");
  103.                     run2.setBold(true);
  104.                     run2.setFontSize(10);
  105.                     run2.setTextPosition(60);
  106.                     // ----------------------------------------------------------------------------------------------------
  107.                     FileOutputStream out1 = new FileOutputStream(String.valueOf(pathn1));
  108.                     docx1.write(out1);
  109.                     out1.close();
  110.                     docx1.close();
  111.                 }
  112.                 // Arrays
  113.                 String lbrk = "////////////////////////////////////////////////////////////////";
  114.                 String[] engine_Name1 = {"\"Argosy\"", "\"Galileo\"", "\"Callisto\"", "\"Nauka\"",
  115.                         "\"Rassvet\"", "\"Zvezda\"", "\"Zarya\"", "\"Orion\"", "\"Ares\"", "\"Delta\"", "\"Atlas\"",
  116.                         "\"Daedalus\"", "\"Baltia\"", "\"Dizhou\"", "\"Hermes\"", "\"Icarus\"", "\"Connestoga\"", "\"Yupiter\"",
  117.                         "\"Emphasis\"", "\"Olympus\"", "\"Kronos\"", "\"Helios\"", "\"Alabaster\"", "\"Falcon\"",
  118.                         "\"Eagle\"", "\"Endeavour\"", "\"Atlantis\"", "\"Cygnus\"", "\"Apollo\"", "\"Horizon\"",
  119.                         "\"Pioneer\"", "\"Voyager\"", "\"Exploration\"", "\"Expedition\"", "\"Vulcan\"",
  120.                         "\"Federation\"", "\"Sojourner\"", "\"Nautilus\"", "\"Jubilance\"", "\"Lagrange\"",
  121.                         "\"Prometheus\"", "\"Tellus\"", "\"Alpha\"", "\"Delta\"", "\"Proton\"", "\"Neutron\"",
  122.                         "\"Electron\"", "\"Pluton\"", "\"Poodle\"", "\"Skipper\"", "\"Convair\"", "\"Nexus\"",
  123.                         "\"Vector\"", "\"Terrier\"", "\"Rhino\"", "\"Panther\"", "\"Goliath\"", "\"Juno\"", "\"Shrimp\"",
  124.                         "\"Thumper\"", "\"Mainsail\"", "\"Dart\"", "\"Twitch\"", "\"Stratus\"", "\"Oscar\"",
  125.                         "\"Sentinel\"", "\"Pegasus\"", "\"Kelus\"", "\"Starshot\"", "\"Vernor\"", "\"Mammoth\"",
  126.                         "\"Douglas\"", "\"Heimdall\"", "\"Dynetics\"", "\"Pathfinder\"", "\"Horizon\"", "\"Poisk\"",
  127.                         "\"Pirs\"", "\"Philae\"", "\"Mariner\"", "\"Centaur\"", "\"Orel\"", "\"Pratt\"", "\"Hyperion\"",
  128.                         "\"Sagittarius\"", "\"Apollo\"", "\"Bryton\"", "\"Volga\"", "\"Harmony\"", "\"Cassini\"", "\"Contour\"",
  129.                         "\"Altair\"", "\"Dream\"", "\"Baikal\"", "\"Zenith\"", "\"Urpinod\"", "\"Bernal\"", "\"Condor\"",
  130.                         "\"Athena\"", "\"Astra\"", "\"Aerolus\"", "\"Rombus\"", "\"Lunokhod\"", "\"Fregat\"", "\"Glonass\"",
  131.                         "\"Dragon\"", "\"Salyut\"", "\"Starliner\"", "\"Skylab\"", "\"Briz\"", "\"Colombus\"", "\"Rosetta\"",
  132.                         "\"Redstone\"", "\"Antares\"", "\"Philae\"", "\"Prospero\"", "\"Leonardo\"", "\"Parker\"", "\"Dyson\"",
  133.                         "\"Oberon\"", "\"DragonFly\"", "\"Energia\"", "\"Buran\"", "\"Urgan\"", "\"Angara\"", "\"Vostok\"",
  134.                         "\"Voskhod\"", "\"Shenzhou\"", "\"Ingenuity\"", "\"Oberon\"", "\"Discovery\"", "\"Horizon\"",
  135.                         "\"Cerasus\"", "\"Progress\"", "\"Unity\"", "\"Surveyor\"", "\"Prospector\"", "\"Ikar\"", "\"Redstone\"",
  136.                         "\"Lapis\"", "\"Caesius\"", "\"Iridium\"", "\"Daedlus\"", "\"Aelita\"", "\"Beta\"", "\"Gamma\"",
  137.                         "\"Alpha\"", "\"Epsilon\"", "\"Omega\"", "\"Discoverer\"", "\"Explorer\"", "\"Hornet\"", "\"Serenity\"",
  138.                         "\"Ariane\"", "\"Hornet\"", "\"Asimov\"", "\"Pegasus\"", "\"Venture\"", "\"Antares\"", "\"Star\"",
  139.                         "\"Archimedes\"", "\"Hera\"", "\"Iris\"", "\"Titan\"", "\"Artemis\"", "\"Phoenix\"", "\"Ross\"",
  140.                         "\"Sarychev\"", "\"Nemesis\"", "\"Heimdall\"", "\"Sturt\"", "\"Odin\"", "\"Aethelred\"", "\"Vesper\"",
  141.                         "\"Aces\"", "\"Argon\"", "\"Olympia\"", "\"Perseus\"", "\"Chyron\"", "\"Proxima\"", "\"Arminus\"",
  142.                         "\"Destiny\"", "\"Valient\"", "\"FireFly\"", "\"Obsidian\"", "\"Leviathan\"", "\"Magellan\"", "\"Voyager\"",
  143.                         "\"Mariner\"", "\"Joist\"", "\"Crimson\"", "\"Fortune\"", "\"Vanguard\"", "\"Aurora\"", "\"Ulysses\"",
  144.                         "\"Crusader\"", "\"Python\"", "\"Kuiper\"", "\"Insurgent\"", "\"Pathfinder\"", "\"Kvant\"", "\"Spektr\"",
  145.                         "\"Cassini\"", "\"Zemlya\"", "\"Dawn\"", "\"Kepler\"", "\"Parom\"", "\"Elektron\"", "\"Aeonian\"",
  146.                         "\"Node\"", "\"Burya\"", "\"Voyager\"", "\"Ceres\"", "\"Bayern\"", "\"Chasovoy\"", "\"Copernicus\"",
  147.                         "\"Quaoar\"", "\"Minotaur\"", "\"Agena\"", "\"Thor\"", "\"Vega\"", "\"Scout\"", "\"Coeus\"", "\"Minerva\"",
  148.                         "\"Kratos\"", "\"Neith\"", "\"Omoikane\"", "\"Gayamun\"", "\"Odin\"", "\"Kronos\"", "\"Hope\"", "\"Polet\"",
  149.                         "\"Polyot\"", "\"Sputnik\"", "\"Clementine\"", "\"Sojourner\"", "\"Ingenuity\"", "\"Perseverence\"", "\"Insider\"",
  150.                         "\"Onatchesko\"", "\"Atlantis\"", "\"Tsyklon\"", "\"Zenit\"", "\"Almaz\"", "\"Soyuz\"", "\"Molniya\"", "\"Kosmos\"",
  151.                         "\"Oreol\"", "\"Yantar\"", "\"Foton\"", "\"Meteor\"", "\"Ekran\"", "\"Strela\"", "\"Bion\"", "\"Piroda\"",
  152.                         "\"Salyut\"", "\"Strela\"", "\"Luch\"", "\"Potok\"", "\"Prognoz\"", "\"Orlets\"", "\"Etalon\"", "\"Astron\"",
  153.                         "\"Efir\"", "\"Kometa\"", "\"Fram\"", "\"Zemlya\"", "\"Gorizont\"", "\"Arkon\"", "\"Gamma\"", "\"Ekspress\"",
  154.                         "\"Gonets\"", "\"Taifun\"", "\"Okean\"", "\"Reflektor\"", "\"Kolibr\"", "\"Sever\"", "\"Comet\"",
  155.                         "\"Roton\"", "\"Solaris\"", "\"Altaris\"", "\"Ithacus\"", "\"Dekto\"", "\"Dream\"", "\"Impuls\"",
  156.                         "\"Vremya\"", "\"Portal\"", "\"Zodiak\"", "\"Slava\"", "\"Inertsiya\"", "\"Stimuls\"", "\"Ambross\"",
  157.                         "\"Amal\"", "\"Thea\"", "\"Orphelia\"", "\"Polyot\"", "\"Mudrost\"", "\"Carrack\"", "\"Artak\"",
  158.                         "\"Questar\"", "\"Artyom\"", "\"Tsyclon\"", "\"Ascension\"", "\"Tenacity\"", "\"Contour\"", "\"Zephyr\"",
  159.                         "\"Atlanta\"", "\"Polaris\"", "\"Aeolus\"", "\"Mayak\"", "\"Pamir\"", "\"Taimyr\"", "\"Cheget\"", "\"Sirius\"",
  160.                         "\"Uragan\"", "\"Agat\"", "\"Skiph\"", "\"Kristall\"", "\"Altair\"", "\"Uran\"", "\"Ingul\"", "\"Carat\"",
  161.                         "\"Pulsar\"", "\"Titan\"", "\"Eridanus\"", "\"Parus\"", "\"Cepheus\"", "\"Varagian\"", "\"Olympus\"",
  162.                         "\"Tarkhaniy\"", "\"Astraeus\"", "\"Antares\"", "\"Kazbek\"", "\"Burlak\"", "\"Borei\"", "\"Favor\"",
  163.                         "\"Rubin\"", "\"Almaz\"", "\"Granit\"", "\"Ruby\"", "\"Sokol\"", "\"Argon\"", "\"Kavkaz\"", "\"Ural\"",
  164.                         "\"Berkut\"", "\"Dunay\"", "\"Yastreb\"", "\"Terek\"", "\"Radon\"", "\"Taymyr\"", "\"Pamir\"", "\"Photon\"",
  165.                         "\"Elbrus\"", "\"Isayiev\"", "\"Shmel\"", "\"Kobra\"", "\"Shturn\"", "\"Metis\"", "\"Malyutka\"", "\"Fleyta\"",
  166.                         "\"Konkurs\"", "\"Bastion\"", "\"Svir\"", "\"Ataka\"", "\"Vodopad\"", "\"Veter\"", "\"Vyuga\"", "\"Vulga\"",
  167.                         "\"Tochka\"", "\"Oka\"", "\"Dvina\"", "\"Almaz\"", "\"Araks\"", "\"Kanopus\"", "\"Kliper\"", "\"Kobalt\"",
  168.                         "\"Siluet\"", "\"Kondor\"", "\"Lotos\"", "\"Luch\"", "\"Mir\"", "\"Neman\"", "\"Obzor\"", "\"Okean\"", "\"Oko\"",
  169.                         "\"Oktan\"", "\"Orlets\"", "\"Poisk\"", "\"Potok\"", "\"Pirs\"", "\"Prognoz\"", "\"Resurs\"", "\"Rodnik\"",
  170.                         "\"Romb\"", "\"Kapustin\"", "\"Oplot\"", "\"Tsygan\"", "\"Teplokhod\"", "\"Sokosha\"", "\"Rubezh\"", "\"Topol\"",
  171.                         "\"Zircon\"", "\"Moskva\"", "\"Tryol\"", "\"Ustinov\"", "\"Belyayev\"", "\"Novorod\"", "\"Argos\"", "\"Dreadnought\"",
  172.                         "\"Nerthus\"", "\"Janus\"", "\"Hephaestus\"", "\"Themis\"", "\"Chronos\"", "\"Tethys\"", "\"Minos\"", "\"Visionalis\"",
  173.                         "\"Autumn\"", "\"Resilience\"", "\"Aelita\"", "\"Rheus\"", "\"Solntspek\"", "\"Spitzer\"", "\"Cartago\"", "\"Liberty\"",
  174.                         "\"Melibea\"", "\"Spartacus\"", "\"Pulsar\"", "\"Fusion\"", "\"Reliant\"", "\"Thunder\"", "\"Novo\"", "\"Granis\"",
  175.                         "\"Panthera\"", "\"Nematoda\"", "\"Anelida\"", "\"Chordata\"", "\"Tetrapoda\"", "\"Cyclero\"", "\"Carrier\"", "\"Saturn\"",
  176.                         "\"Gaia\"", "\"Irtysh\"", "\"Wyvern\"", "\"Tarsier\"", "\"Alpina\"", "\"Espadon\"", "\"Parlos\"", "\"Nebula\"",
  177.                         "\"Lazarus\"", "\"Rufus\"", "\"Dornier\"", "\"Argus\"", "\"Kybau\"", "\"Kalau\"", "\"Chasvoy\"", "\"Zephyr\"",
  178.                         "\"Temny\"", "\"Gorizont\"", "\"Yars\"", "\"Krugazor\"", "\"Soprotivlenye\"", "\"Shtil\"", "\"Layner\"", "\"Bulava\"",
  179.                         "\"Vysota\"", "\"Volna\""};
  180.                 String[] engine_Cycle = {"Gas Generator", "Staged Combustion (oxidizer Rich)", "Staged Combustion (Fuel Rich)",
  181.                                          "Expander (Open)", "Expander (Closed)", "Dual Expander (Open)", "Dual Expander (Closed)",
  182.                                          "Pressure-Fed", "Full Flow Staged", "Electric Pump Fed", "Combustion Tap Off",
  183.                                          "Monopropellant (Cold Gas)", "Monopropellant (Decomposition)", "Gas Core", "Liquid Core",
  184.                                          "Solid Core", "Pulsed Nuclear", "Pebble-Bed", "Nuclear SaltWater"};
  185.                 String[] propellant_List1 = {"H2O2 (Hydrogen Peroxide)", "N2H4 (Hydrazine)", "NH2OH+NO3 (Hydroxyl ammonium nitrate)"};
  186.                 String[] propellant_List2 = {"Nitrogen (N2)", "Helium (He)", "Carbon Dioxide (CO2)", "Ammonia (NH3)", "Hydrogen (H2)",
  187.                                              "Methane (CH4)"};
  188.                 String[] propellant_List3 = {"Hydrogen (H2)", "Helium (He)", "Nitrogen (N2)", "Hydrogen (H)", "Ammonia (NH3)",
  189.                                              "Water (H2O)", "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)",
  190.                                              "Methane (CH4)"};
  191.                 String[] altitude_Of_Operation = {"0-10 km (Sea Level)", "20-30 km (Medium Atmosphere)",
  192.                                                   "30-80 km (High Atmosphere)", "80 km+ (Vacuum)", "Any Altitude (0-80 km+)"};
  193.                 String[] tank_Repressurisation = {"Autogenously", "using Inert gas"};
  194.                 String[] nozzle_Type_List1 = {"De Laval Cone (Without Nozzle Extension)",
  195.                                               "De Laval Bell (Without Nozzle Extension)"};
  196.                 String[] firstPart = {"RD", "RS", "AJ", "XLR", "NK", "RL", "KDTU", "AR", "BE", "MV",
  197.                                       "YF", "PKA", "TQ", "MJ", "XS", "LM10", "HM", "LE", "LRE", "CE", "DST",
  198.                                       "DOK", "KDU", "KRD", "R", "RO"};
  199.  
  200.                 // Randomise Arrays
  201.                 boolean Flagger;
  202.                 String engine_Name = "";
  203.                 if (new File("C:/Users/sfsga/IdeaProjects/demo/obf_rex.docx").exists()) {
  204.                     Flagger = true;
  205.                     while (Flagger) {
  206.                         Collections.shuffle(Arrays.asList(engine_Name1));
  207.                         Collections.shuffle(Arrays.asList(firstPart));
  208.                         Random engineNameChosen = new Random();
  209.                         Random firstPartC = new Random();
  210.                         int engineNameChosen_index = engineNameChosen.nextInt(engine_Name1.length);
  211.                         int firstPart_index = firstPartC.nextInt(firstPart.length);
  212.                         String engNameFinalf = " " + engine_Name1[engineNameChosen_index];
  213.                         String firstPart_f = firstPart[firstPart_index] + "-";
  214.                         // Find number
  215.                         int finalNumber = 10 + ((int) (Math.random() * 1001));
  216.                         // is it eligible for letter at end = NO!
  217.                         if (finalNumber % 8 == 0) {
  218.                             engine_Name = firstPart_f + finalNumber + engNameFinalf;
  219.                         } else {
  220.                             char randomizedCharacter;
  221.                             int uio93 = 1 + ((int) (Math.random() * 1001));
  222.                             int uio94 = 1 + ((int) (Math.random() * 11));
  223.                             Random randomLetter = new Random();
  224.                             if (uio93 % uio94 == 0) {
  225.                                 randomizedCharacter = (char) (randomLetter.nextInt(26) + 'a');
  226.                                 while (randomizedCharacter == 'o' || randomizedCharacter == 'i'|| randomizedCharacter == 'q'|| randomizedCharacter == 'e'|| randomizedCharacter == 'h'|| randomizedCharacter == 'g'|| randomizedCharacter == 'c'|| randomizedCharacter == 'j') {
  227.                                     randomizedCharacter = (char) (randomLetter.nextInt(26) + 'a');
  228.                                     if (randomizedCharacter == 'o' || randomizedCharacter == 'i'|| randomizedCharacter == 'q'|| randomizedCharacter == 'e'|| randomizedCharacter == 'h'|| randomizedCharacter == 'g'|| randomizedCharacter == 'c'|| randomizedCharacter == 'j') {
  229.                                         break;
  230.                                     }
  231.                                 }
  232.                             }
  233.                             else {
  234.                                 randomizedCharacter = (char) (randomLetter.nextInt(26) + 'A');
  235.                                 while (randomizedCharacter == 'O' || randomizedCharacter == 'I'|| randomizedCharacter == 'Q') {
  236.                                     randomizedCharacter = (char) (randomLetter.nextInt(26) + 'A');
  237.                                     if (randomizedCharacter == 'O' || randomizedCharacter == 'I'|| randomizedCharacter == 'Q') {
  238.                                         break;
  239.                                     }
  240.                                 }
  241.                             }
  242.                             engine_Name = firstPart_f + finalNumber + randomizedCharacter + engNameFinalf;
  243.                         }
  244.                         try {
  245.                             File fila = new File("C:/Users/sfsga/IdeaProjects/demo/obf_rex.docx");
  246.                             Scanner reader = new Scanner(fila);
  247.                             while (reader.hasNextLine()) {
  248.                                 String data = reader.nextLine();
  249.                                 Flagger = data.equals(engine_Name);
  250.                             }
  251.                             reader.close();
  252.  
  253.                         } catch (FileNotFoundException e) {
  254.                             e.printStackTrace();
  255.                         }
  256.                     }
  257.  
  258.                 } else {
  259.                     Collections.shuffle(Arrays.asList(engine_Name1));
  260.                     Collections.shuffle(Arrays.asList(firstPart));
  261.                     Random engineNameChosen = new Random();
  262.                     Random firstPartC = new Random();
  263.                     int engineNameChosen_index = engineNameChosen.nextInt(engine_Name1.length);
  264.                     int firstPart_index = firstPartC.nextInt(firstPart.length);
  265.                     String engNameFinalf = " " + engine_Name1[engineNameChosen_index];
  266.                     String firstPart_f = firstPart[firstPart_index] + "-";
  267.                     int finalNumber = 12 + ((int) (Math.random() * 1001));
  268.                     if (finalNumber % 8 == 0) {
  269.                         engine_Name = firstPart_f + finalNumber + engNameFinalf;
  270.                     }
  271.                     else {
  272.                     char randomizedCharacter;
  273.                     int uio93 = 1 + ((int) (Math.random() * 1001));
  274.                     int uio94 = 1 + ((int) (Math.random() * 11));
  275.                     Random randomLetter = new Random();
  276.                     if (uio93 % uio94 == 0) {
  277.                         randomizedCharacter = (char) (randomLetter.nextInt(26) + 'a');
  278.                         while (randomizedCharacter == 'o' || randomizedCharacter == 'i'|| randomizedCharacter == 'q'|| randomizedCharacter == 'e'|| randomizedCharacter == 'h'|| randomizedCharacter == 'g'|| randomizedCharacter == 'c'|| randomizedCharacter == 'j') {
  279.                             randomizedCharacter = (char) (randomLetter.nextInt(26) + 'a');
  280.                             if (randomizedCharacter == 'o' || randomizedCharacter == 'i'|| randomizedCharacter == 'q'|| randomizedCharacter == 'e'|| randomizedCharacter == 'h'|| randomizedCharacter == 'g'|| randomizedCharacter == 'c'|| randomizedCharacter == 'j') {
  281.                                 break;
  282.                             }
  283.                         }
  284.                     }
  285.                     else {
  286.                         randomizedCharacter = (char) (randomLetter.nextInt(26) + 'A');
  287.                         while (randomizedCharacter == 'O' || randomizedCharacter == 'I'|| randomizedCharacter == 'Q') {
  288.                             randomizedCharacter = (char) (randomLetter.nextInt(26) + 'A');
  289.                             if (randomizedCharacter == 'O' || randomizedCharacter == 'I'|| randomizedCharacter == 'Q') {
  290.                                 break;
  291.                             }
  292.                         }
  293.                     }
  294.                     engine_Name = firstPart_f + finalNumber + randomizedCharacter + engNameFinalf;
  295.                 }
  296.                 }
  297.                 Collections.shuffle(Arrays.asList(engine_Cycle));
  298.                 Random engineCycleChosen = new Random();
  299.                 int engineTypeChosen_index = engineCycleChosen.nextInt(engine_Cycle.length);
  300.                 String engine_Cycle_Chosen = engine_Cycle[engineTypeChosen_index];
  301.  
  302.                 switch (engine_Cycle_Chosen) {
  303.                     case "Gas Core", "Liquid Core", "Solid Core", "Pulsed Nuclear", "Nuclear SaltWater", "Pebble-Bed Core" -> {
  304.                         String propellant_List_Chosen;
  305.                         String nuclear_Cycle_Chosen;
  306.                         String reactor_Fuel_Chosen;
  307.                         String nozzle_Type_List_Chosen;
  308.                         switch (engine_Cycle_Chosen) {
  309.                             case "Gas Core" -> {
  310.                                 String[] remass_List = {"Hydrogen (H2)", "Nitrogen (N2)", "Monoatomic Hydrogen (H)", "Ammonia (NH3)",
  311.                                         "Water (H2O)", "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)",
  312.                                         "Methane (CH4)"};
  313.                                 Collections.shuffle(Arrays.asList(remass_List));
  314.                                 Random remassChosen = new Random();
  315.                                 int remassChosen_index = remassChosen.nextInt(remass_List.length);
  316.                                 String remass_List_Chosen = remass_List[remassChosen_index];
  317.                                 propellant_List_Chosen = "Uranium HexaFluoride Salt (UF6) and " + remass_List_Chosen + " as remass";
  318.                                 // Nuclear Cycle (Nuclear Thermal)
  319.                                 String[] nuclear_cycle1 = {"\"Expander Bleed\"", "\"Expander Closed\"", "\"Nuclear Lightbulb\"", "\"Vortex Confined\"",
  320.                                         "\"Wheel Flow\"", "\"Magnetohydrodynamic(MHD) vortex\"", "\"Expander Open\""};
  321.                                 Collections.shuffle(Arrays.asList(nuclear_cycle1));
  322.                                 Random nuclearCycleChosen = new Random();
  323.                                 int nuclearCycleChosen_index = nuclearCycleChosen.nextInt(nuclear_cycle1.length);
  324.                                 nuclear_Cycle_Chosen = nuclear_cycle1[nuclearCycleChosen_index];
  325.                                 // Reactor Fuel (Nuclear Thermal)
  326.                                 String[] reactor_fuel = {"100-90% Uranium-235", "50% Uranium-235", "25-8% Uranium-235", "1-2% Uranium-235"};
  327.                                 Collections.shuffle(Arrays.asList(reactor_fuel));
  328.                                 Random reactorfuelChosen = new Random();
  329.                                 int reactorfuelChosen_index = reactorfuelChosen.nextInt(reactor_fuel.length);
  330.                                 reactor_Fuel_Chosen = reactor_fuel[reactorfuelChosen_index];
  331.                                 // Nozzle Type (Nuclear Thermal)
  332.                                 nozzle_Type_List_Chosen = "De Laval Bell (With Nozzle Extension)";
  333.                             }
  334.                             case "Liquid Core", "Colloid-Core", "Pebble-Bed Core" -> {
  335.                                 // Remass (Nuclear Thermal)
  336.                                 String[] remass_List2 = {"Hydrogen (H2)", "Nitrogen (N2)", "Monoatomic Hydrogen (H)", "Ammonia (NH3)",
  337.                                         "Water (H2O)", "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)",
  338.                                         "Methane (CH4)", "Hydrogen (H2) + Hexane (C6H14)"};
  339.                                 Collections.shuffle(Arrays.asList(remass_List2));
  340.                                 Random remassChosen = new Random();
  341.                                 int remassChosen_index = remassChosen.nextInt(remass_List2.length);
  342.                                 String remass_List_Chosen = remass_List2[remassChosen_index];
  343.                                 propellant_List_Chosen = "Uranium HexaFluoride Salt (UF6) and " + remass_List_Chosen + " as a remass";
  344.                                 // Nuclear Cycle (Nuclear Thermal)
  345.                                 String[] nuclear_cycle1 = {"\"Expander Bleed\"", "\"Expander Closed\"", "\"Vortex Confined\"", "\"Expander Open\""};
  346.                                 Collections.shuffle(Arrays.asList(nuclear_cycle1));
  347.                                 Random nuclearCycleChosen = new Random();
  348.                                 int nuclearCycleChosen_index = nuclearCycleChosen.nextInt(nuclear_cycle1.length);
  349.                                 nuclear_Cycle_Chosen = nuclear_cycle1[nuclearCycleChosen_index];
  350.                                 // Reactor Fuel (Nuclear Thermal)
  351.                                 String[] reactor_fuel = {"100-90% Uranium-235", "50% Uranium-235", "25-8% Uranium-235", "1-2% Uranium-235"};
  352.                                 Collections.shuffle(Arrays.asList(reactor_fuel));
  353.                                 Random reactorfuelChosen = new Random();
  354.                                 int reactorfuelChosen_index = reactorfuelChosen.nextInt(reactor_fuel.length);
  355.                                 reactor_Fuel_Chosen = reactor_fuel[reactorfuelChosen_index];
  356.                                 // Nozzle Type (Nuclear Thermal)
  357.                                 nozzle_Type_List_Chosen = "De Laval Bell (With Nozzle Extension)";
  358.                             }
  359.                             case "Nuclear SaltWater" -> {
  360.                                 propellant_List_Chosen = "Uranium TetraBromide (UBr4) + Water (H2O)";
  361.                                 nuclear_Cycle_Chosen = "";
  362.                                 // Reactor Fuel (Nuclear Thermal)
  363.                                 String[] reactor_fuel = {"100-90% Uranium-235", "50% Uranium-235", "25-8% Uranium-235", "1-2% Uranium-235"};
  364.                                 Collections.shuffle(Arrays.asList(reactor_fuel));
  365.                                 Random reactorfuelChosen = new Random();
  366.                                 int reactorfuelChosen_index = reactorfuelChosen.nextInt(reactor_fuel.length);
  367.                                 reactor_Fuel_Chosen = reactor_fuel[reactorfuelChosen_index];
  368.                                 // Nozzle Type (Nuclear Thermal)
  369.                                 nozzle_Type_List_Chosen = "De Laval Bell (With Nozzle Extension)";
  370.                             }
  371.                             default -> {
  372.                                 // Propellant (Nuclear Thermal)
  373.                                 Collections.shuffle(Arrays.asList(propellant_List3));
  374.                                 Random propellantChosen = new Random();
  375.                                 int propellantChosen_index = propellantChosen.nextInt(propellant_List3.length);
  376.                                 propellant_List_Chosen = propellant_List3[propellantChosen_index];
  377.                                 // Nuclear Cycle (Nuclear Thermal)
  378.                                 String[] nuclear_cycle1 = {"\"Expander Bleed\"", "\"Expander Closed\"", "\"Expander Open\""};
  379.                                 Collections.shuffle(Arrays.asList(nuclear_cycle1));
  380.                                 Random nuclearCycleChosen = new Random();
  381.                                 int nuclearCycleChosen_index = nuclearCycleChosen.nextInt(nuclear_cycle1.length);
  382.                                 nuclear_Cycle_Chosen = nuclear_cycle1[nuclearCycleChosen_index];
  383.                                 // Reactor Fuel (Nuclear Thermal)
  384.                                 String[] reactor_fuel = {"100-90% Uranium-235", "50% Uranium-235", "20-8% Uranium-235", "1-2% Uranium-235",
  385.                                                          "100-90% Plutonium-238", "50% Plutonium-238", "25-8% Plutonium-238", "1-2% Plutonium-238"};
  386.                                 Collections.shuffle(Arrays.asList(reactor_fuel));
  387.                                 Random reactorfuelChosen = new Random();
  388.                                 int reactorfuelChosen_index = reactorfuelChosen.nextInt(reactor_fuel.length);
  389.                                 reactor_Fuel_Chosen = reactor_fuel[reactorfuelChosen_index];
  390.                                 // Nozzle Type (Nuclear Thermal)
  391.                                 nozzle_Type_List_Chosen = "De Laval Bell (With Nozzle Extension)";
  392.                             }
  393.                         }
  394.                         // Altitude of Operation (Nuclear Thermal)
  395.                         String altitude_Of_Operation_Chosen = "80 km+ (Vacuum)";
  396.                         // Tank Repressurisation (Nuclear Thermal)
  397.                         Collections.shuffle(Arrays.asList(tank_Repressurisation));
  398.                         Random tankRepressurisationChosen = new Random();
  399.                         int tankRepressurisationChosen_index = tankRepressurisationChosen.nextInt(tank_Repressurisation.length);
  400.                         String tank_Repressurisation_Chosen = tank_Repressurisation[tankRepressurisationChosen_index];
  401.                         // Beautiful Part (Nuclear Thermal)
  402.                         System.out.println(lbrk + "\n" + "Your Engine is called: " + engine_Name + "\n");
  403.                         System.out.println("Your Engine Cycle is: " + nuclear_Cycle_Chosen + " " + engine_Cycle_Chosen);
  404.                         System.out.println("Your Propellant is: " + propellant_List_Chosen);
  405.                         System.out.println("Your Reactor's Fuel is: " + reactor_Fuel_Chosen);
  406.                         System.out.println("Your Altitude of operation is: " + altitude_Of_Operation_Chosen);
  407.                         System.out.println("Your engine's nozzle type should be : " + nozzle_Type_List_Chosen);
  408.                         System.out.println("Tank repressurisation would be done " + tank_Repressurisation_Chosen + "\n");
  409.                         XWPFDocument docx = new XWPFDocument();
  410.                         if (new File(String.valueOf(pathn1)).exists()) {
  411.                             docx = new XWPFDocument(new FileInputStream(String.valueOf(pathn1)));
  412.                         }
  413.                         XWPFParagraph par = docx.createParagraph();
  414.                         XWPFRun run = par.createRun();
  415.                         run.setFontSize(12);
  416.                         run.setBold(true);
  417.                         run.setFontFamily("Calibri");
  418.                         run.setText("Your Engine is called: ");
  419.                         XWPFRun run2 = par.createRun();
  420.                         run2.setFontSize(12);
  421.                         run.setBold(true);
  422.                         run2.setFontFamily("Calibri");
  423.                         run2.setText(engine_Name);
  424.                         run2.addBreak();
  425.                         // -----------------------------------------------------------
  426.                         XWPFRun run3 = par.createRun();
  427.                         run3.setFontSize(10);
  428.                         run3.setBold(true);
  429.                         run3.setFontFamily("Calibri");
  430.                         run3.setText("Your Engine Cycle is: ");
  431.                         XWPFRun run4 = par.createRun();
  432.                         run4.setFontSize(10);
  433.                         run4.setFontFamily("Calibri");
  434.                         run4.setText(nuclear_Cycle_Chosen + " " + engine_Cycle_Chosen);
  435.                         run4.addBreak();
  436.                         // -----------------------------------------------------------
  437.                         XWPFRun run5 = par.createRun();
  438.                         run5.setFontSize(10);
  439.                         run5.setBold(true);
  440.                         run5.setFontFamily("Calibri");
  441.                         run5.setText("Your Propellant is: ");
  442.                         XWPFRun run6 = par.createRun();
  443.                         run6.setFontSize(10);
  444.                         run6.setFontFamily("Calibri");
  445.                         run6.setText(propellant_List_Chosen);
  446.                         run6.addBreak();
  447.                         // -----------------------------------------------------------
  448.                         XWPFRun run7 = par.createRun();
  449.                         run7.setFontSize(10);
  450.                         run7.setBold(true);
  451.                         run7.setFontFamily("Calibri");
  452.                         run7.setText("Your Reactor's Fission Fuel is: ");
  453.                         XWPFRun run8 = par.createRun();
  454.                         run8.setFontSize(10);
  455.                         run8.setFontFamily("Calibri");
  456.                         run8.setText(reactor_Fuel_Chosen);
  457.                         run8.addBreak();
  458.                         // -----------------------------------------------------------
  459.                         XWPFRun run9 = par.createRun();
  460.                         run9.setFontSize(10);
  461.                         run9.setBold(true);
  462.                         run9.setFontFamily("Calibri");
  463.                         run9.setText("Your engine's nozzle type should be: ");
  464.                         XWPFRun run0 = par.createRun();
  465.                         run0.setFontSize(10);
  466.                         run0.setFontFamily("Calibri");
  467.                         run0.setText(nozzle_Type_List_Chosen);
  468.                         run0.addBreak();
  469.                         // -----------------------------------------------------------
  470.                         XWPFRun run11 = par.createRun();
  471.                         run11.setFontSize(10);
  472.                         run11.setBold(true);
  473.                         run11.setFontFamily("Calibri");
  474.                         run11.setText("Tank repressurisation would be done ");
  475.                         XWPFRun run12 = par.createRun();
  476.                         run12.setFontSize(10);
  477.                         run12.setBold(true);
  478.                         run12.setFontFamily("Calibri");
  479.                         run12.setText(tank_Repressurisation_Chosen);
  480.                         run12.addBreak();
  481.                         // -----------------------------------------------------------
  482.                         try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
  483.                             docx.write(out);
  484.                         }
  485.  
  486.                     } case "Monopropellant (Decomposition)"-> {
  487.                         // Propellant (Decomposing Monopropellant)
  488.                         Collections.shuffle(Arrays.asList(propellant_List1));
  489.                         Random propellantChosen = new Random();
  490.                         int propellantChosen_index = propellantChosen.nextInt(propellant_List1.length);
  491.                         String propellant_List_Chosen = propellant_List1[propellantChosen_index];
  492.                         // Altitude of Operation (Decomposing Monopropellant)
  493.                         String altitude_Of_Operation_Chosen = "80 km+ (Vacuum)";
  494.                         // Nozzle Type (Decomposing Monopropellant)
  495.                         Collections.shuffle(Arrays.asList(nozzle_Type_List1));
  496.                         Random nozzle_chosen = new Random();
  497.                         int nozzleChosen_index = nozzle_chosen.nextInt(nozzle_Type_List1.length);
  498.                         String nozzle_Type_List_Chosen = nozzle_Type_List1[nozzleChosen_index];
  499.                         // Beautiful Part (Least non-ugly)
  500.                         System.out.println(lbrk + "\n" + "Your Engine is called: " + engine_Name + "\n");
  501.                         System.out.println("Your Engine Cycle is: " + engine_Cycle_Chosen);
  502.                         System.out.println("Your Propellant is: " + propellant_List_Chosen);
  503.                         System.out.println("Your Altitude of operation is: " + altitude_Of_Operation_Chosen);
  504.                         System.out.println("Your engine's nozzle type should be : " + nozzle_Type_List_Chosen);
  505.                         System.out.println("Tank repressurisation would be impractical and unnecessary" + "\n");
  506.                         XWPFDocument docx = new XWPFDocument();
  507.                         if (new File(String.valueOf(pathn1)).exists()) {
  508.                             docx = new XWPFDocument(new FileInputStream(String.valueOf(pathn1)));
  509.                         }
  510.                         XWPFParagraph par = docx.createParagraph();
  511.                         XWPFRun run = par.createRun();
  512.                         run.setFontSize(12);
  513.                         run.setBold(true);
  514.                         run.setFontFamily("Calibri");
  515.                         run.setText("Your Engine is called: ");
  516.                         XWPFRun run2 = par.createRun();
  517.                         run2.setFontSize(12);
  518.                         run.setBold(true);
  519.                         run2.setFontFamily("Calibri");
  520.                         run2.setText(engine_Name);
  521.                         run2.addBreak();
  522.                         // -----------------------------------------------------------
  523.                         XWPFRun run3 = par.createRun();
  524.                         run3.setFontSize(10);
  525.                         run3.setBold(true);
  526.                         run3.setFontFamily("Calibri");
  527.                         run3.setText("Your Engine Cycle is: ");
  528.                         XWPFRun run4 = par.createRun();
  529.                         run4.setFontSize(10);
  530.                         run4.setFontFamily("Calibri");
  531.                         run4.setText(engine_Cycle_Chosen);
  532.                         run4.addBreak();
  533.                         // -----------------------------------------------------------
  534.                         XWPFRun run5 = par.createRun();
  535.                         run5.setFontSize(10);
  536.                         run5.setBold(true);
  537.                         run5.setFontFamily("Calibri");
  538.                         run5.setText("Your Propellant is: ");
  539.                         XWPFRun run6 = par.createRun();
  540.                         run6.setFontSize(10);
  541.                         run6.setFontFamily("Calibri");
  542.                         run6.setText(propellant_List_Chosen);
  543.                         run6.addBreak();
  544.                         // -----------------------------------------------------------
  545.                         XWPFRun run9 = par.createRun();
  546.                         run9.setFontSize(10);
  547.                         run9.setBold(true);
  548.                         run9.setFontFamily("Calibri");
  549.                         run9.setText("Your engine's nozzle type should be: ");
  550.                         XWPFRun run0 = par.createRun();
  551.                         run0.setFontSize(10);
  552.                         run0.setFontFamily("Calibri");
  553.                         run0.setText(nozzle_Type_List_Chosen);
  554.                         run0.addBreak();
  555.                         // -----------------------------------------------------------
  556.                         XWPFRun run11 = par.createRun();
  557.                         run11.setFontSize(10);
  558.                         run11.setBold(true);
  559.                         run11.setFontFamily("Calibri");
  560.                         run11.setText("Tank repressurisation would be impractical and unnecessary");
  561.                         run11.addBreak();
  562.                         // -----------------------------------------------------------
  563.                         try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
  564.                             docx.write(out);
  565.                         }
  566.  
  567.                     } case "Monopropellant (Cold Gas)" -> {
  568.                         Collections.shuffle(Arrays.asList(propellant_List2));
  569.                         Random propellantChosen = new Random();
  570.                         int propellantChosen_index = propellantChosen.nextInt(propellant_List2.length);
  571.                         String propellant_List_Chosen = propellant_List2[propellantChosen_index];
  572.                         // Altitude of Operation (Decomposing Monopropellant)
  573.                         String altitude_Of_Operation_Chosen = "80 km+ (Vacuum)";
  574.                         // Nozzle Type (Decomposing Monopropellant)
  575.                         Collections.shuffle(Arrays.asList(nozzle_Type_List1));
  576.                         Random nozzle_chosen = new Random();
  577.                         int nozzleChosen_index = nozzle_chosen.nextInt(nozzle_Type_List1.length);
  578.                         String nozzle_Type_List_Chosen = nozzle_Type_List1[nozzleChosen_index];
  579.                         // Beautiful Part (Least non-ugly)
  580.                         System.out.println(lbrk + "\n" + "Your Engine is called: " + engine_Name + "\n");
  581.                         System.out.println("Your Engine Cycle is: " + engine_Cycle_Chosen);
  582.                         System.out.println("Your Propellant is: " + propellant_List_Chosen);
  583.                         System.out.println("Your Altitude of operation is: " + altitude_Of_Operation_Chosen);
  584.                         System.out.println("Your engine's nozzle type should be : " + nozzle_Type_List_Chosen);
  585.                         System.out.println("Tank repressurisation would be impractical and unnecessary" + "\n");
  586.                         XWPFDocument docx = new XWPFDocument();
  587.                         if (new File(String.valueOf(pathn1)).exists()) {
  588.                             docx = new XWPFDocument(new FileInputStream(String.valueOf(pathn1)));
  589.                         }
  590.                         XWPFParagraph par = docx.createParagraph();
  591.                         XWPFRun run = par.createRun();
  592.                         run.setFontSize(12);
  593.                         run.setBold(true);
  594.                         run.setFontFamily("Calibri");
  595.                         run.setText("Your Engine is called: ");
  596.                         XWPFRun run2 = par.createRun();
  597.                         run2.setFontSize(12);
  598.                         run.setBold(true);
  599.                         run2.setFontFamily("Calibri");
  600.                         run2.setText(engine_Name);
  601.                         run2.addBreak();
  602.                         // -----------------------------------------------------------
  603.                         XWPFRun run3 = par.createRun();
  604.                         run3.setFontSize(10);
  605.                         run3.setBold(true);
  606.                         run3.setFontFamily("Calibri");
  607.                         run3.setText("Your Engine Cycle is: ");
  608.                         XWPFRun run4 = par.createRun();
  609.                         run4.setFontSize(10);
  610.                         run4.setFontFamily("Calibri");
  611.                         run4.setText(engine_Cycle_Chosen);
  612.                         run4.addBreak();
  613.                         // -----------------------------------------------------------
  614.                         XWPFRun run5 = par.createRun();
  615.                         run5.setFontSize(10);
  616.                         run5.setBold(true);
  617.                         run5.setFontFamily("Calibri");
  618.                         run5.setText("Your Propellant is: ");
  619.                         XWPFRun run6 = par.createRun();
  620.                         run6.setFontSize(10);
  621.                         run6.setFontFamily("Calibri");
  622.                         run6.setText(propellant_List_Chosen);
  623.                         run6.addBreak();
  624.                         // -----------------------------------------------------------
  625.                         XWPFRun run9 = par.createRun();
  626.                         run9.setFontSize(10);
  627.                         run9.setBold(true);
  628.                         run9.setFontFamily("Calibri");
  629.                         run9.setText("Your engine's nozzle type should be: ");
  630.                         XWPFRun run0 = par.createRun();
  631.                         run0.setFontSize(10);
  632.                         run0.setFontFamily("Calibri");
  633.                         run0.setText(nozzle_Type_List_Chosen);
  634.                         run0.addBreak();
  635.                         // -----------------------------------------------------------
  636.                         XWPFRun run11 = par.createRun();
  637.                         run11.setFontSize(10);
  638.                         run11.setBold(true);
  639.                         run11.setFontFamily("Calibri");
  640.                         run11.setText("Tank repressurisation would be impractical and unnecessary");
  641.                         run11.addBreak();
  642.                         // -----------------------------------------------------------
  643.                         try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
  644.                             docx.write(out);
  645.                         }
  646.  
  647.                     } case "Expander (Closed)", "Expander (Open)" -> {
  648.                         String[] oxidizer_List2 = {"O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)",
  649.                                 "O3 (Ozone)"};
  650.                         Collections.shuffle(Arrays.asList(oxidizer_List2));
  651.                         Random oxidizerChosen = new Random();
  652.                         int oxidizerChosen_index = oxidizerChosen.nextInt(oxidizer_List2.length);
  653.                         String oxidizer_Chosen = oxidizer_List2[oxidizerChosen_index];
  654.                         String fuel_Chosen = "";
  655.                         switch (oxidizer_Chosen) {
  656.                             case "O2 (Oxygen)" -> {
  657.                                 String[] fuel_List20 = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 85%", "C2H5OH(Ethanol) 75%",
  658.                                         "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
  659.                                         "CH3OH (Methanol)", "C12H24 (Kerosene)", "B2H6 (Diborane)", "B5H9 (Pentaborane)", "C2H6 (Ethane)"};
  660.                                 Collections.shuffle(Arrays.asList(fuel_List20));
  661.                                 Random fuelChosen = new Random();
  662.                                 int fuelChosen_index = fuelChosen.nextInt(fuel_List20.length);
  663.                                 fuel_Chosen = fuel_List20[fuelChosen_index];
  664.                             } case "F2 (Fluorine)" -> {
  665.                                 String[] fuel_List1 = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 85%", "C2H5OH(Ethanol) 75%",
  666.                                         "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "C2H8N2 (UnsymetricalDimethylHydrazine)",
  667.                                         "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)", "CH3OH (Methanol)", "C12H24 (Kerosene)",
  668.                                         "B2H6 (Diborane)", "B5H9 (Pentaborane)", "C2H6 (Ethane)"};
  669.                                 Collections.shuffle(Arrays.asList(fuel_List1));
  670.                                 Random fuelChosen = new Random();
  671.                                 int fuelChosen_index = fuelChosen.nextInt(fuel_List1.length);
  672.                                 fuel_Chosen = fuel_List1[fuelChosen_index];
  673.                             } case "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)" -> {
  674.                                 String[] fuel_List2 = {"H2 (Hydrogen)", "N2H4 (Hydrazine)", "CH3OH (Methanol)",
  675.                                         "C12H24 (Kerosene)", "B2H6 (Diborane)", "B5H9 (Pentaborane)", "C2H6 (Ethane)"};
  676.                                 Collections.shuffle(Arrays.asList(fuel_List2));
  677.                                 Random fuelChosen = new Random();
  678.                                 int fuelChosen_index = fuelChosen.nextInt(fuel_List2.length);
  679.                                 fuel_Chosen = fuel_List2[fuelChosen_index];
  680.                             }
  681.                         }
  682.  
  683.                         Collections.shuffle(Arrays.asList(altitude_Of_Operation));
  684.                         Random altitudeOfOperationChosen = new Random();
  685.                         int altitudeOfOperationChosen_index = altitudeOfOperationChosen.nextInt(altitude_Of_Operation.length);
  686.                         String altitude_Of_Operation_Chosen = altitude_Of_Operation[altitudeOfOperationChosen_index];
  687.  
  688.                         String nozzle_Type_Chosen = "";
  689.                         switch (altitude_Of_Operation_Chosen) {
  690.                             case "0-10 km (Sea Level)" -> {
  691.                                 String[] nozzle_Type_List_SL = {"De Laval Cone (Without Nozzle Extension)",
  692.                                         "De Laval Bell (Without Nozzle Extension)"};
  693.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_SL));
  694.                                 Random nozzleTypeSLspikeChosen = new Random();
  695.                                 int nozzleTypeSLspikeChosen_index = nozzleTypeSLspikeChosen.nextInt(nozzle_Type_List_SL.length);
  696.                                 nozzle_Type_Chosen = nozzle_Type_List_SL[nozzleTypeSLspikeChosen_index];
  697.                             } case "20-30 km (Medium Atmosphere)" -> {
  698.                                 String[] nozzle_Type_List_HA = {"De Laval Bell (Without Nozzle Extension)", "De Laval Cone (With Nozzle Extension)",
  699.                                         "De Laval Bell (With Nozzle Extension)", "Dual Bell Nozzle"};
  700.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_HA));
  701.                                 Random nozzleTypeHAspikeChosen = new Random();
  702.                                 int nozzleTypeHAspikeChosen_index = nozzleTypeHAspikeChosen.nextInt(nozzle_Type_List_HA.length);
  703.                                 nozzle_Type_Chosen = nozzle_Type_List_HA[nozzleTypeHAspikeChosen_index];
  704.                             } case "30-80 km (High Atmosphere)" -> {
  705.                                 String[] nozzle_Type_List_HAi = {"De Laval Cone (With Nozzle Extension)", "De Laval Bell (With Nozzle Extension)",
  706.                                         "Dual Bell Nozzle"};
  707.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_HAi));
  708.                                 Random nozzleTypeHAispikeChosen = new Random();
  709.                                 int nozzleTypeHAispikeChosen_index = nozzleTypeHAispikeChosen.nextInt(nozzle_Type_List_HAi.length);
  710.                                 nozzle_Type_Chosen = nozzle_Type_List_HAi[nozzleTypeHAispikeChosen_index];
  711.                             } case "80 km+ (Vacuum)" -> {
  712.                                 String[] nozzle_Type_List_VA = {"De Laval Cone (With Nozzle Extension)",
  713.                                         "De Laval Bell (With Nozzle Extension)", "Expanding Nozzle"};
  714.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_VA));
  715.                                 Random nozzleTypeVAspikeChosen = new Random();
  716.                                 int nozzleTypeVAspikeChosen_index = nozzleTypeVAspikeChosen.nextInt(nozzle_Type_List_VA.length);
  717.                                 nozzle_Type_Chosen = nozzle_Type_List_VA[nozzleTypeVAspikeChosen_index];
  718.                             } case "Any Altitude (0-80 km+)" -> {
  719.                                 String[] nozzle_Type_List_Aero = {"Linear Aerospike Nozzle", "Toroidal Aerospike Nozzle", "Expansion-Deflection Nozzle"};
  720.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_Aero));
  721.                                 Random nozzleTypeAerospikeChosen = new Random();
  722.                                 int nozzleTypeAerospikeChosen_index = nozzleTypeAerospikeChosen.nextInt(nozzle_Type_List_Aero.length);
  723.                                 nozzle_Type_Chosen = nozzle_Type_List_Aero[nozzleTypeAerospikeChosen_index];
  724.                             }
  725.                         }
  726.  
  727.                         System.out.println(lbrk + "\n" + "Your Engine is called: " + engine_Name + "\n");
  728.                         System.out.println("Your Engine Cycle is: " + engine_Cycle_Chosen);
  729.                         System.out.println("Your oxidizer is: " + oxidizer_Chosen);
  730.                         System.out.println("Your Fuel is: " + fuel_Chosen);
  731.                         System.out.println("Your Altitude of operation is: " + altitude_Of_Operation_Chosen);
  732.                         System.out.println("Your engine's nozzle type should be : " + nozzle_Type_Chosen);
  733.                         System.out.println("Tank repressurisation would be done Autogenously" + "\n");
  734.                         XWPFDocument docx = new XWPFDocument();
  735.                         if (new File(String.valueOf(pathn1)).exists()) {
  736.                             docx = new XWPFDocument(new FileInputStream(String.valueOf(pathn1)));
  737.                         }
  738.                         XWPFParagraph par = docx.createParagraph();
  739.                         XWPFRun run = par.createRun();
  740.                         run.setFontSize(12);
  741.                         run.setBold(true);
  742.                         run.setFontFamily("Calibri");
  743.                         run.setText("Your Engine is called: ");
  744.                         XWPFRun run2 = par.createRun();
  745.                         run2.setFontSize(12);
  746.                         run.setBold(true);
  747.                         run2.setFontFamily("Calibri");
  748.                         run2.setText(engine_Name);
  749.                         run2.addBreak();
  750.                         // -----------------------------------------------------------
  751.                         XWPFRun run3 = par.createRun();
  752.                         run3.setFontSize(10);
  753.                         run3.setBold(true);
  754.                         run3.setFontFamily("Calibri");
  755.                         run3.setText("Your Engine Cycle is: ");
  756.                         XWPFRun run4 = par.createRun();
  757.                         run4.setFontSize(10);
  758.                         run4.setFontFamily("Calibri");
  759.                         run4.setText(engine_Cycle_Chosen);
  760.                         run4.addBreak();
  761.                         // -----------------------------------------------------------
  762.                         XWPFRun run5 = par.createRun();
  763.                         run5.setFontSize(10);
  764.                         run5.setBold(true);
  765.                         run5.setFontFamily("Calibri");
  766.                         run5.setText("Your oxidizer is: ");
  767.                         XWPFRun run6 = par.createRun();
  768.                         run6.setFontSize(10);
  769.                         run6.setFontFamily("Calibri");
  770.                         run6.setText(oxidizer_Chosen);
  771.                         run6.addBreak();
  772.                         // -----------------------------------------------------------
  773.                         XWPFRun run8 = par.createRun();
  774.                         run8.setFontSize(10);
  775.                         run8.setBold(true);
  776.                         run8.setFontFamily("Calibri");
  777.                         run8.setText("Your Fuel is: ");
  778.                         XWPFRun run7 = par.createRun();
  779.                         run7.setFontSize(10);
  780.                         run7.setFontFamily("Calibri");
  781.                         run7.setText(fuel_Chosen);
  782.                         run7.addBreak();
  783.                         // -----------------------------------------------------------
  784.                         XWPFRun run9 = par.createRun();
  785.                         run9.setFontSize(10);
  786.                         run9.setBold(true);
  787.                         run9.setFontFamily("Calibri");
  788.                         run9.setText("Your engine's nozzle type should be: ");
  789.                         XWPFRun run0 = par.createRun();
  790.                         run0.setFontSize(10);
  791.                         run0.setFontFamily("Calibri");
  792.                         run0.setText(nozzle_Type_Chosen);
  793.                         run0.addBreak();
  794.                         // -----------------------------------------------------------
  795.                         XWPFRun run11 = par.createRun();
  796.                         run11.setFontSize(10);
  797.                         run11.setBold(true);
  798.                         run11.setFontFamily("Calibri");
  799.                         run11.setText("Tank repressurisation would be done ");
  800.                         XWPFRun run12 = par.createRun();
  801.                         run12.setFontSize(10);
  802.                         run12.setBold(true);
  803.                         run12.setFontFamily("Calibri");
  804.                         run12.setText("Autogenously");
  805.                         run12.addBreak();
  806.                         // -----------------------------------------------------------
  807.                         try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
  808.                             docx.write(out);
  809.                         }
  810.                     } case "Dual Expander (Closed)", "Dual Expander (Open)" -> {
  811.                         String[] oxidizer_List3 = {"O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)"};
  812.                         Collections.shuffle(Arrays.asList(oxidizer_List3));
  813.                         Random oxidizerChosen = new Random();
  814.                         int oxidizerChosen_index = oxidizerChosen.nextInt(oxidizer_List3.length);
  815.                         String oxidizer_Chosen = oxidizer_List3[oxidizerChosen_index];
  816.  
  817.                         String fuel_Chosen = "";
  818.                         String[] fuel_List3 = {"H2 (Hydrogen)", "CH4 (Methane)"};
  819.                         switch (oxidizer_Chosen) {
  820.                             case "O2 (Oxygen)", "F2 (Fluorine)" -> {
  821.                                 Collections.shuffle(Arrays.asList(fuel_List3));
  822.                                 Random fuelChosen = new Random();
  823.                                 int fuelChosen_index = fuelChosen.nextInt(fuel_List3.length);
  824.                                 fuel_Chosen = fuel_List3[fuelChosen_index];
  825.                             } case "F2 (Fluorine) + O2 (Oxygen)" -> fuel_Chosen = "H2 (Hydrogen)";
  826.                         }
  827.  
  828.                         Collections.shuffle(Arrays.asList(altitude_Of_Operation));
  829.                         Random altitudeOfOperationChosen = new Random();
  830.                         int altitudeOfOperationChosen_index = altitudeOfOperationChosen.nextInt(altitude_Of_Operation.length);
  831.                         String altitude_Of_Operation_Chosen = altitude_Of_Operation[altitudeOfOperationChosen_index];
  832.  
  833.                         String nozzle_Type_Chosen = "";
  834.                         switch (altitude_Of_Operation_Chosen) {
  835.                             case "0-10 km (Sea Level)" -> {
  836.                                 String[] nozzle_Type_List_SL = {"De Laval Cone (Without Nozzle Extension)",
  837.                                         "De Laval Bell (Without Nozzle Extension)"};
  838.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_SL));
  839.                                 Random nozzleTypeSLspikeChosen = new Random();
  840.                                 int nozzleTypeSLspikeChosen_index = nozzleTypeSLspikeChosen.nextInt(nozzle_Type_List_SL.length);
  841.                                 nozzle_Type_Chosen = nozzle_Type_List_SL[nozzleTypeSLspikeChosen_index];
  842.                             } case "20-30 km (Medium Atmosphere)" -> {
  843.                                 String[] nozzle_Type_List_HA = {"De Laval Bell (Without Nozzle Extension)", "De Laval Cone (With Nozzle Extension)",
  844.                                         "De Laval Bell (With Nozzle Extension)", "Dual Bell Nozzle"};
  845.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_HA));
  846.                                 Random nozzleTypeHAspikeChosen = new Random();
  847.                                 int nozzleTypeHAspikeChosen_index = nozzleTypeHAspikeChosen.nextInt(nozzle_Type_List_HA.length);
  848.                                 nozzle_Type_Chosen = nozzle_Type_List_HA[nozzleTypeHAspikeChosen_index];
  849.                             } case "30-80 km (High Atmosphere)" -> {
  850.                                 String[] nozzle_Type_List_HAi = {"De Laval Cone (With Nozzle Extension)", "De Laval Bell (With Nozzle Extension)",
  851.                                         "Dual Bell Nozzle"};
  852.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_HAi));
  853.                                 Random nozzleTypeHAispikeChosen = new Random();
  854.                                 int nozzleTypeHAispikeChosen_index = nozzleTypeHAispikeChosen.nextInt(nozzle_Type_List_HAi.length);
  855.                                 nozzle_Type_Chosen = nozzle_Type_List_HAi[nozzleTypeHAispikeChosen_index];
  856.                             } case "80 km+ (Vacuum)" -> {
  857.                                 String[] nozzle_Type_List_VA = {"De Laval Cone (With Nozzle Extension)",
  858.                                         "De Laval Bell (With Nozzle Extension)", "Expanding Nozzle"};
  859.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_VA));
  860.                                 Random nozzleTypeVAspikeChosen = new Random();
  861.                                 int nozzleTypeVAspikeChosen_index = nozzleTypeVAspikeChosen.nextInt(nozzle_Type_List_VA.length);
  862.                                 nozzle_Type_Chosen = nozzle_Type_List_VA[nozzleTypeVAspikeChosen_index];
  863.                             } case "Any Altitude (0-80 km+)" -> {
  864.                                 String[] nozzle_Type_List_Aero = {"Linear Aerospike Nozzle", "Toroidal Aerospike Nozzle", "Expansion-Deflection Nozzle"};
  865.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_Aero));
  866.                                 Random nozzleTypeAerospikeChosen = new Random();
  867.                                 int nozzleTypeAerospikeChosen_index = nozzleTypeAerospikeChosen.nextInt(nozzle_Type_List_Aero.length);
  868.                                 nozzle_Type_Chosen = nozzle_Type_List_Aero[nozzleTypeAerospikeChosen_index];
  869.                             }
  870.                         }
  871.  
  872.                         System.out.println(lbrk + "\n" + "Your Engine is called: " + engine_Name + "\n");
  873.                         System.out.println("Your Engine Cycle is: " + engine_Cycle_Chosen);
  874.                         System.out.println("Your oxidizer is: " + oxidizer_Chosen);
  875.                         System.out.println("Your Fuel is: " + fuel_Chosen);
  876.                         System.out.println("Your Altitude of operation is: " + altitude_Of_Operation_Chosen);
  877.                         System.out.println("Your engine's nozzle type should be : " + nozzle_Type_Chosen);
  878.                         System.out.println("Tank repressurisation would be done Autogenously" + "\n");
  879.                         XWPFDocument docx = new XWPFDocument();
  880.                         if (new File(String.valueOf(pathn1)).exists()) {
  881.                             docx = new XWPFDocument(new FileInputStream(String.valueOf(pathn1)));
  882.                         }
  883.                         XWPFParagraph par = docx.createParagraph();
  884.                         XWPFRun run = par.createRun();
  885.                         run.setFontSize(12);
  886.                         run.setBold(true);
  887.                         run.setFontFamily("Calibri");
  888.                         run.setText("Your Engine is called: ");
  889.                         XWPFRun run2 = par.createRun();
  890.                         run2.setFontSize(12);
  891.                         run.setBold(true);
  892.                         run2.setFontFamily("Calibri");
  893.                         run2.setText(engine_Name);
  894.                         run2.addBreak();
  895.                         // -----------------------------------------------------------
  896.                         XWPFRun run3 = par.createRun();
  897.                         run3.setFontSize(10);
  898.                         run3.setBold(true);
  899.                         run3.setFontFamily("Calibri");
  900.                         run3.setText("Your Engine Cycle is: ");
  901.                         XWPFRun run4 = par.createRun();
  902.                         run4.setFontSize(10);
  903.                         run4.setFontFamily("Calibri");
  904.                         run4.setText(engine_Cycle_Chosen);
  905.                         run4.addBreak();
  906.                         // -----------------------------------------------------------
  907.                         XWPFRun run5 = par.createRun();
  908.                         run5.setFontSize(10);
  909.                         run5.setBold(true);
  910.                         run5.setFontFamily("Calibri");
  911.                         run5.setText("Your oxidizer is: ");
  912.                         XWPFRun run6 = par.createRun();
  913.                         run6.setFontSize(10);
  914.                         run6.setFontFamily("Calibri");
  915.                         run6.setText(oxidizer_Chosen);
  916.                         run6.addBreak();
  917.                         // -----------------------------------------------------------
  918.                         XWPFRun run8 = par.createRun();
  919.                         run8.setFontSize(10);
  920.                         run8.setBold(true);
  921.                         run8.setFontFamily("Calibri");
  922.                         run8.setText("Your Fuel is: ");
  923.                         XWPFRun run7 = par.createRun();
  924.                         run7.setFontSize(10);
  925.                         run7.setFontFamily("Calibri");
  926.                         run7.setText(fuel_Chosen);
  927.                         run7.addBreak();
  928.                         // -----------------------------------------------------------
  929.                         XWPFRun run9 = par.createRun();
  930.                         run9.setFontSize(10);
  931.                         run9.setBold(true);
  932.                         run9.setFontFamily("Calibri");
  933.                         run9.setText("Your engine's nozzle type should be: ");
  934.                         XWPFRun run0 = par.createRun();
  935.                         run0.setFontSize(10);
  936.                         run0.setFontFamily("Calibri");
  937.                         run0.setText(nozzle_Type_Chosen);
  938.                         run0.addBreak();
  939.                         // -----------------------------------------------------------
  940.                         XWPFRun run11 = par.createRun();
  941.                         run11.setFontSize(10);
  942.                         run11.setBold(true);
  943.                         run11.setFontFamily("Calibri");
  944.                         run11.setText("Tank repressurisation would be done ");
  945.                         XWPFRun run12 = par.createRun();
  946.                         run12.setFontSize(10);
  947.                         run12.setBold(true);
  948.                         run12.setFontFamily("Calibri");
  949.                         run12.setText("Autogenously");
  950.                         run12.addBreak();
  951.                         // -----------------------------------------------------------
  952.                         try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
  953.                             docx.write(out);
  954.                         }
  955.                     } case "Staged Combustion (Fuel Rich)" -> {
  956.                         String[] oxidizer_List4 = {"O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)",
  957.                                 "N2H4 (Hydrazine)", "O3 (Ozone)"};
  958.                         Collections.shuffle(Arrays.asList(oxidizer_List4));
  959.                         Random oxidizerChosen = new Random();
  960.                         int oxidizerChosen_index = oxidizerChosen.nextInt(oxidizer_List4.length);
  961.                         String oxidizer_Chosen = oxidizer_List4[oxidizerChosen_index];
  962.  
  963.                         String fuel_Chosen = "";
  964.                         switch (oxidizer_Chosen) {
  965.                             case "O2 (Oxygen)", "F2 (Fluorine)" -> {
  966.                                 String[] fuel_List4 = {"H2 (Hydrogen)", "NH3 (Ammonia)", "N2H4 (Hydrazine)", "B2H6 (Diborane)",
  967.                                         "B5H9 (Pentaborane)"};
  968.                                 Collections.shuffle(Arrays.asList(fuel_List4));
  969.                                 Random fuelChosen = new Random();
  970.                                 int fuelChosen_index = fuelChosen.nextInt(fuel_List4.length);
  971.                                 fuel_Chosen = fuel_List4[fuelChosen_index];
  972.                             } case "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)" -> {
  973.                                 String[] fuel_List6 = {"H2 (Hydrogen)", "B2H6 (Diborane)", "B5H9 (Pentaborane)"};
  974.                                 Collections.shuffle(Arrays.asList(fuel_List6));
  975.                                 Random fuelChosen = new Random();
  976.                                 int fuelChosen_index = fuelChosen.nextInt(fuel_List6.length);
  977.                                 fuel_Chosen = fuel_List6[fuelChosen_index];
  978.                             } case "N2H4 (Hydrazine)" -> {
  979.                                 String[] fuel_List7 = {"H2 (Hydrogen)", "B2H6 (Diborane)"};
  980.                                 Collections.shuffle(Arrays.asList(fuel_List7));
  981.                                 Random fuelChosen = new Random();
  982.                                 int fuelChosen_index = fuelChosen.nextInt(fuel_List7.length);
  983.                                 fuel_Chosen = fuel_List7[fuelChosen_index];
  984.                             }
  985.                         }
  986.                         Collections.shuffle(Arrays.asList(tank_Repressurisation));
  987.                         Random tankRepressurisationChosen = new Random();
  988.                         int tankRepressurisationChosen_index = tankRepressurisationChosen.nextInt(tank_Repressurisation.length);
  989.                         String tank_Repressurisation_Chosen = tank_Repressurisation[tankRepressurisationChosen_index];
  990.  
  991.                         Collections.shuffle(Arrays.asList(altitude_Of_Operation));
  992.                         Random altitudeOfOperationChosen = new Random();
  993.                         int altitudeOfOperationChosen_index = altitudeOfOperationChosen.nextInt(altitude_Of_Operation.length);
  994.                         String altitude_Of_Operation_Chosen = altitude_Of_Operation[altitudeOfOperationChosen_index];
  995.  
  996.                         String nozzle_Type_Chosen = "";
  997.                         switch (altitude_Of_Operation_Chosen) {
  998.                             case "0-10 km (Sea Level)" -> {
  999.                                 String[] nozzle_Type_List_SL = {"De Laval Cone (Without Nozzle Extension)",
  1000.                                         "De Laval Bell (Without Nozzle Extension)"};
  1001.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_SL));
  1002.                                 Random nozzleTypeSLspikeChosen = new Random();
  1003.                                 int nozzleTypeSLspikeChosen_index = nozzleTypeSLspikeChosen.nextInt(nozzle_Type_List_SL.length);
  1004.                                 nozzle_Type_Chosen = nozzle_Type_List_SL[nozzleTypeSLspikeChosen_index];
  1005.                             } case "20-30 km (Medium Atmosphere)" -> {
  1006.                                 String[] nozzle_Type_List_HA = {"De Laval Bell (Without Nozzle Extension)", "De Laval Cone (With Nozzle Extension)",
  1007.                                         "De Laval Bell (With Nozzle Extension)", "Dual Bell Nozzle"};
  1008.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_HA));
  1009.                                 Random nozzleTypeHAspikeChosen = new Random();
  1010.                                 int nozzleTypeHAspikeChosen_index = nozzleTypeHAspikeChosen.nextInt(nozzle_Type_List_HA.length);
  1011.                                 nozzle_Type_Chosen = nozzle_Type_List_HA[nozzleTypeHAspikeChosen_index];
  1012.                             } case "30-80 km (High Atmosphere)" -> {
  1013.                                 String[] nozzle_Type_List_HAi = {"De Laval Cone (With Nozzle Extension)", "De Laval Bell (With Nozzle Extension)",
  1014.                                         "Dual Bell Nozzle"};
  1015.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_HAi));
  1016.                                 Random nozzleTypeHAispikeChosen = new Random();
  1017.                                 int nozzleTypeHAispikeChosen_index = nozzleTypeHAispikeChosen.nextInt(nozzle_Type_List_HAi.length);
  1018.                                 nozzle_Type_Chosen = nozzle_Type_List_HAi[nozzleTypeHAispikeChosen_index];
  1019.                             } case "80 km+ (Vacuum)" -> {
  1020.                                 String[] nozzle_Type_List_VA = {"De Laval Cone (With Nozzle Extension)",
  1021.                                         "De Laval Bell (With Nozzle Extension)", "Expanding Nozzle"};
  1022.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_VA));
  1023.                                 Random nozzleTypeVAspikeChosen = new Random();
  1024.                                 int nozzleTypeVAspikeChosen_index = nozzleTypeVAspikeChosen.nextInt(nozzle_Type_List_VA.length);
  1025.                                 nozzle_Type_Chosen = nozzle_Type_List_VA[nozzleTypeVAspikeChosen_index];
  1026.                             } case "Any Altitude (0-80 km+)" -> {
  1027.                                 String[] nozzle_Type_List_Aero = {"Linear Aerospike Nozzle", "Toroidal Aerospike Nozzle", "Expansion-Deflection Nozzle"};
  1028.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_Aero));
  1029.                                 Random nozzleTypeAerospikeChosen = new Random();
  1030.                                 int nozzleTypeAerospikeChosen_index = nozzleTypeAerospikeChosen.nextInt(nozzle_Type_List_Aero.length);
  1031.                                 nozzle_Type_Chosen = nozzle_Type_List_Aero[nozzleTypeAerospikeChosen_index];
  1032.                             }
  1033.                         }
  1034.  
  1035.                         System.out.println(lbrk + "\n" + "Your Engine is called: " + engine_Name + "\n");
  1036.                         System.out.println("Your Engine Cycle is: " + engine_Cycle_Chosen);
  1037.                         System.out.println("Your oxidizer is: " + oxidizer_Chosen);
  1038.                         System.out.println("Your Fuel is: " + fuel_Chosen);
  1039.                         System.out.println("Your Altitude of operation is: " + altitude_Of_Operation_Chosen);
  1040.                         System.out.println("Your engine's nozzle type should be : " + nozzle_Type_Chosen);
  1041.                         System.out.println("Tank repressurisation would be done " + tank_Repressurisation_Chosen + "\n");
  1042.                         XWPFDocument docx = new XWPFDocument();
  1043.                         if (new File(String.valueOf(pathn1)).exists()) {
  1044.                             docx = new XWPFDocument(new FileInputStream(String.valueOf(pathn1)));
  1045.                         }
  1046.                         XWPFParagraph par = docx.createParagraph();
  1047.                         XWPFRun run = par.createRun();
  1048.                         run.setFontSize(12);
  1049.                         run.setBold(true);
  1050.                         run.setFontFamily("Calibri");
  1051.                         run.setText("Your Engine is called: ");
  1052.                         XWPFRun run2 = par.createRun();
  1053.                         run2.setFontSize(12);
  1054.                         run.setBold(true);
  1055.                         run2.setFontFamily("Calibri");
  1056.                         run2.setText(engine_Name);
  1057.                         run2.addBreak();
  1058.                         // -----------------------------------------------------------
  1059.                         XWPFRun run3 = par.createRun();
  1060.                         run3.setFontSize(10);
  1061.                         run3.setBold(true);
  1062.                         run3.setFontFamily("Calibri");
  1063.                         run3.setText("Your Engine Cycle is: ");
  1064.                         XWPFRun run4 = par.createRun();
  1065.                         run4.setFontSize(10);
  1066.                         run4.setFontFamily("Calibri");
  1067.                         run4.setText(engine_Cycle_Chosen);
  1068.                         run4.addBreak();
  1069.                         // -----------------------------------------------------------
  1070.                         XWPFRun run5 = par.createRun();
  1071.                         run5.setFontSize(10);
  1072.                         run5.setBold(true);
  1073.                         run5.setFontFamily("Calibri");
  1074.                         run5.setText("Your oxidizer is: ");
  1075.                         XWPFRun run6 = par.createRun();
  1076.                         run6.setFontSize(10);
  1077.                         run6.setFontFamily("Calibri");
  1078.                         run6.setText(oxidizer_Chosen);
  1079.                         run6.addBreak();
  1080.                         // -----------------------------------------------------------
  1081.                         XWPFRun run8 = par.createRun();
  1082.                         run8.setFontSize(10);
  1083.                         run8.setBold(true);
  1084.                         run8.setFontFamily("Calibri");
  1085.                         run8.setText("Your Fuel is: ");
  1086.                         XWPFRun run7 = par.createRun();
  1087.                         run7.setFontSize(10);
  1088.                         run7.setFontFamily("Calibri");
  1089.                         run7.setText(fuel_Chosen);
  1090.                         run7.addBreak();
  1091.                         // -----------------------------------------------------------
  1092.                         XWPFRun run9 = par.createRun();
  1093.                         run9.setFontSize(10);
  1094.                         run9.setBold(true);
  1095.                         run9.setFontFamily("Calibri");
  1096.                         run9.setText("Your engine's nozzle type should be: ");
  1097.                         XWPFRun run0 = par.createRun();
  1098.                         run0.setFontSize(10);
  1099.                         run0.setFontFamily("Calibri");
  1100.                         run0.setText(nozzle_Type_Chosen);
  1101.                         run0.addBreak();
  1102.                         // -----------------------------------------------------------
  1103.                         XWPFRun run11 = par.createRun();
  1104.                         run11.setFontSize(10);
  1105.                         run11.setBold(true);
  1106.                         run11.setFontFamily("Calibri");
  1107.                         run11.setText("Tank repressurisation would be done ");
  1108.                         XWPFRun run12 = par.createRun();
  1109.                         run12.setFontSize(10);
  1110.                         run12.setBold(true);
  1111.                         run12.setFontFamily("Calibri");
  1112.                         run12.setText(tank_Repressurisation_Chosen);
  1113.                         run12.addBreak();
  1114.                         // -----------------------------------------------------------
  1115.                         try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
  1116.                             docx.write(out);
  1117.                         }
  1118.                     } case "Full Flow Staged Combustion", "Combustion Tap Off" -> {
  1119.                         String[] oxidizer_List4 = {"O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)",
  1120.                                 "N2H4 (Hydrazine)", "O3 (Ozone)"};
  1121.                         Collections.shuffle(Arrays.asList(oxidizer_List4));
  1122.                         Random oxidizerChosen = new Random();
  1123.                         int oxidizerChosen_index = oxidizerChosen.nextInt(oxidizer_List4.length);
  1124.                         String oxidizer_Chosen = oxidizer_List4[oxidizerChosen_index];
  1125.  
  1126.                         String fuel_Chosen = "";
  1127.                         switch (oxidizer_Chosen) {
  1128.                             case "O2 (Oxygen)" -> {
  1129.                                 String[] fuel_List4 = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 85%", "C2H5OH(Ethanol) 75%",
  1130.                                         "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
  1131.                                         "CH3OH (Methanol)", "B2H6 (Diborane)", "B5H9 (Pentaborane)", "C2H6 (Ethane)"};
  1132.                                 Collections.shuffle(Arrays.asList(fuel_List4));
  1133.                                 Random fuelChosen = new Random();
  1134.                                 int fuelChosen_index = fuelChosen.nextInt(fuel_List4.length);
  1135.                                 fuel_Chosen = fuel_List4[fuelChosen_index];
  1136.                             } case "F2 (Fluorine)" -> {
  1137.                                 String[] fuel_List5 = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 85%", "C2H5OH(Ethanol) 75%",
  1138.                                         "NH3 (Ammonia)", "C2H8N2 (UnsymetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)",
  1139.                                         "N2H4 (Hydrazine)", "CH3OH (Methanol)", "B2H6 (Diborane)", "B5H9 (Pentaborane)", "C2H6 (Ethane)"};
  1140.                                 Collections.shuffle(Arrays.asList(fuel_List5));
  1141.                                 Random fuelChosen = new Random();
  1142.                                 int fuelChosen_index = fuelChosen.nextInt(fuel_List5.length);
  1143.                                 fuel_Chosen = fuel_List5[fuelChosen_index];
  1144.                             } case "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)" -> {
  1145.                                 String[] fuel_List6 = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 85%", "C2H5OH(Ethanol) 75%",
  1146.                                         "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  1147.                                         "CH6N2 (MonomethylHydrazine)", "B2H6 (Diborane)", "B5H9 (Pentaborane)"};
  1148.                                 Collections.shuffle(Arrays.asList(fuel_List6));
  1149.                                 Random fuelChosen = new Random();
  1150.                                 int fuelChosen_index = fuelChosen.nextInt(fuel_List6.length);
  1151.                                 fuel_Chosen = fuel_List6[fuelChosen_index];
  1152.                             } case "N2H4 (Hydrazine)" -> {
  1153.                                 String[] fuel_List7 = {"H2 (Hydrogen)", "C2H5OH(Ethanol) 85%", "C2H5OH(Ethanol) 75%",
  1154.                                         "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  1155.                                         "C2H8N2 (UnsymetricalDimethylHydrazine)", "CH3OH (Methanol)", "B2H6 (Diborane)"};
  1156.                                 Collections.shuffle(Arrays.asList(fuel_List7));
  1157.                                 Random fuelChosen = new Random();
  1158.                                 int fuelChosen_index = fuelChosen.nextInt(fuel_List7.length);
  1159.                                 fuel_Chosen = fuel_List7[fuelChosen_index];
  1160.                             }
  1161.                         }
  1162.                         Collections.shuffle(Arrays.asList(tank_Repressurisation));
  1163.                         Random tankRepressurisationChosen = new Random();
  1164.                         int tankRepressurisationChosen_index = tankRepressurisationChosen.nextInt(tank_Repressurisation.length);
  1165.                         String tank_Repressurisation_Chosen = tank_Repressurisation[tankRepressurisationChosen_index];
  1166.  
  1167.                         Collections.shuffle(Arrays.asList(altitude_Of_Operation));
  1168.                         Random altitudeOfOperationChosen = new Random();
  1169.                         int altitudeOfOperationChosen_index = altitudeOfOperationChosen.nextInt(altitude_Of_Operation.length);
  1170.                         String altitude_Of_Operation_Chosen = altitude_Of_Operation[altitudeOfOperationChosen_index];
  1171.  
  1172.                         String nozzle_Type_Chosen = "";
  1173.                         switch (altitude_Of_Operation_Chosen) {
  1174.                             case "0-10 km (Sea Level)" -> {
  1175.                                 String[] nozzle_Type_List_SL = {"De Laval Cone (Without Nozzle Extension)",
  1176.                                         "De Laval Bell (Without Nozzle Extension)"};
  1177.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_SL));
  1178.                                 Random nozzleTypeSLspikeChosen = new Random();
  1179.                                 int nozzleTypeSLspikeChosen_index = nozzleTypeSLspikeChosen.nextInt(nozzle_Type_List_SL.length);
  1180.                                 nozzle_Type_Chosen = nozzle_Type_List_SL[nozzleTypeSLspikeChosen_index];
  1181.                             } case "20-30 km (Medium Atmosphere)" -> {
  1182.                                 String[] nozzle_Type_List_HA = {"De Laval Bell (Without Nozzle Extension)", "De Laval Cone (With Nozzle Extension)",
  1183.                                         "De Laval Bell (With Nozzle Extension)", "Dual Bell Nozzle"};
  1184.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_HA));
  1185.                                 Random nozzleTypeHAspikeChosen = new Random();
  1186.                                 int nozzleTypeHAspikeChosen_index = nozzleTypeHAspikeChosen.nextInt(nozzle_Type_List_HA.length);
  1187.                                 nozzle_Type_Chosen = nozzle_Type_List_HA[nozzleTypeHAspikeChosen_index];
  1188.                             } case "30-80 km (High Atmosphere)" -> {
  1189.                                 String[] nozzle_Type_List_HAi = {"De Laval Cone (With Nozzle Extension)", "De Laval Bell (With Nozzle Extension)",
  1190.                                         "Dual Bell Nozzle"};
  1191.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_HAi));
  1192.                                 Random nozzleTypeHAispikeChosen = new Random();
  1193.                                 int nozzleTypeHAispikeChosen_index = nozzleTypeHAispikeChosen.nextInt(nozzle_Type_List_HAi.length);
  1194.                                 nozzle_Type_Chosen = nozzle_Type_List_HAi[nozzleTypeHAispikeChosen_index];
  1195.                             } case "80 km+ (Vacuum)" -> {
  1196.                                 String[] nozzle_Type_List_VA = {"De Laval Cone (With Nozzle Extension)",
  1197.                                         "De Laval Bell (With Nozzle Extension)", "Expanding Nozzle"};
  1198.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_VA));
  1199.                                 Random nozzleTypeVAspikeChosen = new Random();
  1200.                                 int nozzleTypeVAspikeChosen_index = nozzleTypeVAspikeChosen.nextInt(nozzle_Type_List_VA.length);
  1201.                                 nozzle_Type_Chosen = nozzle_Type_List_VA[nozzleTypeVAspikeChosen_index];
  1202.                             } case "Any Altitude (0-80 km+)" -> {
  1203.                                 String[] nozzle_Type_List_Aero = {"Linear Aerospike Nozzle", "Toroidal Aerospike Nozzle", "Expansion-Deflection Nozzle"};
  1204.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_Aero));
  1205.                                 Random nozzleTypeAerospikeChosen = new Random();
  1206.                                 int nozzleTypeAerospikeChosen_index = nozzleTypeAerospikeChosen.nextInt(nozzle_Type_List_Aero.length);
  1207.                                 nozzle_Type_Chosen = nozzle_Type_List_Aero[nozzleTypeAerospikeChosen_index];
  1208.                             }
  1209.                         }
  1210.  
  1211.                         System.out.println(lbrk + "\n" + "Your Engine is called: " + engine_Name + "\n");
  1212.                         System.out.println("Your Engine Cycle is: " + engine_Cycle_Chosen);
  1213.                         System.out.println("Your oxidizer is: " + oxidizer_Chosen);
  1214.                         System.out.println("Your Fuel is: " + fuel_Chosen);
  1215.                         System.out.println("Your Altitude of operation is: " + altitude_Of_Operation_Chosen);
  1216.                         System.out.println("Your engine's nozzle type should be : " + nozzle_Type_Chosen);
  1217.                         System.out.println("Tank repressurisation would be done " + tank_Repressurisation_Chosen + "\n");
  1218.                         XWPFDocument docx = new XWPFDocument();
  1219.                         if (new File(String.valueOf(pathn1)).exists()) {
  1220.                             docx = new XWPFDocument(new FileInputStream(String.valueOf(pathn1)));
  1221.                         }
  1222.                         XWPFParagraph par = docx.createParagraph();
  1223.                         XWPFRun run = par.createRun();
  1224.                         run.setFontSize(12);
  1225.                         run.setBold(true);
  1226.                         run.setFontFamily("Calibri");
  1227.                         run.setText("Your Engine is called: ");
  1228.                         XWPFRun run2 = par.createRun();
  1229.                         run2.setFontSize(12);
  1230.                         run.setBold(true);
  1231.                         run2.setFontFamily("Calibri");
  1232.                         run2.setText(engine_Name);
  1233.                         run2.addBreak();
  1234.                         // -----------------------------------------------------------
  1235.                         XWPFRun run3 = par.createRun();
  1236.                         run3.setFontSize(10);
  1237.                         run3.setBold(true);
  1238.                         run3.setFontFamily("Calibri");
  1239.                         run3.setText("Your Engine Cycle is: ");
  1240.                         XWPFRun run4 = par.createRun();
  1241.                         run4.setFontSize(10);
  1242.                         run4.setFontFamily("Calibri");
  1243.                         run4.setText(engine_Cycle_Chosen);
  1244.                         run4.addBreak();
  1245.                         // -----------------------------------------------------------
  1246.                         XWPFRun run5 = par.createRun();
  1247.                         run5.setFontSize(10);
  1248.                         run5.setBold(true);
  1249.                         run5.setFontFamily("Calibri");
  1250.                         run5.setText("Your oxidizer is: ");
  1251.                         XWPFRun run6 = par.createRun();
  1252.                         run6.setFontSize(10);
  1253.                         run6.setFontFamily("Calibri");
  1254.                         run6.setText(oxidizer_Chosen);
  1255.                         run6.addBreak();
  1256.                         // -----------------------------------------------------------
  1257.                         XWPFRun run8 = par.createRun();
  1258.                         run8.setFontSize(10);
  1259.                         run8.setBold(true);
  1260.                         run8.setFontFamily("Calibri");
  1261.                         run8.setText("Your Fuel is: ");
  1262.                         XWPFRun run7 = par.createRun();
  1263.                         run7.setFontSize(10);
  1264.                         run7.setFontFamily("Calibri");
  1265.                         run7.setText(fuel_Chosen);
  1266.                         run7.addBreak();
  1267.                         // -----------------------------------------------------------
  1268.                         XWPFRun run9 = par.createRun();
  1269.                         run9.setFontSize(10);
  1270.                         run9.setBold(true);
  1271.                         run9.setFontFamily("Calibri");
  1272.                         run9.setText("Your engine's nozzle type should be: ");
  1273.                         XWPFRun run0 = par.createRun();
  1274.                         run0.setFontSize(10);
  1275.                         run0.setFontFamily("Calibri");
  1276.                         run0.setText(nozzle_Type_Chosen);
  1277.                         run0.addBreak();
  1278.                         // -----------------------------------------------------------
  1279.                         XWPFRun run11 = par.createRun();
  1280.                         run11.setFontSize(10);
  1281.                         run11.setBold(true);
  1282.                         run11.setFontFamily("Calibri");
  1283.                         run11.setText("Tank repressurisation would be done ");
  1284.                         XWPFRun run12 = par.createRun();
  1285.                         run12.setFontSize(10);
  1286.                         run12.setBold(true);
  1287.                         run12.setFontFamily("Calibri");
  1288.                         run12.setText(tank_Repressurisation_Chosen);
  1289.                         run12.addBreak();
  1290.                         // -----------------------------------------------------------
  1291.                         try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
  1292.                             docx.write(out);
  1293.                         }
  1294.                     } default -> {
  1295.                         String[] oxidizer_List6 = {"O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)",
  1296.                                 "N2O4 (Nitrogen Tetroxide)", "N2H4 (Hydrazine)", "H2O2 (Hydrogen Peroxide) 95%",
  1297.                                 "H2O2 (Hydrogen Peroxide) 85%", "O3 (Ozone)", "AK20F: 80% HNO3 + 20% N2O4 (Nitric Acid)",
  1298.                                 "AK20I: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK20K: 80% HNO3 + 20% N2O4 (Nitric Acid)",
  1299.                                 "AK27I: 73% HNO3 + 27% N2O4 (Nitric Acid)", "AK27P: 73% HNO3 + 27% N2O4 (Nitric Acid)",
  1300.                                 "ClF3 (Chlorine Trifluoride)", "ClF5 (Chlorine Pentafluoride)"};
  1301.                         Collections.shuffle(Arrays.asList(oxidizer_List6));
  1302.                         Random oxidizerChosen = new Random();
  1303.                         int oxidizerChosen_index = oxidizerChosen.nextInt(oxidizer_List6.length);
  1304.                         String oxidizer_Chosen = oxidizer_List6[oxidizerChosen_index];
  1305.  
  1306.                         String fuel_Chosen = "";
  1307.                         switch (oxidizer_Chosen) {
  1308.                             case "O2 (Oxygen)" -> {
  1309.                                 String[] fuel_List8 = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 85%", "C2H5OH(Ethanol) 75%",
  1310.                                         "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)",
  1311.                                         "N2H4 (Hydrazine)", "CH3OH (Methanol)", "C12H24 (Kerosene)", "B2H6 (Diborane)", "B5H9 (Pentaborane)",
  1312.                                         "C2H6 (Ethane)"};
  1313.                                 Collections.shuffle(Arrays.asList(fuel_List8));
  1314.                                 Random fuelChosen = new Random();
  1315.                                 int fuelChosen_index = fuelChosen.nextInt(fuel_List8.length);
  1316.                                 fuel_Chosen = fuel_List8[fuelChosen_index];
  1317.                             } case "F2 (Fluorine)" -> {
  1318.                                 String[] fuel_List9 = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 85%", "C2H5OH(Ethanol) 75%",
  1319.                                         "C6H5NH2 (Aniline)", "NH3 (Ammonia)",
  1320.                                         "C2H8N2 (UnsymetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
  1321.                                         "CH3OH (Methanol)", "C12H24 (Kerosene)", "B2H6 (Diborane)", "B5H9 (Pentaborane)", "C2H6 (Ethane)"};
  1322.                                 Collections.shuffle(Arrays.asList(fuel_List9));
  1323.                                 Random fuelChosen = new Random();
  1324.                                 int fuelChosen_index = fuelChosen.nextInt(fuel_List9.length);
  1325.                                 fuel_Chosen = fuel_List9[fuelChosen_index];
  1326.                             } case "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)" -> {
  1327.                                 String[] fuel_List10 = {"H2 (Hydrogen)", "CH3OH (Methanol)", "C12H24 (Kerosene)", "B2H6 (Diborane)",
  1328.                                         "B5H9 (Pentaborane)", "C2H6 (Ethane)"};
  1329.                                 Collections.shuffle(Arrays.asList(fuel_List10));
  1330.                                 Random fuelChosen = new Random();
  1331.                                 int fuelChosen_index = fuelChosen.nextInt(fuel_List10.length);
  1332.                                 fuel_Chosen = fuel_List10[fuelChosen_index];
  1333.                             } case "AK20F: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK20I: 80% HNO3 + 20% N2O4 (Nitric Acid)",
  1334.                                     "AK20K: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK27I: 73% HNO3 + 27% N2O4 (Nitric Acid)",
  1335.                                     "AK27P: 73% HNO3 + 27% N2O4 (Nitric Acid)", "ClF3 (Chlorine Trifluoride)",
  1336.                                     "ClF5 (Chlorine Pentafluoride)" -> {
  1337.                                 String[] fuel_List11 = {"C2H5OH(Ethanol) 85%", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
  1338.                                         "CH3OH (Methanol)"};
  1339.                                 Collections.shuffle(Arrays.asList(fuel_List11));
  1340.                                 Random fuelChosen = new Random();
  1341.                                 int fuelChosen_index = fuelChosen.nextInt(fuel_List11.length);
  1342.                                 fuel_Chosen = fuel_List11[fuelChosen_index];
  1343.                             } case "N2O4 (Nitrogen Tetroxide)", "H2O2 (Hydrogen Peroxide) 95%", "H2O2 (Hydrogen Peroxide) 85%" -> {
  1344.                                 String[] fuel_List12 = {"H2 (Hydrogen)", "C2H5OH(Ethanol) 85%", "C2H5OH(Ethanol) 75%",
  1345.                                         "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  1346.                                         "C2H8N2 (UnsymetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
  1347.                                         "CH3OH (Methanol)", "C12H24 (Kerosene)", "C2H6 (Ethane)"};
  1348.                                 Collections.shuffle(Arrays.asList(fuel_List12));
  1349.                                 Random fuelChosen = new Random();
  1350.                                 int fuelChosen_index = fuelChosen.nextInt(fuel_List12.length);
  1351.                                 fuel_Chosen = fuel_List12[fuelChosen_index];
  1352.                             } case "N2H4 (Hydrazine)" -> {
  1353.                                 String[] fuel_List13 = {"B2H6 (Diborane)", "B5H9 (Pentaborane)"};
  1354.                                 Collections.shuffle(Arrays.asList(fuel_List13));
  1355.                                 Random fuelChosen = new Random();
  1356.                                 int fuelChosen_index = fuelChosen.nextInt(fuel_List13.length);
  1357.                                 fuel_Chosen = fuel_List13[fuelChosen_index];
  1358.                             }
  1359.                         }
  1360.  
  1361.                         Collections.shuffle(Arrays.asList(tank_Repressurisation));
  1362.                         Random tankRepressurisationChosen = new Random();
  1363.                         int tankRepressurisationChosen_index = tankRepressurisationChosen.nextInt(tank_Repressurisation.length);
  1364.                         String tank_Repressurisation_Chosen = tank_Repressurisation[tankRepressurisationChosen_index];
  1365.  
  1366.                         Collections.shuffle(Arrays.asList(altitude_Of_Operation));
  1367.                         Random altitudeOfOperationChosen = new Random();
  1368.                         int altitudeOfOperationChosen_index = altitudeOfOperationChosen.nextInt(altitude_Of_Operation.length);
  1369.                         String altitude_Of_Operation_Chosen = altitude_Of_Operation[altitudeOfOperationChosen_index];
  1370.  
  1371.                         String nozzle_Type_Chosen = "";
  1372.                         switch (altitude_Of_Operation_Chosen) {
  1373.                             case "0-10 km (Sea Level)" -> {
  1374.                                 String[] nozzle_Type_List_SL = {"De Laval Cone (Without Nozzle Extension)",
  1375.                                         "De Laval Bell (Without Nozzle Extension)"};
  1376.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_SL));
  1377.                                 Random nozzleTypeSLspikeChosen = new Random();
  1378.                                 int nozzleTypeSLspikeChosen_index = nozzleTypeSLspikeChosen.nextInt(nozzle_Type_List_SL.length);
  1379.                                 nozzle_Type_Chosen = nozzle_Type_List_SL[nozzleTypeSLspikeChosen_index];
  1380.                             } case "20-30 km (Medium Atmosphere)" -> {
  1381.                                 String[] nozzle_Type_List_HA = {"De Laval Bell (Without Nozzle Extension)", "De Laval Cone (With Nozzle Extension)",
  1382.                                         "De Laval Bell (With Nozzle Extension)", "Dual Bell Nozzle"};
  1383.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_HA));
  1384.                                 Random nozzleTypeHAspikeChosen = new Random();
  1385.                                 int nozzleTypeHAspikeChosen_index = nozzleTypeHAspikeChosen.nextInt(nozzle_Type_List_HA.length);
  1386.                                 nozzle_Type_Chosen = nozzle_Type_List_HA[nozzleTypeHAspikeChosen_index];
  1387.                             } case "30-80 km (High Atmosphere)" -> {
  1388.                                 String[] nozzle_Type_List_HAi = {"De Laval Cone (With Nozzle Extension)", "De Laval Bell (With Nozzle Extension)",
  1389.                                         "Dual Bell Nozzle"};
  1390.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_HAi));
  1391.                                 Random nozzleTypeHAispikeChosen = new Random();
  1392.                                 int nozzleTypeHAispikeChosen_index = nozzleTypeHAispikeChosen.nextInt(nozzle_Type_List_HAi.length);
  1393.                                 nozzle_Type_Chosen = nozzle_Type_List_HAi[nozzleTypeHAispikeChosen_index];
  1394.                             } case "80 km+ (Vacuum)" -> {
  1395.                                 String[] nozzle_Type_List_VA = {"De Laval Cone (With Nozzle Extension)",
  1396.                                         "De Laval Bell (With Nozzle Extension)", "Expanding Nozzle"};
  1397.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_VA));
  1398.                                 Random nozzleTypeVAspikeChosen = new Random();
  1399.                                 int nozzleTypeVAspikeChosen_index = nozzleTypeVAspikeChosen.nextInt(nozzle_Type_List_VA.length);
  1400.                                 nozzle_Type_Chosen = nozzle_Type_List_VA[nozzleTypeVAspikeChosen_index];
  1401.                             } case "Any Altitude (0-80 km+)" -> {
  1402.                                 String[] nozzle_Type_List_Aero = {"Linear Aerospike Nozzle", "Toroidal Aerospike Nozzle", "Expansion-Deflection Nozzle"};
  1403.                                 Collections.shuffle(Arrays.asList(nozzle_Type_List_Aero));
  1404.                                 Random nozzleTypeAerospikeChosen = new Random();
  1405.                                 int nozzleTypeAerospikeChosen_index = nozzleTypeAerospikeChosen.nextInt(nozzle_Type_List_Aero.length);
  1406.                                 nozzle_Type_Chosen = nozzle_Type_List_Aero[nozzleTypeAerospikeChosen_index];
  1407.                             }
  1408.                         }
  1409.                         System.out.println(lbrk + "\n" + "Your Engine is called: " + engine_Name + "\n");
  1410.                         System.out.println("Your Engine Cycle is: " + engine_Cycle_Chosen);
  1411.                         System.out.println("Your oxidizer is: " + oxidizer_Chosen);
  1412.                         System.out.println("Your Fuel is: " + fuel_Chosen);
  1413.                         System.out.println("Your Altitude of operation is: " + altitude_Of_Operation_Chosen);
  1414.                         System.out.println("Your engine's nozzle type should be : " + nozzle_Type_Chosen);
  1415.                         System.out.println("Tank repressurisation would be done " + tank_Repressurisation_Chosen + "\n");
  1416.                         XWPFDocument docx = new XWPFDocument();
  1417.                         if (new File(String.valueOf(pathn1)).exists()) {
  1418.                             docx = new XWPFDocument(new FileInputStream(String.valueOf(pathn1)));
  1419.                         }
  1420.                         XWPFParagraph par = docx.createParagraph();
  1421.                         XWPFRun run = par.createRun();
  1422.                         run.setFontSize(12);
  1423.                         run.setBold(true);
  1424.                         run.setFontFamily("Calibri");
  1425.                         run.setText("Your Engine is called: ");
  1426.                         XWPFRun run2 = par.createRun();
  1427.                         run2.setFontSize(12);
  1428.                         run.setBold(true);
  1429.                         run2.setFontFamily("Calibri");
  1430.                         run2.setText(engine_Name);
  1431.                         run2.addBreak();
  1432.                         // -----------------------------------------------------------
  1433.                         XWPFRun run3 = par.createRun();
  1434.                         run3.setFontSize(10);
  1435.                         run3.setBold(true);
  1436.                         run3.setFontFamily("Calibri");
  1437.                         run3.setText("Your Engine Cycle is: ");
  1438.                         XWPFRun run4 = par.createRun();
  1439.                         run4.setFontSize(10);
  1440.                         run4.setFontFamily("Calibri");
  1441.                         run4.setText(engine_Cycle_Chosen);
  1442.                         run4.addBreak();
  1443.                         // -----------------------------------------------------------
  1444.                         XWPFRun run5 = par.createRun();
  1445.                         run5.setFontSize(10);
  1446.                         run5.setBold(true);
  1447.                         run5.setFontFamily("Calibri");
  1448.                         run5.setText("Your oxidizer is: ");
  1449.                         XWPFRun run6 = par.createRun();
  1450.                         run6.setFontSize(10);
  1451.                         run6.setFontFamily("Calibri");
  1452.                         run6.setText(oxidizer_Chosen);
  1453.                         run6.addBreak();
  1454.                         // -----------------------------------------------------------
  1455.                         XWPFRun run8 = par.createRun();
  1456.                         run8.setFontSize(10);
  1457.                         run8.setBold(true);
  1458.                         run8.setFontFamily("Calibri");
  1459.                         run8.setText("Your Fuel is: ");
  1460.                         XWPFRun run7 = par.createRun();
  1461.                         run7.setFontSize(10);
  1462.                         run7.setFontFamily("Calibri");
  1463.                         run7.setText(fuel_Chosen);
  1464.                         run7.addBreak();
  1465.                         // -----------------------------------------------------------
  1466.                         XWPFRun run9 = par.createRun();
  1467.                         run9.setFontSize(10);
  1468.                         run9.setBold(true);
  1469.                         run9.setFontFamily("Calibri");
  1470.                         run9.setText("Your engine's nozzle type should be: ");
  1471.                         XWPFRun run0 = par.createRun();
  1472.                         run0.setFontSize(10);
  1473.                         run0.setFontFamily("Calibri");
  1474.                         run0.setText(nozzle_Type_Chosen);
  1475.                         run0.addBreak();
  1476.                         // -----------------------------------------------------------
  1477.                         XWPFRun run11 = par.createRun();
  1478.                         run11.setFontSize(10);
  1479.                         run11.setBold(true);
  1480.                         run11.setFontFamily("Calibri");
  1481.                         run11.setText("Tank repressurisation would be done ");
  1482.                         XWPFRun run12 = par.createRun();
  1483.                         run12.setFontSize(10);
  1484.                         run12.setBold(true);
  1485.                         run12.setFontFamily("Calibri");
  1486.                         run12.setText(tank_Repressurisation_Chosen);
  1487.                         run12.addBreak();
  1488.                         // -----------------------------------------------------------
  1489.                         try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
  1490.                             docx.write(out);
  1491.                         }
  1492.                     }
  1493.                 }
  1494.             } else {
  1495.                 while (!(repeatCommand.equalsIgnoreCase("Y") && repeatCommand.equalsIgnoreCase("N"))) {
  1496.                     System.out.println("wrong input!");
  1497.                     System.out.print("> ");
  1498.                     repeatCommand = scanner.next();
  1499.                     repeatCommand = repeatCommand.toUpperCase();
  1500.                     if (repeatCommand.equals("Y") || repeatCommand.equals("N")) {
  1501.                         break;
  1502.                     }
  1503.                 }
  1504.             }
  1505.         }
  1506.     }
  1507. }
  1508.  
Advertisement
Add Comment
Please, Sign In to add comment