Advertisement
Cnvmendoza

In this one Russia works

Nov 15th, 2021 (edited)
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 104.71 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <sstream>
  4. #include <cstdlib>
  5. #include <time.h>
  6. using namespace std;
  7. //Escape add
  8. float random(float x);
  9. string input;
  10. //Global
  11. //Inventory
  12. int potInv = 0, oilInv = 0, fishInv = 0, woolInv = 0, velvetInv = 0, toolsInv = 0, spiceInv = 0, ironInv = 0, flourInv = 0, dyeInv = 0, leatherInv = 0, furInv = 0, beerInv = 0, saltInv = 0, wineInv = 0;
  13. int qty = 0;    //quantity
  14. int inv = 0;
  15. //User
  16. float balance = 5000;
  17. //Trade Goods Prices, in order: Sweden, Poland
  18. //Escape-add;
  19. float x;
  20. float randomnum = random(x);
  21. float potPrice[7] = {90, 157.5, 157.5, 99, 67.5, 99, 90};
  22. float oilPrice[7] = {400, 300, 700, 700, 440, 440, 400};
  23. float fishPrice[7] = {50, 55, 87.5, 55, 87.5, 55, 50};
  24. float woolPrice[7] = {240, 180, 180, 264, 264, 264, 240};
  25. float velvetPrice[7] = {950, 1662.5, 1662.5, 990, 712.5, 990, 950};
  26. float toolsPrice[7] = {400, 300, 700, 440, 440, 400};
  27. float spicePrice[7] = {800, 1400, 600, 880, 600, 880, 800};
  28. float ironPrice[7] = {220, 365, 365, 365, 165, 242, 220};
  29. float flourPrice[7] = {50, 37.5, 87.5, 55, 87.5, 55, 50};
  30. float dyePrice[7] = {180, 198, 135, 198, 198, 198, 180};
  31. float leatherPrice[7] = {180, 198, 315, 135, 135, 198, 180};
  32. float furPrice[7] = {390, 429, 292.5, 429, 429, 429, 390};
  33. float beerPrice[7] = {100, 75, 175, 175, 175, 110, 100};
  34. float saltPrice[7] = {220, 165, 385, 165, 165, 242, 220};
  35. float winePrice[7] = {200, 220, 150, 220, 220, 220, 200};
  36.  
  37. float price;
  38. float priceArrays[100];
  39. //Country Mem
  40. string country = "None";    //Starting
  41. string place[7] = { "Sweden", "Poland", "Russia", "Crimea", "Saudi Arabia", "Ukraine", "China"};
  42. int land;   //index
  43. //Country Inv (Default inv)
  44. //surplus 200%;
  45. //well-met 100%;
  46. //high 75%; med 50%; low 25%;
  47. int potInvSwede = 150, potInvPol = 50, potInvRus = 100, potInvCri = 75, potInvSau= 150, potInvUkr= 75, potInvChi= 100; //well 100
  48. int oilInvSwede = 25, oilInvPol = 75, oilInvRus = 45, oilInvCri= 25, oilInvSau= 38, oilInvUkr= 38, oilInvChi= 50; //well 50
  49. int fishInvSwede = 150,     fishInvPol = 113,   fishInvRus = 75,    fishInvCri= 113,        fishInvSau = 75,    fishInvUkr = 113,   fishInvChi = 150; //well 75
  50. int woolInvSwede = 75,      woolInvPol = 56,    woolInvRus = 113,   woolInvCri= 56,         woolInvSau = 56,    woolInvUkr = 56,    woolInvChi=75; //well 75
  51. int velvetInvSwede =25,     velvetInvPol = 13,  velvetInvRus = 13,  velvetInvCri = 19,      velvetInvSau=38,    velvetInvUkr = 19,  velvetInvChi=25; //well 25
  52. int toolsInvSwede = 50,     toolsInvPol = 75,   toolsInvRus = 38,   toolsInvCri=38,         toolsInvSau=38,     toolsInvUkr = 38,   toolsInvChi=50; //well 50
  53. int spiceInvSwede = 30,     spiceInvPol = 15,   spiceInvRus = 45,   spiceInvCri= 23,        spiceInvSau= 23,    spiceInvUkr = 23,   spiceInvChi=30; //well 30
  54. int ironInvSwede = 100,     ironInvPol = 50,    ironInvRus = 50,    ironInvCri= 50,         ironInvSau=75,      ironInvUkr = 75,    ironInvChi = 100; //well 100
  55. int flourInvSwede = 150,    flourInvPol = 113,  flourInvRus = 75,   flourInvCri= 113,       flourInvSau= 75,    flourInvUkr = 113,  flourInvChi = 150; //well 150
  56. int dyeInvSwede = 75,       dyeInvPol = 56,     dyeInvRus= 113,     dyeInvCri = 56,         dyeInvSau= 56,      dyeInvUkr = 56,     dyeInvChi = 75; //well 75
  57. int leatherInvSwede = 75,   leatherInvPol = 56, leatherInvRus = 38, leatherInvCri = 113,    leatherInvSau=56,   leatherInvUkr = 56, leatherInvChi = 75; //well 75
  58. int furInvSwede = 75,       furInvPol = 56,     furInvRus = 113,    furInvCri = 56,         furInvSau=56,       furInvUkr = 56,     furInvChi = 75; //well 75
  59. int beerInvSwede =75,       beerInvPol = 113,   beerInvRus = 56,    beerInvCri = 38,        beerInvSau=38,      beerInvUkr = 56,    beerInvChi = 75; //well 75
  60. int saltInvSwede =75,       saltInvPol = 38,    saltInvRus = 56,    saltInvCri = 113,       saltInvSau=113,     saltInvUkr = 56,    saltInvChi = 75; //well 75
  61. int wineInvSwede =75,       wineInvPol = 56,    wineInvRus = 56,    wineInvCri = 113,       wineInvSau=56,      wineInvUkr = 56,    wineInvChi = 75; //well 75
  62.  
  63.  
  64. int inv_Country = 0; // For loop inv
  65. //Goods
  66. string tradeGoods[15] = { "Pottery ", "Oil ", "Fish ", "Wool Cloth ", "Velvet " , "Tools ", "Spices ", "Iron ", "Flour ", "Dyes ", "Leatherworks ", "Fur ", "Beer " , "Salt ", "Wine " };int goodNo;
  67. int goodType;
  68. //int remember strings
  69. int mem = 0;    //inv
  70. int mem2 = 0;   //notes
  71. int mem3 = 0;   //buy/sell
  72. //Turn Counter;
  73. //event variables
  74. int GOOJcard=0; // Get out of jail
  75. int turn=1;
  76. int investment=0;
  77. int event35=0;
  78. int Cauldron=0;
  79. int checkers=0;
  80. //End of Global
  81. //Escape add
  82. void random(void);
  83. //What do I do first?
  84. void loc(void);
  85.  
  86. //User's Inventory
  87. void check(void);
  88.  
  89. //Trade
  90. void trade(void);
  91.  
  92. //Buy function
  93. void buy(void);
  94.  
  95. //traded
  96. void traded(void);
  97.  
  98. //Quantity function
  99. void quantity(void);
  100.  
  101. //lack function
  102. void lack(void);
  103.  
  104. //Sell function
  105. void sell(void);
  106.  
  107. //Goods function
  108. void goods(void);
  109.  
  110. //Notes function
  111. void notes(void);
  112.  
  113. //Balance function
  114. void balance_balance(void);
  115.  
  116. //todo
  117. void todo(void);
  118. void todo2(void);
  119.  
  120. //Country Inventory
  121. void countryInv(void);
  122. void determineCountry(void);
  123. //Turn-based Events
  124. void turnCounter(void);
  125. void eventsNumbers(void);
  126. void events(int random);
  127.  
  128. main(){
  129.     if(balance<0)
  130. {
  131. cout << "You are now bankrupt. Game Over.";
  132. }
  133.  
  134. if (turn<=50) loc();
  135.     else{
  136.         cout<<"Your total money came to:" << balance;
  137.     }
  138. cout << "\nThanks for playing this simulator.";
  139.  
  140. exit(0);
  141. }
  142.  
  143. //loc function
  144. void loc(void){
  145.     if (turn<50 && checkers==0)
  146.     {
  147.         cout<<"Turn: "<<turn<<endl;
  148.         eventsNumbers();
  149.     }
  150.     else if (turn==50 && checkers==0)
  151.     {
  152.     cout<<"Turn: "<<turn<<" (LAST TURN!)"<<endl;
  153.     eventsNumbers();
  154.     }
  155.     else if (checkers==0)
  156.     {
  157.     main();
  158.     }
  159.     if (balance<0)
  160.     {
  161.     main();}
  162.  
  163.     country = "None";
  164.     int x = 0;
  165.     mem = 0;
  166.     mem2 = 0;
  167.     cout << endl;
  168.     cout << endl;
  169. cout << "Balance: Eur " << balance; cout << endl;
  170.     cout << "What do you want to do?";
  171.     cout << endl;
  172.     cout << "[1] Trade";
  173.     cout << endl;
  174.     cout << "[2] Check Inventory";
  175.     cout << endl;
  176.     cout << "[3] Exit";
  177.     cout << endl;
  178.     do {
  179.         cout << "Enter Input: ";
  180.         cin >> input;
  181.         stringstream(input) >> x;
  182.         switch (x)
  183.         {
  184.             case 1:
  185.                 trade();
  186.                 break;
  187.             case 2:
  188.                 checkers=1;
  189.                 check();
  190.                 break;
  191.             case 3:
  192.                 abort();
  193.             default:
  194.                 cout << "That's an invalid option. Please try again.";
  195.         }
  196.         cout << endl;
  197.     } while (input != "1" || input != "2");
  198. }
  199.  
  200. //check function
  201. void check(void){
  202.       cout << endl;
  203.     cout << "You currently have:";
  204.     cout << endl;
  205.     cout << potInv << " Pottery";
  206.     cout << endl;
  207.     cout << oilInv << " Oil";
  208.     cout << endl;
  209.     //potInv = 0, oilInv = 0; fishInv = 0; woolInv=0; velvetInv=0; toolsInv=0; spiceInv=0; ironInv=0; flourInv=0; dyeInv=0; leatherInv=0; furInv=0; beerInv=0, saltInv=0; wineInv=0;
  210.     cout << fishInv << " Fish";
  211.     cout << endl;
  212.     cout << woolInv << " Wool Cloth";
  213.     cout << endl;
  214.     cout << velvetInv << " Velvet";
  215.     cout << endl;
  216.     cout << toolsInv << " Tools";
  217.     cout << endl;
  218.     cout << spiceInv << " Spice";
  219.     cout << endl;
  220.     cout << ironInv << " Iron";
  221.     cout << endl;
  222.     cout << flourInv << " Flour";
  223.     cout << endl;
  224.     cout << dyeInv << " Dye";
  225.     cout << endl;
  226.     cout << leatherInv << " Leatherworks";
  227.     cout << endl;
  228.     cout << furInv << " Fur";
  229.     cout << endl;
  230.     cout << beerInv << " Beer";
  231.     cout << endl;
  232.     cout << saltInv << " Salt";
  233.     cout << endl;
  234.     cout << wineInv << " Wine";
  235.  
  236.         cout << endl;
  237.     cout << " ...in your inventory.";
  238.     cout << endl;
  239.     system("pause");
  240.     switch (mem){
  241.         case 0:
  242.             checkers=1;
  243.             loc();
  244.             break;
  245.         case 1:
  246.             trade();
  247.             break;
  248.         case 2:
  249.             buy();
  250.             break;
  251.         case 3:
  252.             sell();
  253.             break;
  254.         case 4:
  255.             todo2();
  256.             break;
  257.     }
  258. }
  259.  
  260. //trade function
  261. void trade(void){
  262.     mem = 1;
  263.     string input;
  264.     country = "None";
  265.     mem2 = 1;
  266.     int x;
  267.     cout << endl;
  268.     cout << "Country List: ";
  269.     cout << endl;
  270.     cout << "[1] " << "Sweden";
  271.     cout << endl;
  272.     cout << "[2] " << "Poland";
  273.     cout << endl;
  274.       cout << "[3] " << "Russia";
  275.       cout << endl;
  276.    
  277.     cout << "[4] " << "Crimea";
  278.     cout << endl;
  279.     cout << "[5] " << "Saudi Arabia";
  280.     cout << endl;
  281.     cout << "[6] " << "Ukraine";
  282.     cout << endl;
  283.     cout << "[7] " << "China";
  284.     cout << endl;
  285.     cout << "[8] " << "Check inventory";
  286.     cout << endl;
  287.     cout << "[9] " << "Check notes";
  288.     cout << endl;
  289.     cout << "[10] " << "Return";
  290.     cout << endl;
  291.     do{
  292.         cout << "Enter Input: ";
  293.         cin >> input;
  294.         stringstream(input) >> x;
  295.         switch (x){
  296. case 1:
  297.                 land = 0; // Sweden
  298.                 todo();
  299.                 break;
  300.             case 2:
  301.                 land = 1; // Poland
  302.                 todo();
  303.                 break;
  304.             case 3:
  305.                 land = 2; // Russia
  306.                 todo();
  307.                 break;
  308.             case 4:
  309.                 land = 3; // Crimea
  310.                 todo();
  311.                 break;
  312.             case 5:
  313.                 land = 4; // Saudi
  314.                 todo();
  315.                 break;
  316.             case 6:
  317.                 land = 5; // Ukraine
  318.                 todo();
  319.                 break;
  320.             case 7:
  321.                 land = 6; // China
  322.                 todo();
  323.                 break;
  324.             case 8:
  325.                 checkers=1;
  326.                 check();
  327.                 break;
  328.             case 9:
  329.                 checkers=1;
  330.                 notes();
  331.                 break;
  332.             case 10:
  333.                 checkers=1;
  334.                 loc();
  335.                 break;
  336.  
  337.                                     default:
  338.                 cout << "That's an invalid option. Please try again.";
  339.                 cout << endl;
  340.                 break;
  341.         }
  342. }while (input != "1" || input != "2" || input != "3" || input != "4" || input != "5" || input != "6"|| input != "7" || input !="8" || input != "9" || input != "10");
  343.         cout << endl;
  344. }
  345.  
  346. //goods function
  347. void goods(void){
  348.     cout << setprecision(2) << fixed;
  349.     cout << endl;
  350.     random();
  351.     cout << "[16] " << "Check inventory";
  352.     cout << endl;
  353.     cout << "[17] " << "Check notes";
  354.     cout << endl;
  355.     cout << "[18] " << "Return";
  356.     cout << endl;
  357. }
  358.  
  359. //buy function
  360. void buy(void){
  361.     string input;
  362.     int x;
  363.     mem = 2;
  364.     mem2 = 2;
  365.     mem3 = 0;
  366.     if (land == 0){
  367.         cout << endl;
  368.         cout << "You are trading with Sweden ... ";
  369.         cout << endl;
  370.     }
  371.     else if (land == 1){
  372.         cout << endl;
  373.         cout << "You are trading with Poland ... ";
  374.         cout << endl;
  375.     }
  376.       else if (land == 2){
  377.         cout << endl;
  378.         cout << "You are trading with Russia ... ";
  379.         cout << endl;
  380.     }
  381.    else if (land == 3){
  382.         cout << endl;
  383.         cout << "You are trading with Crimea . . . ";
  384.         cout << endl;
  385.     }
  386.     else if (land == 4){
  387.         cout << endl;
  388.         cout << "You are trading with Saudi Arabia . . . ";
  389.         cout << endl;
  390.     }
  391.     else if (land == 5){
  392.         cout << endl;
  393.         cout << "You are trading with Ukraine . . . ";
  394.         cout << endl;
  395.     }
  396.     else if (land == 6){
  397.         cout << endl;
  398.         cout << "You are trading with China . . . ";
  399.         cout << endl;
  400.     }
  401.  
  402.     country = "None";
  403.     balance_balance();
  404.     goods();
  405.     cout << "What do you want to buy? ";
  406.     cout << endl;
  407.     do{
  408.     cout << "Enter Input: ";
  409.     cin >> input;
  410.     stringstream(input) >> x;
  411.     switch (x){
  412.         case 1:
  413.             goodType = 0;
  414.             determineCountry();
  415.             inv = potInv;
  416.             price = priceArrays[goodType];
  417.             quantity();
  418.             if (balance < qty *price){
  419.                 lack();
  420.                 break;
  421.             }
  422.             else if (balance >= qty *price){
  423.                 traded();
  424.                 break;
  425.             }
  426.  
  427.         case 2:
  428.             goodType = 1;
  429.             determineCountry();
  430.             inv = oilInv;
  431.             price = priceArrays[goodType];
  432.             quantity();
  433.             if (balance < qty *price){
  434.                 lack();
  435.                 break;
  436.             }
  437.             else if (balance >= qty *price){
  438.                 traded();
  439.                 break;
  440.             }
  441.         case 3:
  442.             goodType = 2;
  443.             determineCountry();
  444.             inv = fishInv;
  445.             price = priceArrays[goodType];
  446.             quantity();
  447.             if (balance < qty *price){
  448.                 lack();
  449.                 break;
  450.             }
  451.             else if (balance >= qty *price){
  452.                 traded();
  453.                 break;
  454.             }
  455.         case 4:
  456.             goodType = 3;
  457.             determineCountry();
  458.             inv = woolInv;
  459.             price = priceArrays[goodType];
  460.             quantity();
  461.             if (balance < qty *price){
  462.                 lack();
  463.                 break;
  464.             }
  465.             else if (balance >= qty *price){
  466.                 traded();
  467.                 break;
  468.             }
  469.         case 5:
  470.             goodType = 4;
  471.             determineCountry();
  472.             inv = velvetInv;
  473.             price = priceArrays[goodType];
  474.             quantity();
  475.             if (balance < qty *price){
  476.                 lack();
  477.                 break;
  478.             }
  479.             else if (balance >= qty *price){
  480.                 traded();
  481.                 break;
  482.             }
  483.         case 6:
  484.             goodType = 5;
  485.             determineCountry();
  486.             inv = toolsInv;
  487.             price = priceArrays[goodType];
  488.             quantity();
  489.             if (balance < qty *price){
  490.                 lack();
  491.                 break;
  492.             }
  493.             else if (balance >= qty *price){
  494.                 traded();
  495.                 break;
  496.             }
  497.         case 7:
  498.             goodType = 6;
  499.             determineCountry();
  500.             inv = spiceInv;
  501.             price = priceArrays[goodType];
  502.             quantity();
  503.             if (balance < qty *price){
  504.                 lack();
  505.                 break;
  506.             }
  507.             else if (balance >= qty *price){
  508.                 traded();
  509.                 break;
  510.             }
  511.         //potInv = 0, oilInv = 0; fishInv = 0; woolInv=0; velvetInv=0; toolsInv=0; spiceInv=0; ironInv=0; flourInv=0; dyeInv=0; leatherInv=0; furInv=0; beerInv=0, saltInv=0; wineInv=0;
  512.         case 8:
  513.             goodType = 7;
  514.             determineCountry();
  515.             inv = ironInv;
  516.             price = priceArrays[goodType];
  517.             quantity();
  518.             if (balance < qty *price){
  519.                 lack();
  520.                 break;
  521.             }
  522.             else if (balance >= qty *price){
  523.                 traded();
  524.                 break;
  525.             }
  526.         case 9:
  527.             goodType = 8;
  528.             determineCountry();
  529.             inv = flourInv;
  530.             price = priceArrays[goodType];
  531.             quantity();
  532.             if (balance < qty *price){
  533.                 lack();
  534.                 break;
  535.             }
  536.             else if (balance >= qty *price){
  537.                 traded();
  538.                 break;
  539.             }
  540.         case 10:
  541.             goodType = 9;
  542.             determineCountry();
  543.             inv = dyeInv;
  544.             price = priceArrays[goodType];
  545.             quantity();
  546.             if (balance < qty *price){
  547.                 lack();
  548.                 break;
  549.             }
  550.             else if (balance >= qty *price){
  551.                 traded();
  552.                 break;
  553.             }
  554.         case 11:
  555.             goodType = 10;
  556.             determineCountry();
  557.             inv = leatherInv;
  558.             price = priceArrays[goodType];
  559.             quantity();
  560.             if (balance < qty *price){
  561.                 lack();
  562.                 break;
  563.             }
  564.             else if (balance >= qty *price){
  565.                 traded();
  566.                 break;
  567.             }
  568.         case 12:
  569.             goodType = 11;
  570.             determineCountry();
  571.             inv = furInv;
  572.             price = priceArrays[goodType];
  573.             quantity();
  574.             if (balance < qty *price){
  575.                 lack();
  576.                 break;
  577.             }
  578.             else if (balance >= qty *price){
  579.                 traded();
  580.                 break;
  581.             }
  582.         case 13:
  583.             goodType = 12;
  584.             determineCountry();
  585.             inv = beerInv;
  586.             price = priceArrays[goodType];
  587.             quantity();
  588.             if (balance < qty *price){
  589.                 lack();
  590.                 break;
  591.             }
  592.             else if (balance >= qty *price){
  593.                 traded();
  594.                 break;
  595.             }
  596.         case 14:
  597.             goodType = 13;
  598.             determineCountry();
  599.             inv = saltInv;
  600.             price = priceArrays[goodType];
  601.             quantity();
  602.             if (balance < qty *price){
  603.                 lack();
  604.                 break;
  605.             }
  606.             else if (balance >= qty *price){
  607.                 traded();
  608.                 break;
  609.             }
  610.         case 15:
  611.             goodType = 14;
  612.             determineCountry();
  613.             inv = wineInv;
  614.             price = priceArrays[goodType];
  615.             quantity();
  616.             if (balance < qty *price){
  617.                 lack();
  618.                 break;
  619.             }
  620.             else if (balance >= qty *price){
  621.                 traded();
  622.                 break;
  623.             }
  624.         case 16:
  625.             check();
  626.             break;
  627.         case 17:
  628.             notes();
  629.             break;
  630.         case 18:
  631.             trade();
  632.             break;
  633.  
  634.         default:
  635.             cout << "That's an invalid option. Please try again.";
  636.             cout << endl;
  637.     }
  638.     } while (input != "1" || input != "2"|| input != "3"|| input != "4"|| input != "5"|| input != "6"|| input != "7"|| input != "8"|| input != "9"|| input != "10"|| input != "11"|| input != "12"|| input != "13"|| input != "14"|| input != "15"|| input != "16"|| input != "17"|| input != "18");
  639.  
  640. }
  641.  
  642. //traded function
  643. void traded(void){
  644.     cout << setprecision(2) << fixed;
  645.     if (mem3 == 0){ //buy
  646.         balance -= qty * price;
  647.         balance_balance();
  648.         cout << endl;
  649.         cout << "You bought " << tradeGoods[goodType] << "for Eur " << qty * price << ".";
  650.         cout << endl;
  651.         if (goodType==0) potInv+=qty;
  652.         else if (goodType==1) oilInv+=qty;
  653.         else if (goodType==2) fishInv+=qty;
  654.         else if (goodType==3) woolInv+=qty;
  655.         else if (goodType==4) velvetInv+=qty;
  656.         else if (goodType==5) toolsInv+=qty;
  657.         else if (goodType==6) spiceInv+=qty;
  658.         else if (goodType==7) ironInv+=qty;
  659.         else if (goodType==8) flourInv+=qty;
  660.         else if (goodType==9) dyeInv+=qty;
  661.         else if (goodType==10) leatherInv+=qty;
  662.         else if (goodType==11) furInv+=qty;
  663.         else if (goodType==12) beerInv+=qty;
  664.         else if (goodType==13) saltInv+=qty;
  665.         else if (goodType==14) wineInv+=qty;
  666.     }
  667.     else if (mem3 == 1){ //sell
  668.         balance += qty * price;
  669.         balance_balance();
  670.         cout << endl;
  671.         cout << "You sold " << tradeGoods[goodType] << " for Eur " << qty * price << ".";
  672.         cout << endl;
  673.         if (goodType==0) potInv-=qty;
  674.         else if (goodType==1) oilInv-=qty;
  675.         else if (goodType==2) fishInv-=qty;
  676.         else if (goodType==3) woolInv-=qty;
  677.         else if (goodType==4) velvetInv-=qty;
  678.         else if (goodType==5) toolsInv-=qty;
  679.         else if (goodType==6) spiceInv-=qty;
  680.         else if (goodType==7) ironInv-=qty;
  681.         else if (goodType==8) flourInv-=qty;
  682.         else if (goodType==9) dyeInv-=qty;
  683.         else if (goodType==10) leatherInv-=qty;
  684.         else if (goodType==11) furInv-=qty;
  685.         else if (goodType==12) beerInv-=qty;
  686.         else if (goodType==13) saltInv-=qty;
  687.         else if (goodType==14) wineInv-=qty;
  688.         cout << endl;
  689.  
  690.     }
  691.     turn++;
  692.     checkers=0;
  693.     if(turn%20==0)
  694.     {
  695.     potInvSwede*=1.1;
  696.     potInvPol*=1.1;
  697.     potInvRus*=1.1;
  698.     potInvCri*=1.1;
  699.     potInvSau*=1.1;
  700.     potInvUkr*=1.1;
  701.     potInvChi*=1.1;
  702.     oilInvSwede*=1.1;
  703.     oilInvPol*=1.1;
  704.     oilInvRus*=1.1 ;
  705.     oilInvCri*=1.1;
  706.     oilInvSau*=1.1;
  707.     oilInvUkr*=1.1;
  708.     oilInvChi*=1.1;
  709.     fishInvSwede*=1.1;  
  710.     fishInvPol*=1.1;   
  711.     fishInvRus*=1.1;   
  712.     fishInvCri*=1.1;       
  713.     fishInvSau*=1.1;
  714.     fishInvUkr*=1.1;
  715.     fishInvChi*=1.1;
  716.     woolInvSwede*=1.1;     
  717.     woolInvPol*=1.1;    
  718.     woolInvRus*=1.1;   
  719.     woolInvCri*=1.1;   
  720.     woolInvSau*=1.1;   
  721.     woolInvUkr*=1.1;   
  722.     woolInvChi*=1.1;
  723.     velvetInvSwede*=1.1;   
  724.     velvetInvPol*=1.1; 
  725.     velvetInvRus*=1.1; 
  726.     velvetInvCri*=1.1;     
  727.     velvetInvSau*=1.1; 
  728.     velvetInvUkr*=1.1; 
  729.     velvetInvChi*=1.1;
  730.     toolsInvSwede*=1.1;
  731.     toolsInvPol*=1.1;  
  732.     toolsInvRus*=1.1;  
  733.     toolsInvCri*=1.1;      
  734.     toolsInvSau*=1.1;      
  735.     toolsInvUkr*=1.1;  
  736.     toolsInvChi*=1.1;
  737.     spiceInvSwede*=1.1;
  738.     spiceInvPol*=1.1;  
  739.     spiceInvRus*=1.1;  
  740.     spiceInvCri*=1.1;      
  741.     spiceInvSau*=1.1;  
  742.     spiceInvUkr*=1.1;  
  743.     spiceInvChi*=1.1;
  744.     ironInvSwede*=1.1; 
  745.     ironInvPol*=1.1;
  746.     ironInvRus*=1.1;    
  747.     ironInvCri*=1.1;       
  748.     ironInvSau*=1.1;   
  749.     ironInvUkr*=1.1;   
  750.     ironInvChi*=1.1;
  751.     flourInvSwede*=1.1;
  752.     flourInvPol*=1.1;  
  753.     flourInvRus*=1.1;  
  754.     flourInvCri*=1.1;      
  755.     flourInvSau*=1.1;  
  756.     flourInvUkr*=1.1;
  757.     flourInvChi*=1.1;
  758.     dyeInvSwede*=1.1;  
  759.     dyeInvPol*=1.1;
  760.     dyeInvRus*=1.1;    
  761.     dyeInvCri*=1.1;    
  762.     dyeInvSau*=1.1;    
  763.     dyeInvUkr*=1.1;
  764.     dyeInvChi*=1.1;
  765.     leatherInvSwede*=1.1;  
  766.     leatherInvPol*=1.1;
  767.     leatherInvRus*=1.1;
  768.     leatherInvCri*=1.1;
  769.     leatherInvSau*=1.1;
  770.     leatherInvUkr*=1.1;
  771.     leatherInvChi*=1.1;
  772.     furInvSwede*=1.1;      
  773.     furInvPol*=1.1;    
  774.     furInvRus*=1.1;
  775.     furInvCri*=1.1;
  776.     furInvSau*=1.1;    
  777.     furInvUkr*=1.1;
  778.     furInvChi*=1.1;
  779.     beerInvSwede*=1.1;     
  780.     beerInvPol*=1.1;   
  781.     beerInvRus*=1.1;   
  782.     beerInvCri*=1.1;       
  783.     beerInvSau*=1.1;       
  784.     beerInvUkr*=1.1;   
  785.     beerInvChi*=1.1;
  786.     saltInvSwede*=1.1;     
  787.     saltInvPol*=1.1;    
  788.     saltInvRus*=1.1;   
  789.     saltInvCri*=1.1;       
  790.     saltInvSau*=1.1;   
  791.     saltInvUkr*=1.1;   
  792.     saltInvChi*=1.1;
  793.     wineInvSwede*=1.1;     
  794.     wineInvPol*=1.1;    
  795.     wineInvRus*=1.1;
  796.     wineInvCri*=1.1;
  797.     wineInvSau*=1.1;       
  798.     wineInvUkr*=1.1;
  799.     wineInvChi*=1.1;
  800.     }
  801.  
  802.     system("pause");
  803.     loc();
  804. }
  805.  
  806. //quantity function
  807. void quantity(void){
  808.     mem = 4;
  809.     if (mem3 == 0){
  810.         cout << "How many " << tradeGoods[goodType] << " do you want to buy? ";
  811.         cin >> qty;
  812.         if (qty < 0){
  813.             quantity();
  814.         }
  815.         countryInv();
  816.     }
  817.     else if (mem3 == 1){
  818.         cout << "How many " << tradeGoods[goodType] << " do you want to sell? ";
  819.         cin >> qty;
  820.         if (qty < 0){
  821.             quantity();
  822.         }
  823.         countryInv();
  824.     }
  825.     else quantity();
  826. }
  827.  
  828. //lacking function
  829. void lack(void){
  830.     if (mem3 == 0){
  831.         cout << endl;
  832.         cout << "You have insufficient balance ... ";
  833.         cout << endl;
  834.         system("pause");
  835.         buy();
  836.     }
  837.     else if (mem3 == 1){
  838.         cout << endl;
  839.         cout << "You don't have " << qty << " of " << tradeGoods[goodType];
  840.         cout << endl;
  841.         system("pause");
  842.         sell();
  843.     }
  844. }
  845.  
  846. //sell function
  847. void sell(void){
  848.     string input;
  849.     int x;
  850.     mem = 3;
  851.     mem2 = 3;
  852.     mem3 = 1;
  853.     country = "None";
  854.     balance_balance();
  855.     goods();
  856.     cout << "What do you want to sell? ";
  857.     cout << endl;
  858.     do {
  859.     cout << "Enter Input: ";
  860.     cin >> input;
  861.     stringstream(input) >> x;
  862.     switch (x){
  863.        case 1:
  864.             goodType = 0;
  865.             determineCountry();
  866.             inv = potInv;
  867.             price = priceArrays[goodType];
  868.             quantity();
  869.             if (inv < qty){
  870.                 lack();
  871.                 break;
  872.             }
  873.             else if (inv >= qty){
  874.                 traded();
  875.                 break;
  876.             }
  877.         case 2:
  878.             goodType = 1;
  879.             determineCountry();
  880.             inv = oilInv;
  881.             price = priceArrays[goodType];
  882.             quantity();
  883.             if (inv < qty){
  884.                 lack();
  885.                 break;
  886.             }
  887.             else if (inv >= qty){
  888.                 traded();
  889.                 break;
  890.             }
  891.         case 3:
  892.             goodType = 2;
  893.             determineCountry();
  894.             inv = fishInv;
  895.             price = priceArrays[goodType];
  896.             quantity();
  897.             if (inv < qty){
  898.                 lack();
  899.                 break;
  900.             }
  901.             else if (inv >= qty){
  902.                 traded();
  903.                 break;
  904.             }
  905.         case 4:
  906.             goodType = 3;
  907.             determineCountry();
  908.             inv = woolInv;
  909.             price = priceArrays[goodType];
  910.             quantity();
  911.             if (inv < qty){
  912.                 lack();
  913.                 break;
  914.             }
  915.             else if (inv >= qty){
  916.                 traded();
  917.                 break;
  918.             }
  919.         case 5:
  920.             goodType = 4;
  921.             determineCountry();
  922.             inv = velvetInv;
  923.             price = priceArrays[goodType];
  924.             quantity();
  925.             if (inv < qty){
  926.                 lack();
  927.                 break;
  928.             }
  929.             else if (inv >= qty){
  930.                 traded();
  931.                 break;
  932.             }
  933.         case 6:
  934.             goodType = 5;
  935.             determineCountry();
  936.             inv = toolsInv;
  937.             price = priceArrays[goodType];
  938.             quantity();
  939.             if (inv < qty){
  940.                 lack();
  941.                 break;
  942.             }
  943.             else if (inv >= qty){
  944.                 traded();
  945.                 break;
  946.             }
  947.         case 7:
  948.             goodType = 6;
  949.             determineCountry();
  950.             inv = spiceInv;
  951.             price = priceArrays[goodType];
  952.             quantity();
  953.             if (inv < qty){
  954.                 lack();
  955.                 break;
  956.             }
  957.             else if (inv >= qty){
  958.                 traded();
  959.                 break;
  960.             }
  961.         case 8:
  962.             goodType = 7;
  963.             determineCountry();
  964.             inv = ironInv;
  965.             price = priceArrays[goodType];
  966.             quantity();
  967.             if (inv < qty){
  968.                 lack();
  969.                 break;
  970.             }
  971.             else if (inv >= qty){
  972.                 traded();
  973.                 break;
  974.             }
  975.         case 9:
  976.             goodType = 8;
  977.             determineCountry();
  978.             inv = flourInv;
  979.             price = priceArrays[goodType];
  980.             quantity();
  981.             if (inv < qty){
  982.                 lack();
  983.                 break;
  984.             }
  985.             else if (inv >= qty){
  986.                 traded();
  987.                 break;
  988.             }
  989.         case 10:
  990.             goodType = 9;
  991.             determineCountry();
  992.             inv = dyeInv;
  993.             price = priceArrays[goodType];
  994.             quantity();
  995.             if (inv < qty){
  996.                 lack();
  997.                 break;
  998.             }
  999.             else if (inv >= qty){
  1000.                 traded();
  1001.                 break;
  1002.             }
  1003.         case 11:
  1004.             goodType = 10;
  1005.             determineCountry();
  1006.             inv = leatherInv;
  1007.             price = priceArrays[goodType];
  1008.             quantity();
  1009.             if (inv < qty){
  1010.                 lack();
  1011.                 break;
  1012.             }
  1013.             else if (inv >= qty){
  1014.                 traded();
  1015.                 break;
  1016.             }
  1017.         case 12:
  1018.             goodType = 11;
  1019.             determineCountry();
  1020.             inv = furInv;
  1021.             price = priceArrays[goodType];
  1022.             quantity();
  1023.             if (inv < qty){
  1024.                 lack();
  1025.                 break;
  1026.             }
  1027.             else if (inv >= qty){
  1028.                 traded();
  1029.                 break;
  1030.             }
  1031.         case 13:
  1032.             goodType = 12;
  1033.             determineCountry();
  1034.             inv = beerInv;
  1035.             price = priceArrays[goodType];
  1036.             quantity();
  1037.             if (inv < qty){
  1038.                 lack();
  1039.                 break;
  1040.             }
  1041.             else if (inv >= qty){
  1042.                 traded();
  1043.                 break;
  1044.             }
  1045.         case 14:
  1046.             goodType = 13;
  1047.             determineCountry();
  1048.             inv = saltInv;
  1049.             price = priceArrays[goodType];
  1050.             quantity();
  1051.             if (inv < qty){
  1052.                 lack();
  1053.                 break;
  1054.             }
  1055.             else if (inv >= qty){
  1056.                 traded();
  1057.                 break;
  1058.             }
  1059.         case 15:
  1060.             goodType = 14;
  1061.             determineCountry();
  1062.             inv = wineInv;
  1063.             price = priceArrays[goodType];
  1064.             quantity();
  1065.             if (inv < qty){
  1066.                 lack();
  1067.                 break;
  1068.             }
  1069.             else if (inv >= qty){
  1070.                 traded();
  1071.                 break;
  1072.             }
  1073.         case 16:
  1074.             check();
  1075.             break;
  1076.         case 17:
  1077.             notes();
  1078.             break;
  1079.         case 18:
  1080.             trade();
  1081.             break;
  1082.         default:
  1083.             cout << "That's an invalid option. Please try again.";
  1084.         cout << endl;
  1085.     } }while (input != "1" || input != "2"|| input != "3"|| input != "4"|| input != "5"|| input != "6"|| input != "7");
  1086.  
  1087.        
  1088. }
  1089. //notes function
  1090. void notes(void){
  1091.     if (country == "Sweden"){
  1092.         cout << endl;
  1093.         cout << "Sweden's exports and imports are well-met . . . ";
  1094.         cout << endl;
  1095.         //For checking . . .
  1096.         cout << "Sweden's Inventory . . . ";
  1097.         cout << endl;
  1098.         cout << "Pottery: " << potInvSwede;
  1099.         cout << endl;
  1100.         cout << "Oil: " << oilInvSwede;
  1101.         cout << endl;
  1102.         cout << "Fish: " << fishInvSwede;
  1103.         cout << endl;
  1104.         cout << "Wool Cloth:" << woolInvSwede;
  1105.         cout << endl;
  1106.         cout << "Velvet: " << velvetInvSwede;
  1107.         cout << endl;
  1108.         cout << "Tools: " << toolsInvSwede;
  1109.         cout << endl;
  1110.         cout << "Spice: " << spiceInvSwede;
  1111.         cout << endl;
  1112.         cout << "Iron: " << ironInvSwede;
  1113.         cout << endl;
  1114.         cout << "Flour: " << flourInvSwede;
  1115.         cout << endl;
  1116.         cout << "Dyes: " << dyeInvSwede;
  1117.         cout << endl;
  1118.         cout << "Leatherworks: " << leatherInvSwede;
  1119.         cout << endl;
  1120.         cout << "Fur: " << furInvSwede;
  1121.         cout << endl;
  1122.         cout << "Beer: " << beerInvSwede;
  1123.         cout << endl;
  1124.         cout << "Salt: " << saltInvSwede;
  1125.         cout << endl;
  1126.         cout << "Wine: " << wineInvSwede;
  1127.         cout << endl;
  1128.     }
  1129.     else if (country == "Poland"){
  1130.         cout << endl;
  1131.         cout << "Poland's Exports and Imports . . . ";
  1132.         cout << endl;
  1133.         cout << "Exports: Oil, Beer, Flour, Tools";
  1134.         cout << endl;
  1135.         cout << "Imports: Velvet, Iron, Spice, Pottery";
  1136.         cout << endl;
  1137.         // Checking . . .
  1138.         cout << "Poland's Inventory . . . ";
  1139.         cout << endl;
  1140.         cout << "Pottery: " << potInvPol;
  1141.         cout << endl;
  1142.         cout << "Oil: " << oilInvPol;
  1143.         cout << endl;
  1144.         cout << "Fish: " << fishInvPol;
  1145.         cout << endl;
  1146.         cout << "Wool Cloth:" << woolInvPol;
  1147.         cout << endl;
  1148.         cout << "Velvet: " << velvetInvPol;
  1149.         cout << endl;
  1150.         cout << "Tools: " << toolsInvPol;
  1151.         cout << endl;
  1152.         cout << "Spice: " << spiceInvPol;
  1153.         cout << endl;
  1154.         cout << "Iron: " << ironInvPol;
  1155.         cout << endl;
  1156.         cout << "Flour: " << flourInvPol;
  1157.         cout << endl;
  1158.         cout << "Dyes: " << dyeInvPol;
  1159.         cout << endl;
  1160.         cout << "Leatherworks: " << leatherInvPol;
  1161.         cout << endl;
  1162.         cout << "Fur: " << furInvPol;
  1163.         cout << endl;
  1164.         cout << "Beer: " << beerInvPol;
  1165.         cout << endl;
  1166.         cout << "Salt: " << saltInvPol;
  1167.         cout << endl;
  1168.         cout << "Wine: " << wineInvPol;
  1169.         cout << endl;
  1170.     }
  1171.     else if (country == "Russia"){
  1172.         cout << endl;
  1173.         cout << "Russia's Exports and Imports . . . ";
  1174.         cout << endl;
  1175.         cout << "Exports: Furs, Dyes, Spice, Wool";
  1176.         cout << endl;
  1177.         cout << "Imports: Oil, Fish, Salt, Velvet, Flour, Pottery, Beer, Tools, Iron, Leatherworks";
  1178.         cout << endl;
  1179.         // Checking . . .
  1180.         cout << "Russia's Inventory . . . ";
  1181.         cout << endl;
  1182.         cout << "Pottery: " << potInvRus;
  1183.         cout << endl;
  1184.         cout << "Oil: " << oilInvRus;
  1185.         cout << endl;
  1186.         cout << "Fish: " << fishInvRus;
  1187.         cout << endl;
  1188.         cout << "Wool Cloth:" << woolInvRus;
  1189.         cout << endl;
  1190.         cout << "Velvet: " << velvetInvRus;
  1191.         cout << endl;
  1192.         cout << "Tools: " << toolsInvRus;
  1193.         cout << endl;
  1194.         cout << "Spice: " << spiceInvRus;
  1195.         cout << endl;
  1196.         cout << "Iron: " << ironInvRus;
  1197.         cout << endl;
  1198.         cout << "Flour: " << flourInvRus;
  1199.         cout << endl;
  1200.         cout << "Dyes: " << dyeInvRus;
  1201.         cout << endl;
  1202.         cout << "Leatherworks: " << leatherInvRus;
  1203.         cout << endl;
  1204.         cout << "Fur: " << furInvRus;
  1205.         cout << endl;
  1206.         cout << "Beer: " << beerInvRus;
  1207.         cout << endl;
  1208.         cout << "Salt: " << saltInvRus;
  1209.         cout << endl;
  1210.         cout << "Wine: " << wineInvRus;
  1211.         cout << endl;
  1212.     }
  1213.     else if (country == "Crimea"){
  1214.         cout << endl;
  1215.         cout << "Crimea's Exports and Imports . . . ";
  1216.         cout << endl;
  1217.         cout << "Exports: Leatherworks, Salt, Wine";
  1218.         cout << endl;
  1219.         cout << "Imports: Iron, Oil, Beer";
  1220.         cout << endl;
  1221.         // Checking . . .
  1222.         cout << "Crimea's Inventory . . . ";
  1223.         cout << endl;
  1224.         cout << "Pottery: " << potInvCri;
  1225.         cout << endl;
  1226.         cout << "Oil: " << oilInvCri;
  1227.         cout << endl;
  1228.         cout << "Fish: " << fishInvCri;
  1229.         cout << endl;
  1230.         cout << "Wool Cloth:" << woolInvCri;
  1231.         cout << endl;
  1232.         cout << "Velvet: " << velvetInvCri;
  1233.         cout << endl;
  1234.         cout << "Tools: " << toolsInvCri;
  1235.         cout << endl;
  1236.         cout << "Spice: " << spiceInvCri;
  1237.         cout << endl;
  1238.         cout << "Iron: " << ironInvCri;
  1239.         cout << endl;
  1240.         cout << "Flour: " << flourInvCri;
  1241.         cout << endl;
  1242.         cout << "Dyes: " << dyeInvCri;
  1243.         cout << endl;
  1244.         cout << "Leatherworks: " << leatherInvCri;
  1245.         cout << endl;
  1246.         cout << "Fur: " << furInvCri;
  1247.         cout << endl;
  1248.         cout << "Beer: " << beerInvCri;
  1249.         cout << endl;
  1250.         cout << "Salt: " << saltInvCri;
  1251.         cout << endl;
  1252.         cout << "Wine: " << wineInvCri;
  1253.         cout << endl;
  1254.     }
  1255.     else if (country == "Saudi"){
  1256.         cout << endl;
  1257.         cout << "Saudi Arabia's Exports and Imports . . . ";
  1258.         cout << endl;
  1259.         cout << "Exports: Salt, Pottery, Velvet";
  1260.         cout << endl;
  1261.         cout << "Imports: Flour, Beer, Fish";
  1262.         cout << endl;
  1263.         // Checking . . .
  1264.         cout << "Pottery: " << potInvSau;
  1265.         cout << endl;
  1266.         cout << "Oil: " << oilInvSau;
  1267.         cout << endl;
  1268.         cout << "Fish: " << fishInvSau;
  1269.         cout << endl;
  1270.         cout << "Wool Cloth:" << woolInvSau;
  1271.         cout << endl;
  1272.         cout << "Velvet: " << velvetInvSau;
  1273.         cout << endl;
  1274.         cout << "Tools: " << toolsInvSau;
  1275.         cout << endl;
  1276.         cout << "Spice: " << spiceInvSau;
  1277.         cout << endl;
  1278.         cout << "Iron: " << ironInvSau;
  1279.         cout << endl;
  1280.         cout << "Flour: " << flourInvSau;
  1281.         cout << endl;
  1282.         cout << "Dyes: " << dyeInvSau;
  1283.         cout << endl;
  1284.         cout << "Leatherworks: " << leatherInvSau;
  1285.         cout << endl;
  1286.         cout << "Fur: " << furInvSau;
  1287.         cout << endl;
  1288.         cout << "Beer: " << beerInvSau;
  1289.         cout << endl;
  1290.         cout << "Salt: " << saltInvSau;
  1291.         cout << endl;
  1292.         cout << "Wine: " << wineInvSau;
  1293.         cout << endl;
  1294.     }
  1295.     else if (country == "Ukraine"){
  1296.         cout << endl;
  1297.         cout << "Ukraine's exports and imports are slightly well-met . . . ";
  1298.         cout << endl;
  1299.         //For checking . . .
  1300.         cout << "Ukraine's Inventory . . . ";
  1301.         cout << endl;
  1302.         cout << "Pottery: " << potInvUkr;
  1303.         cout << endl;
  1304.         cout << "Oil: " << oilInvUkr;
  1305.         cout << endl;
  1306.         cout << "Fish: " << fishInvUkr;
  1307.         cout << endl;
  1308.         cout << "Wool Cloth:" << woolInvUkr;
  1309.         cout << endl;
  1310.         cout << "Velvet: " << velvetInvUkr;
  1311.         cout << endl;
  1312.         cout << "Tools: " << toolsInvUkr;
  1313.         cout << endl;
  1314.         cout << "Spice: " << spiceInvUkr;
  1315.         cout << endl;
  1316.         cout << "Iron: " << ironInvUkr;
  1317.         cout << endl;
  1318.         cout << "Flour: " << flourInvUkr;
  1319.         cout << endl;
  1320.         cout << "Dyes: " << dyeInvUkr;
  1321.         cout << endl;
  1322.         cout << "Leatherworks: " << leatherInvUkr;
  1323.         cout << endl;
  1324.         cout << "Fur: " << furInvUkr;
  1325.         cout << endl;
  1326.         cout << "Beer: " << beerInvUkr;
  1327.         cout << endl;
  1328.         cout << "Salt: " << saltInvUkr;
  1329.         cout << endl;
  1330.         cout << "Wine: " << wineInvUkr;
  1331.         cout << endl;
  1332.     }
  1333.     else if (country == "China"){
  1334.         cout << endl;
  1335.         cout << "China's exports and imports are well-met . . . ";
  1336.         cout << endl;
  1337.         //For checking . . .
  1338.         cout << "China's Inventory . . . ";
  1339.         cout << endl;
  1340.         cout << "Pottery: " << potInvChi;
  1341.         cout << endl;
  1342.         cout << "Oil: " << oilInvChi;
  1343.         cout << endl;
  1344.         cout << "Fish: " << fishInvChi;
  1345.         cout << endl;
  1346.         cout << "Wool Cloth:" << woolInvChi;
  1347.         cout << endl;
  1348.         cout << "Velvet: " << velvetInvChi;
  1349.         cout << endl;
  1350.         cout << "Tools: " << toolsInvChi;
  1351.         cout << endl;
  1352.         cout << "Spice: " << spiceInvChi;
  1353.         cout << endl;
  1354.         cout << "Iron: " << ironInvChi;
  1355.         cout << endl;
  1356.         cout << "Flour: " << flourInvChi;
  1357.         cout << endl;
  1358.         cout << "Dyes: " << dyeInvChi;
  1359.         cout << endl;
  1360.         cout << "Leatherworks: " << leatherInvChi;
  1361.         cout << endl;
  1362.         cout << "Fur: " << furInvChi;
  1363.         cout << endl;
  1364.         cout << "Beer: " << beerInvChi;
  1365.         cout << endl;
  1366.         cout << "Salt: " << saltInvChi;
  1367.         cout << endl;
  1368.         cout << "Wine: " << wineInvChi;
  1369.         cout << endl;
  1370.     }
  1371.  
  1372.    
  1373.     else if (country == "None"){
  1374.         cout << "Input country notes: ";
  1375.         cin >> country;
  1376.         notes();
  1377.     }
  1378.     else{
  1379.         cout << "Input country notes: ";
  1380.                 cin >> country;
  1381.                 notes();
  1382.     }
  1383.     system("pause");
  1384.     if (mem2 == 1) trade();
  1385.     else if (mem2 == 2) buy();
  1386.     else if (mem2 == 3) sell();
  1387.     else if (mem2 == 4) quantity();
  1388.     else if (mem2 == 5) todo2();
  1389. }
  1390.  
  1391. //balance function
  1392. void balance_balance(void){
  1393.     cout << endl;
  1394.     cout << setprecision(2) << fixed;
  1395.     cout << "Balance: Eur " << balance;
  1396.     cout << endl;
  1397. }
  1398.  
  1399. //todo function
  1400. void todo(void){
  1401.     if (land == 0){
  1402.         cout << endl;
  1403.         cout << "You are now trading with Sweden ... ";
  1404.         cout << endl;
  1405.         todo2();
  1406.     }
  1407.     else if (land == 1){
  1408.         cout << endl;
  1409.         cout << "You are now trading with Poland ... ";
  1410.         cout << endl;
  1411.         todo2();
  1412.     }
  1413.       else if (land == 2){
  1414.         cout << endl;
  1415.         cout << "You are now trading with Russia ... ";
  1416.         cout << endl;
  1417.         todo2();
  1418.     }
  1419.     else if (land == 3){
  1420.         cout << endl;
  1421.         cout << "You are now trading with Crimea . . . ";
  1422.         cout << endl;
  1423.         todo2();
  1424.     }
  1425.     else if (land == 4){
  1426.         cout << endl;
  1427.         cout << "You are now trading with Saudi Arabia . . . ";
  1428.         cout << endl;
  1429.         todo2();
  1430.     }
  1431.     else if (land == 5){
  1432.         cout << endl;
  1433.         cout << "You are now trading with Ukraine . . . ";
  1434.         cout << endl;
  1435.         todo2();
  1436.     }
  1437.     else if (land == 6){
  1438.         cout << endl;
  1439.         cout << "You are now trading with China . . . ";
  1440.         cout << endl;
  1441.         todo2();
  1442.     }
  1443.  
  1444. }
  1445.  
  1446. //todo2 function
  1447. void todo2(void){
  1448.     int x;
  1449.     country = "None";
  1450.     mem = 4;
  1451.     mem2 = 5;
  1452.     cout << endl;
  1453.     cout << "[1] Buy";
  1454.     cout << endl;
  1455.     cout << "[2] Sell";
  1456.     cout << endl;
  1457.     cout << "[3] Check inventory";
  1458.     cout << endl;
  1459.     cout << "[4] Check notes";
  1460.     cout << endl;
  1461.     cout << "[5] Return";
  1462.     cout << endl;
  1463.     string input;
  1464.     do {
  1465.     cout << "Enter Input: ";
  1466.     cin >> input;
  1467.     stringstream(input) >> x;
  1468.     switch (x){
  1469.         case 1:
  1470.             buy();
  1471.             break;
  1472.         case 2:
  1473.             sell();
  1474.             break;
  1475.         case 3:
  1476.             check();
  1477.             break;
  1478.         case 4:
  1479.             notes();
  1480.             break;
  1481.         case 5:
  1482.             trade();
  1483.             break;
  1484.         default:
  1485.             cout << "That's an invalid option. Please try again.";
  1486.             cout << endl;
  1487.     }
  1488.     } while (input != "1" || input != "2"|| input != "3"|| input != "4"|| input != "5"|| input != "6"|| input != "7"|| input != "8"|| input != "9"|| input != "10"|| input != "11"|| input != "12"|| input != "13"|| input != "14"|| input != "15"|| input != "16"|| input != "17"|| input != "18"|| input != "19");
  1489.  
  1490.  
  1491. }
  1492. //country inventory
  1493. void countryInv(void){
  1494.     if (land==0){
  1495.         //Buy
  1496.         //Buying pot
  1497.         if (goodType==0 && mem3==0){
  1498.             if (qty>potInvSwede){
  1499.                 cout << "Sweden does not have " << qty << " pottery.";
  1500.                 quantity();
  1501.             }
  1502.             else potInvSwede -= qty;
  1503.         }
  1504.         //Buying oil
  1505.         else if (goodType==1 && mem3==0){
  1506.             if (qty>oilInvSwede){
  1507.                 cout << "Sweden does not have " << qty << " oil.";
  1508.                 quantity();
  1509.             }
  1510.             else oilInvSwede -= qty;
  1511.         }
  1512.         else if (goodType==2 && mem3==0){
  1513.             if (qty>fishInvSwede){
  1514.                 cout << "Sweden does not have " << qty << " fish.";
  1515.                 quantity();
  1516.             }
  1517.             else fishInvSwede -= qty;
  1518.         }
  1519.         else if (goodType==3 && mem3==0){
  1520.             if (qty>woolInvSwede){
  1521.                 cout << "Sweden does not have " << qty << " wool cloth.";
  1522.                 quantity();
  1523.             }
  1524.             else woolInvSwede -= qty;
  1525.         }
  1526.         else if (goodType==4 && mem3==0){
  1527.             if (qty>velvetInvSwede){
  1528.                 cout << "Sweden does not have " << qty << " velvet.";
  1529.                 quantity();
  1530.             }
  1531.             else velvetInvSwede -= qty;
  1532.         }
  1533.         else if (goodType==5 && mem3==0){
  1534.             if (qty>toolsInvSwede){
  1535.                 cout << "Sweden does not have " << qty << " tools.";
  1536.                 quantity();
  1537.             }
  1538.             else toolsInvSwede -= qty;
  1539.         }
  1540.         else if (goodType==6 && mem3==0){
  1541.             if (qty>spiceInvSwede){
  1542.                 cout << "Sweden does not have " << qty << " spice.";
  1543.                 quantity();
  1544.             }
  1545.             else spiceInvSwede -= qty;
  1546.         }
  1547.         else if (goodType==7 && mem3==0){
  1548.             if (qty>ironInvSwede){
  1549.                 cout << "Sweden does not have " << qty << " iron.";
  1550.                 quantity();
  1551.             }
  1552.             else ironInvSwede -= qty;
  1553.         }
  1554.         else if (goodType==8 && mem3==0){
  1555.             if (qty>flourInvSwede){
  1556.                 cout << "Sweden does not have " << qty << " flour.";
  1557.                 quantity();
  1558.             }
  1559.             else flourInvSwede -= qty;
  1560.         }
  1561.         else if (goodType==9 && mem3==0){
  1562.             if (qty>dyeInvSwede){
  1563.                 cout << "Sweden does not have " << qty << " dyes.";
  1564.                 quantity();
  1565.             }
  1566.             else dyeInvSwede -= qty;
  1567.         }
  1568.         else if (goodType==10 && mem3==0){
  1569.             if (qty>leatherInvSwede){
  1570.                 cout << "Sweden does not have " << qty << " leatherworks.";
  1571.                 quantity();
  1572.             }
  1573.             else leatherInvSwede -= qty;
  1574.         }
  1575.         else if (goodType==11 && mem3==0){
  1576.             if (qty>furInvSwede){
  1577.                 cout << "Sweden does not have " << qty << " fur.";
  1578.                 quantity();
  1579.             }
  1580.             else furInvSwede -= qty;
  1581.         }
  1582.         else if (goodType==12 && mem3==0){
  1583.             if (qty>beerInvSwede){
  1584.                 cout << "Sweden does not have " << qty << " beer.";
  1585.                 quantity();
  1586.             }
  1587.             else beerInvSwede -= qty;
  1588.         }
  1589.         else if (goodType==13 && mem3==0){
  1590.             if (qty>saltInvSwede){
  1591.                 cout << "Sweden does not have " << qty << " salt.";
  1592.                 quantity();
  1593.             }
  1594.             else saltInvSwede -= qty;
  1595.         }
  1596.         else if (goodType==14 && mem3==0){
  1597.             if (qty>wineInvSwede){
  1598.                 cout << "Sweden does not have " << qty << " wine.";
  1599.                 quantity();
  1600.             }
  1601.             else wineInvSwede -= qty;
  1602.         }
  1603.        
  1604.         //Sell
  1605.         //Selling pot
  1606.         if (goodType==0 && mem3==1){
  1607.             potInvSwede += qty;
  1608.         }
  1609.         //Selling oil
  1610.         else if (goodType==1 && mem3==1){
  1611.             oilInvSwede += qty;
  1612.         }
  1613.         else if (goodType==2 && mem3==1){
  1614.             fishInvSwede += qty;
  1615.         }
  1616.         else if (goodType==3 && mem3==1){
  1617.             woolInvSwede += qty;
  1618.         }
  1619.         else if (goodType==4 && mem3==1){
  1620.             velvetInvSwede += qty;
  1621.         }
  1622.         else if (goodType==5 && mem3==1){
  1623.             toolsInvSwede += qty;
  1624.         }
  1625.         else if (goodType==6 && mem3==1){
  1626.             spiceInvSwede += qty;
  1627.         }
  1628.         else if (goodType==7 && mem3==1){
  1629.             ironInvSwede += qty;
  1630.         }
  1631.         else if (goodType==8 && mem3==1){
  1632.             flourInvSwede += qty;
  1633.         }
  1634.         else if (goodType==9 && mem3==1){
  1635.             dyeInvSwede += qty;
  1636.         }
  1637.         else if (goodType==10 && mem3==1){
  1638.             leatherInvSwede += qty;
  1639.         }
  1640.         else if (goodType==11 && mem3==1){
  1641.             furInvSwede += qty;
  1642.         }
  1643.         else if (goodType==12 && mem3==1){
  1644.             beerInvSwede += qty;
  1645.         }
  1646.         else if (goodType==13 && mem3==1){
  1647.             saltInvSwede += qty;
  1648.         }
  1649.         else if (goodType==14 && mem3==1){
  1650.             wineInvSwede += qty;
  1651.         }
  1652.     }
  1653.     else if (land==1){
  1654.         //Buy
  1655.         if (goodType==0 && mem3==0){
  1656.             if (qty>potInvPol){
  1657.                 cout << "Poland does not have " << qty << " pottery.";
  1658.                 quantity();
  1659.             }
  1660.             else potInvPol -= qty;
  1661.         }
  1662.         else if (goodType==1 && mem3==0){
  1663.             if (qty>oilInvPol){
  1664.                 cout << "Poland does not have " << qty << " oil.";
  1665.                 quantity();
  1666.             }
  1667.             else oilInvPol -= qty;
  1668.         }
  1669.         else if (goodType==2 && mem3==0){
  1670.             if (qty>fishInvPol){
  1671.                 cout << "Poland does not have " << qty << " fish.";
  1672.                 quantity();
  1673.             }
  1674.             else fishInvPol -= qty;
  1675.         }
  1676.         else if (goodType==3 && mem3==0){
  1677.             if (qty>woolInvPol){
  1678.                 cout << "Poland does not have " << qty << " wool cloth.";
  1679.                 quantity();
  1680.             }
  1681.             else woolInvPol -= qty;
  1682.         }
  1683.         else if (goodType==4 && mem3==0){
  1684.             if (qty>velvetInvPol){
  1685.                 cout << "Poland does not have " << qty << " velvet.";
  1686.                 quantity();
  1687.             }
  1688.             else oilInvPol -= qty;
  1689.         }
  1690.         else if (goodType==5 && mem3==0){
  1691.             if (qty>toolsInvPol){
  1692.                 cout << "Poland does not have " << qty << " tools.";
  1693.                 quantity();
  1694.             }
  1695.             else toolsInvPol -= qty;
  1696.         }
  1697.         else if (goodType==6 && mem3==0){
  1698.             if (qty>spiceInvPol){
  1699.                 cout << "Poland does not have " << qty << " spice.";
  1700.                 quantity();
  1701.             }
  1702.             else spiceInvPol -= qty;
  1703.         }
  1704.         else if (goodType==7 && mem3==0){
  1705.             if (qty>ironInvPol){
  1706.                 cout << "Poland does not have " << qty << " iron.";
  1707.                 quantity();
  1708.             }
  1709.             else ironInvPol -= qty;
  1710.         }
  1711.         else if (goodType==8 && mem3==0){
  1712.             if (qty>flourInvPol){
  1713.                 cout << "Poland does not have " << qty << " flour.";
  1714.                 quantity();
  1715.             }
  1716.             else flourInvPol -= qty;
  1717.         }
  1718.         else if (goodType==9 && mem3==0){
  1719.             if (qty>dyeInvPol){
  1720.                 cout << "Poland does not have " << qty << " dyes.";
  1721.                 quantity();
  1722.             }
  1723.             else dyeInvPol -= qty;
  1724.         }
  1725.         else if (goodType==10 && mem3==0){
  1726.             if (qty>leatherInvPol){
  1727.                 cout << "Poland does not have " << qty << " leatherworks.";
  1728.                 quantity();
  1729.             }
  1730.             else leatherInvPol -= qty;
  1731.         }
  1732.         else if (goodType==11 && mem3==0){
  1733.             if (qty>furInvPol){
  1734.                 cout << "Poland does not have " << qty << " fur.";
  1735.                 quantity();
  1736.             }
  1737.             else furInvPol -= qty;
  1738.         }
  1739.         else if (goodType==12 && mem3==0){
  1740.             if (qty>beerInvPol){
  1741.                 cout << "Poland does not have " << qty << " beer.";
  1742.                 quantity();
  1743.             }
  1744.             else beerInvPol -= qty;
  1745.         }
  1746.         else if (goodType==13 && mem3==0){
  1747.             if (qty>saltInvPol){
  1748.                 cout << "Poland does not have " << qty << " salt.";
  1749.                 quantity();
  1750.             }
  1751.             else saltInvPol -= qty;
  1752.         }
  1753.         else if (goodType==14 && mem3==0){
  1754.             if (qty>wineInvPol){
  1755.                 cout << "Poland does not have " << qty << " wine.";
  1756.                 quantity();
  1757.             }
  1758.             else wineInvPol -= qty;
  1759.         }
  1760.        
  1761.         //Sell
  1762.         else if (goodType==0 && mem3==1){
  1763.             potInvPol += qty;
  1764.         }
  1765.         else if (goodType== 1 && mem3==1){
  1766.             oilInvPol += qty;
  1767.         }
  1768.         else if (goodType== 2 && mem3==1){
  1769.             fishInvPol += qty;
  1770.         }
  1771.         else if (goodType== 3 && mem3==1){
  1772.             woolInvPol += qty;
  1773.         }
  1774.         else if (goodType== 4 && mem3==1){
  1775.             velvetInvPol += qty;
  1776.         }
  1777.         else if (goodType== 5 && mem3==1){
  1778.             toolsInvPol += qty;
  1779.         }
  1780.         else if (goodType== 6 && mem3==1){
  1781.             spiceInvPol += qty;
  1782.         }
  1783.         else if (goodType== 7 && mem3==1){
  1784.             ironInvPol += qty;
  1785.         }
  1786.         else if (goodType== 8 && mem3==1){
  1787.             flourInvPol += qty;
  1788.         }
  1789.         else if (goodType== 9 && mem3==1){
  1790.             dyeInvPol += qty;
  1791.         }
  1792.         else if (goodType== 10 && mem3==1){
  1793.             leatherInvPol += qty;
  1794.         }
  1795.         else if (goodType== 11 && mem3==1){
  1796.             furInvPol += qty;
  1797.         }
  1798.         else if (goodType== 12 && mem3==1){
  1799.             beerInvPol += qty;
  1800.         }
  1801.         else if (goodType== 13 && mem3==1){
  1802.             saltInvPol += qty;
  1803.         }
  1804.         else if (goodType== 14 && mem3==1){
  1805.             wineInvPol += qty;
  1806.         }
  1807.     }
  1808.     else if (land==2){
  1809.         //Buy
  1810.         if (goodType==0 && mem3==0){
  1811.             if (qty>potInvRus){
  1812.                 cout << "Russia does not have " << qty << " pottery.";
  1813.                 quantity();
  1814.             }
  1815.             else potInvRus -= qty;
  1816.         }
  1817.         else if (goodType==1 && mem3==0){
  1818.             if (qty>oilInvRus){
  1819.                 cout << "Russia does not have " << qty << " oil.";
  1820.                 quantity();
  1821.             }
  1822.             else oilInvRus -= qty;
  1823.         }
  1824.         else if (goodType==2 && mem3==0){
  1825.             if (qty>fishInvRus){
  1826.                 cout << "Russia does not have " << qty << " fish.";
  1827.                 quantity();
  1828.             }
  1829.             else fishInvRus -= qty;
  1830.         }
  1831.         else if (goodType==3 && mem3==0){
  1832.             if (qty>woolInvRus){
  1833.                 cout << "Russia does not have " << qty << " wool cloth.";
  1834.                 quantity();
  1835.             }
  1836.             else woolInvRus -= qty;
  1837.         }
  1838.         else if (goodType==4 && mem3==0){
  1839.             if (qty>velvetInvRus){
  1840.                 cout << "Russia does not have " << qty << " velvet.";
  1841.                 quantity();
  1842.             }
  1843.             else velvetInvRus -= qty;
  1844.         }
  1845.         else if (goodType==5 && mem3==0){
  1846.             if (qty>toolsInvRus){
  1847.                 cout << "Russia does not have " << qty << " tools.";
  1848.                 quantity();
  1849.             }
  1850.             else toolsInvRus -= qty;
  1851.         }
  1852.         else if (goodType==6 && mem3==0){
  1853.             if (qty>spiceInvRus){
  1854.                 cout << "Russia does not have " << qty << " spice.";
  1855.                 quantity();
  1856.             }
  1857.             else spiceInvRus -= qty;
  1858.         }
  1859.         else if (goodType==7 && mem3==0){
  1860.             if (qty>ironInvRus){
  1861.                 cout << "Russia does not have " << qty << " iron.";
  1862.                 quantity();
  1863.             }
  1864.             else ironInvRus -= qty;
  1865.         }
  1866.         else if (goodType==8 && mem3==0){
  1867.             if (qty>flourInvRus){
  1868.                 cout << "Russia does not have " << qty << " flour.";
  1869.                 quantity();
  1870.             }
  1871.             else flourInvRus -= qty;
  1872.         }
  1873.         else if (goodType==9 && mem3==0){
  1874.             if (qty>dyeInvRus){
  1875.                 cout << "Russia does not have " << qty << " dyes.";
  1876.                 quantity();
  1877.             }
  1878.             else dyeInvRus -= qty;
  1879.         }
  1880.         else if (goodType==10 && mem3==0){
  1881.             if (qty>leatherInvRus){
  1882.                 cout << "Russia does not have " << qty << " leatherworks.";
  1883.                 quantity();
  1884.             }
  1885.             else leatherInvRus -= qty;
  1886.         }
  1887.         else if (goodType==11 && mem3==0){
  1888.             if (qty>furInvRus){
  1889.                 cout << "Russia does not have " << qty << " fur.";
  1890.                 quantity();
  1891.             }
  1892.             else furInvRus -= qty;
  1893.         }
  1894.         else if (goodType==12 && mem3==0){
  1895.             if (qty>beerInvRus){
  1896.                 cout << "Russia does not have " << qty << " beer.";
  1897.                 quantity();
  1898.             }
  1899.             else beerInvRus -= qty;
  1900.         }
  1901.         else if (goodType==13 && mem3==0){
  1902.             if (qty>saltInvRus){
  1903.                 cout << "Russia does not have " << qty << "salt.";
  1904.                 quantity();
  1905.             }
  1906.             else saltInvRus -= qty;
  1907.         }
  1908.         else if (goodType==14 && mem3==0){
  1909.             if (qty>wineInvRus){
  1910.                 cout << "Russia does not have " << qty << " wine.";
  1911.                 quantity();
  1912.             }
  1913.             else wineInvRus -= qty;
  1914.         }
  1915.         //Sell
  1916.         else if (goodType==0 && mem3==1){
  1917.             potInvRus += qty;
  1918.         }
  1919.         else if (goodType==1 && mem3==1){
  1920.             oilInvRus += qty;
  1921.         }
  1922.         else if (goodType==2 && mem3==1){
  1923.             fishInvRus += qty;
  1924.         }
  1925.         else if (goodType==3 && mem3==1){
  1926.             woolInvRus += qty;
  1927.         }
  1928.         else if (goodType==4 && mem3==1){
  1929.             velvetInvRus += qty;
  1930.         }
  1931.         else if (goodType==5 && mem3==1){
  1932.             toolsInvRus += qty;
  1933.         }
  1934.         else if (goodType==6 && mem3==1){
  1935.             spiceInvRus += qty;
  1936.         }
  1937.         else if (goodType==7 && mem3==1){
  1938.             ironInvRus += qty;
  1939.         }
  1940.         else if (goodType==8 && mem3==1){
  1941.             flourInvRus += qty;
  1942.         }
  1943.         else if (goodType==9 && mem3==1){
  1944.             dyeInvRus += qty;
  1945.         }
  1946.         else if (goodType==10 && mem3==1){
  1947.             leatherInvRus += qty;
  1948.         }
  1949.         else if (goodType==11 && mem3==1){
  1950.             furInvRus += qty;
  1951.         }
  1952.         else if (goodType==12 && mem3==1){
  1953.             beerInvRus += qty;
  1954.         }
  1955.         else if (goodType==13 && mem3==1){
  1956.             saltInvRus += qty;
  1957.         }
  1958.         else if (goodType==14 && mem3==1){
  1959.             wineInvRus += qty;
  1960.         }
  1961.     }
  1962.    else if (land==3){
  1963.         //Buy
  1964.         if (goodType==0 && mem3==0){
  1965.             if (qty>potInvCri){
  1966.                 cout << "Crimea does not have " << qty << " pottery.";
  1967.                 quantity();
  1968.             }
  1969.             else potInvCri -= qty;
  1970.         }
  1971.         else if (goodType==1 && mem3==0){
  1972.             if (qty>oilInvCri){
  1973.                 cout << "Crimea does not have " << qty << " oil.";
  1974.                 quantity();
  1975.             }
  1976.             else oilInvCri -= qty;
  1977.         }
  1978.         else if (goodType==2 && mem3==0){
  1979.             if (qty>fishInvCri){
  1980.                 cout << "Crimea does not have " << qty << " fish.";
  1981.                 quantity();
  1982.             }
  1983.             else fishInvCri -= qty;
  1984.         }
  1985.         else if (goodType==3 && mem3==0){
  1986.             if (qty>woolInvCri){
  1987.                 cout << "Crimea does not have " << qty << " wool cloth.";
  1988.                 quantity();
  1989.             }
  1990.             else woolInvCri -= qty;
  1991.         }
  1992.         else if (goodType==4 && mem3==0){
  1993.             if (qty>velvetInvCri){
  1994.                 cout << "Crimea does not have " << qty << " velvet.";
  1995.                 quantity();
  1996.             }
  1997.             else velvetInvCri -= qty;
  1998.         }
  1999.         else if (goodType==5 && mem3==0){
  2000.             if (qty>toolsInvCri){
  2001.                 cout << "Crimea does not have " << qty << " tools.";
  2002.                 quantity();
  2003.             }
  2004.             else toolsInvCri -= qty;
  2005.         }
  2006.         else if (goodType==6 && mem3==0){
  2007.             if (qty>spiceInvCri){
  2008.                 cout << "Crimea does not have " << qty << " spice.";
  2009.                 quantity();
  2010.             }
  2011.             else spiceInvCri -= qty;
  2012.         }
  2013.         else if (goodType==7 && mem3==0){
  2014.             if (qty>ironInvCri){
  2015.                 cout << "Crimea does not have " << qty << " iron.";
  2016.                 quantity();
  2017.             }
  2018.             else ironInvCri -= qty;
  2019.         }
  2020.         else if (goodType==8 && mem3==0){
  2021.             if (qty>flourInvCri){
  2022.                 cout << "Crimea does not have " << qty << " flour.";
  2023.                 quantity();
  2024.             }
  2025.             else flourInvCri -= qty;
  2026.         }
  2027.         else if (goodType==9 && mem3==0){
  2028.             if (qty>dyeInvCri){
  2029.                 cout << "Crimea does not have " << qty << " dyes.";
  2030.                 quantity();
  2031.             }
  2032.             else dyeInvCri -= qty;
  2033.         }
  2034.         else if (goodType==10 && mem3==0){
  2035.             if (qty>leatherInvCri){
  2036.                 cout << "Crimea does not have " << qty << " leatherworks.";
  2037.                 quantity();
  2038.             }
  2039.             else leatherInvCri -= qty;
  2040.         }
  2041.         else if (goodType==11 && mem3==0){
  2042.             if (qty>furInvCri){
  2043.                 cout << "Crimea does not have " << qty << " fur.";
  2044.                 quantity();
  2045.             }
  2046.             else furInvCri -= qty;
  2047.         }
  2048.         else if (goodType==12 && mem3==0){
  2049.             if (qty>beerInvCri){
  2050.                 cout << "Crimea does not have " << qty << " beer.";
  2051.                 quantity();
  2052.             }
  2053.             else beerInvCri -= qty;
  2054.         }
  2055.         else if (goodType==13 && mem3==0){
  2056.             if (qty>saltInvCri){
  2057.                 cout << "Crimea does not have " << qty << "salt.";
  2058.                 quantity();
  2059.             }
  2060.             else saltInvCri -= qty;
  2061.         }
  2062.         else if (goodType==14 && mem3==0){
  2063.             if (qty>wineInvCri){
  2064.                 cout << "Crimea does not have " << qty << " wine.";
  2065.                 quantity();
  2066.             }
  2067.             else wineInvCri -= qty;
  2068.         }
  2069.         //Sell
  2070.         else if (goodType==0 && mem3==1){
  2071.             potInvCri += qty;
  2072.         }
  2073.         else if (goodType==1 && mem3==1){
  2074.             oilInvCri += qty;
  2075.         }
  2076.         else if (goodType==2 && mem3==1){
  2077.             fishInvCri += qty;
  2078.         }
  2079.         else if (goodType==3 && mem3==1){
  2080.             woolInvCri += qty;
  2081.         }
  2082.         else if (goodType==4 && mem3==1){
  2083.             velvetInvCri += qty;
  2084.         }
  2085.         else if (goodType==5 && mem3==1){
  2086.             toolsInvCri += qty;
  2087.         }
  2088.         else if (goodType==6 && mem3==1){
  2089.             spiceInvCri += qty;
  2090.         }
  2091.         else if (goodType==7 && mem3==1){
  2092.             ironInvCri += qty;
  2093.         }
  2094.         else if (goodType==8 && mem3==1){
  2095.             flourInvCri += qty;
  2096.         }
  2097.         else if (goodType==9 && mem3==1){
  2098.             dyeInvCri += qty;
  2099.         }
  2100.         else if (goodType==10 && mem3==1){
  2101.             leatherInvCri += qty;
  2102.         }
  2103.         else if (goodType==11 && mem3==1){
  2104.             furInvCri += qty;
  2105.         }
  2106.         else if (goodType==12 && mem3==1){
  2107.             beerInvCri += qty;
  2108.         }
  2109.         else if (goodType==13 && mem3==1){
  2110.             saltInvCri += qty;
  2111.         }
  2112.         else if (goodType==14 && mem3==1){
  2113.             wineInvCri += qty;
  2114.         }
  2115.     }
  2116.     else if (land==4){
  2117.         //Buy
  2118.         if (goodType==0 && mem3==0){
  2119.             if (qty>potInvSau){
  2120.                 cout << "Saudi Arabia does not have " << qty << " pottery.";
  2121.                 quantity();
  2122.             }
  2123.             else potInvSau -= qty;
  2124.         }
  2125.         else if (goodType==1 && mem3==0){
  2126.             if (qty>oilInvSau){
  2127.                 cout << "Saudi Arabia does not have " << qty << " oil.";
  2128.                 quantity();
  2129.             }
  2130.             else oilInvSau -= qty;
  2131.         }
  2132.         else if (goodType==2 && mem3==0){
  2133.             if (qty>fishInvSau){
  2134.                 cout << "Saudi Arabia does not have " << qty << " fish.";
  2135.                 quantity();
  2136.             }
  2137.             else fishInvSau -= qty;
  2138.         }
  2139.         else if (goodType==3 && mem3==0){
  2140.             if (qty>woolInvSau){
  2141.                 cout << "Saudi Arabia does not have " << qty << " wool cloth.";
  2142.                 quantity();
  2143.             }
  2144.             else woolInvSau -= qty;
  2145.         }
  2146.         else if (goodType==4 && mem3==0){
  2147.             if (qty>velvetInvSau){
  2148.                 cout << "Saudi Arabia does not have " << qty << " velvet.";
  2149.                 quantity();
  2150.             }
  2151.             else velvetInvSau -= qty;
  2152.         }
  2153.         else if (goodType==5 && mem3==0){
  2154.             if (qty>toolsInvSau){
  2155.                 cout << "Saudi Arabia does not have " << qty << " tools.";
  2156.                 quantity();
  2157.             }
  2158.             else toolsInvSau -= qty;
  2159.         }
  2160.         else if (goodType==6 && mem3==0){
  2161.             if (qty>spiceInvSau){
  2162.                 cout << "Saudi Arabia does not have " << qty << " spice.";
  2163.                 quantity();
  2164.             }
  2165.             else spiceInvSau -= qty;
  2166.         }
  2167.         else if (goodType==7 && mem3==0){
  2168.             if (qty>ironInvSau){
  2169.                 cout << "Saudi Arabia does not have " << qty << " iron.";
  2170.                 quantity();
  2171.             }
  2172.             else ironInvSau -= qty;
  2173.         }
  2174.         else if (goodType==8 && mem3==0){
  2175.             if (qty>flourInvSau){
  2176.                 cout << "Saudi Arabia does not have " << qty << " flour.";
  2177.                 quantity();
  2178.             }
  2179.             else flourInvSau -= qty;
  2180.         }
  2181.         else if (goodType==9 && mem3==0){
  2182.             if (qty>dyeInvSau){
  2183.                 cout << "Saudi Arabia does not have " << qty << " dyes.";
  2184.                 quantity();
  2185.             }
  2186.             else dyeInvSau -= qty;
  2187.         }
  2188.         else if (goodType==10 && mem3==0){
  2189.             if (qty>leatherInvSau){
  2190.                 cout << "Saudi Arabia does not have " << qty << " leatherworks.";
  2191.                 quantity();
  2192.             }
  2193.             else leatherInvSau -= qty;
  2194.         }
  2195.         else if (goodType==11 && mem3==0){
  2196.             if (qty>furInvSau){
  2197.                 cout << "Saudi Arabia does not have " << qty << " fur.";
  2198.                 quantity();
  2199.             }
  2200.             else furInvSau -= qty;
  2201.         }
  2202.         else if (goodType==12 && mem3==0){
  2203.             if (qty>beerInvSau){
  2204.                 cout << "Saudi Arabia does not have " << qty << " beer.";
  2205.                 quantity();
  2206.             }
  2207.             else beerInvSau -= qty;
  2208.         }
  2209.         else if (goodType==13 && mem3==0){
  2210.             if (qty>saltInvSau){
  2211.                 cout << "Saudi Arabia does not have " << qty << " salt.";
  2212.                 quantity();
  2213.             }
  2214.             else saltInvSau -= qty;
  2215.         }
  2216.         else if (goodType==14 && mem3==0){
  2217.             if (qty>wineInvSau){
  2218.                 cout << "Saudi Arabia does not have " << qty << " wine.";
  2219.                 quantity();
  2220.             }
  2221.             else wineInvSau -= qty;
  2222.         }
  2223.         //Sell
  2224.         else if (goodType==0 && mem3==1){
  2225.             potInvSau += qty;
  2226.         }
  2227.         else if (goodType==1 && mem3==1){
  2228.             oilInvSau += qty;
  2229.         }
  2230.         else if (goodType==2 && mem3==1){
  2231.             fishInvSau += qty;
  2232.         }
  2233.         else if (goodType==3 && mem3==1){
  2234.             woolInvSau += qty;
  2235.         }
  2236.         else if (goodType==4 && mem3==1){
  2237.             velvetInvSau += qty;
  2238.         }
  2239.         else if (goodType==5 && mem3==1){
  2240.             toolsInvSau += qty;
  2241.         }
  2242.         else if (goodType==6 && mem3==1){
  2243.             spiceInvSau += qty;
  2244.         }
  2245.         else if (goodType==7 && mem3==1){
  2246.             ironInvSau += qty;
  2247.         }
  2248.         else if (goodType==8 && mem3==1){
  2249.             flourInvSau += qty;
  2250.         }
  2251.         else if (goodType==9 && mem3==1){
  2252.             dyeInvSau += qty;
  2253.         }
  2254.         else if (goodType==10 && mem3==1){
  2255.             leatherInvSau += qty;
  2256.         }
  2257.         else if (goodType==11 && mem3==1){
  2258.             furInvSau += qty;
  2259.         }
  2260.         else if (goodType==12 && mem3==1){
  2261.             beerInvSau += qty;
  2262.         }
  2263.         else if (goodType==13 && mem3==1){
  2264.             saltInvSau += qty;
  2265.         }
  2266.         else if (goodType==14 && mem3==1){
  2267.             wineInvSau += qty;
  2268.         }
  2269.     }
  2270.     else if (land==5){
  2271.         //Buy
  2272.         if (goodType==0 && mem3==0){
  2273.             if (qty>potInvUkr){
  2274.                 cout << "Ukraine does not have " << qty << " pottery.";
  2275.                 quantity();
  2276.             }
  2277.             else potInvUkr -= qty;
  2278.         }
  2279.         else if (goodType==1 && mem3==0){
  2280.             if (qty>oilInvUkr){
  2281.                 cout << "Ukraine does not have " << qty << " oil.";
  2282.                 quantity();
  2283.             }
  2284.             else oilInvUkr -= qty;
  2285.         }
  2286.         else if (goodType==2 && mem3==0){
  2287.             if (qty>fishInvUkr){
  2288.                 cout << "Ukraine does not have " << qty << " fish.";
  2289.                 quantity();
  2290.             }
  2291.             else fishInvUkr -= qty;
  2292.         }
  2293.         else if (goodType==3 && mem3==0){
  2294.             if (qty>woolInvUkr){
  2295.                 cout << "Ukraine does not have " << qty << " wool cloth.";
  2296.                 quantity();
  2297.             }
  2298.             else woolInvUkr -= qty;
  2299.         }
  2300.         else if (goodType==4 && mem3==0){
  2301.             if (qty>velvetInvUkr){
  2302.                 cout << "Ukraine does not have " << qty << " velvet.";
  2303.                 quantity();
  2304.             }
  2305.             else velvetInvUkr -= qty;
  2306.         }
  2307.         else if (goodType==5 && mem3==0){
  2308.             if (qty>toolsInvUkr){
  2309.                 cout << "Ukraine does not have " << qty << " tools.";
  2310.                 quantity();
  2311.             }
  2312.             else toolsInvUkr -= qty;
  2313.         }
  2314.         else if (goodType==6 && mem3==0){
  2315.             if (qty>spiceInvUkr){
  2316.                 cout << "Ukraine does not have " << qty << " spice.";
  2317.                 quantity();
  2318.             }
  2319.             else spiceInvUkr -= qty;
  2320.         }
  2321.         else if (goodType==7 && mem3==0){
  2322.             if (qty>ironInvUkr){
  2323.                 cout << "Ukraine does not have " << qty << " iron.";
  2324.                 quantity();
  2325.             }
  2326.             else ironInvUkr -= qty;
  2327.         }
  2328.         else if (goodType==8 && mem3==0){
  2329.             if (qty>flourInvUkr){
  2330.                 cout << "Ukraine does not have " << qty << " flour.";
  2331.                 quantity();
  2332.             }
  2333.             else flourInvUkr -= qty;
  2334.         }
  2335.         else if (goodType==9 && mem3==0){
  2336.             if (qty>dyeInvUkr){
  2337.                 cout << "Ukraine does not have " << qty << " dyes.";
  2338.                 quantity();
  2339.             }
  2340.             else dyeInvUkr -= qty;
  2341.         }
  2342.         else if (goodType==10 && mem3==0){
  2343.             if (qty>leatherInvUkr){
  2344.                 cout << "Ukraine does not have " << qty << " leatherworks.";
  2345.                 quantity();
  2346.             }
  2347.             else leatherInvUkr -= qty;
  2348.         }
  2349.         else if (goodType==11 && mem3==0){
  2350.             if (qty>furInvUkr){
  2351.                 cout << "Ukraine does not have " << qty << " fur.";
  2352.                 quantity();
  2353.             }
  2354.             else furInvUkr -= qty;
  2355.         }
  2356.         else if (goodType==12 && mem3==0){
  2357.             if (qty>beerInvUkr){
  2358.                 cout << "Ukraine does not have " << qty << " beer.";
  2359.                 quantity();
  2360.             }
  2361.             else beerInvUkr -= qty;
  2362.         }
  2363.         else if (goodType==13 && mem3==0){
  2364.             if (qty>saltInvUkr){
  2365.                 cout << "Ukraine does not have " << qty << " salt.";
  2366.                 quantity();
  2367.             }
  2368.             else saltInvUkr -= qty;
  2369.         }
  2370.         else if (goodType==14 && mem3==0){
  2371.             if (qty>wineInvUkr){
  2372.                 cout << "Ukraine does not have " << qty << " wine.";
  2373.                 quantity();
  2374.             }
  2375.             else wineInvUkr -= qty;
  2376.         }
  2377.         //Sell
  2378.         else if (goodType==0 && mem3==1){
  2379.             potInvUkr += qty;
  2380.         }
  2381.         else if (goodType==1 && mem3==1){
  2382.             oilInvUkr += qty;
  2383.         }
  2384.         else if (goodType==2 && mem3==1){
  2385.             fishInvUkr += qty;
  2386.         }
  2387.         else if (goodType==3 && mem3==1){
  2388.             woolInvUkr += qty;
  2389.         }
  2390.         else if (goodType==4 && mem3==1){
  2391.             velvetInvUkr += qty;
  2392.         }
  2393.         else if (goodType==5 && mem3==1){
  2394.             toolsInvUkr += qty;
  2395.         }
  2396.         else if (goodType==6 && mem3==1){
  2397.             spiceInvUkr += qty;
  2398.         }
  2399.         else if (goodType==7 && mem3==1){
  2400.             ironInvUkr += qty;
  2401.         }
  2402.         else if (goodType==8 && mem3==1){
  2403.             flourInvUkr += qty;
  2404.         }
  2405.         else if (goodType==9 && mem3==1){
  2406.             dyeInvUkr += qty;
  2407.         }
  2408.         else if (goodType==10 && mem3==1){
  2409.             leatherInvUkr += qty;
  2410.         }
  2411.         else if (goodType==11 && mem3==1){
  2412.             furInvUkr += qty;
  2413.         }
  2414.         else if (goodType==12 && mem3==1){
  2415.             beerInvUkr += qty;
  2416.         }
  2417.         else if (goodType==13 && mem3==1){
  2418.             saltInvUkr += qty;
  2419.         }
  2420.         else if (goodType==14 && mem3==1){
  2421.             wineInvUkr += qty;
  2422.         }
  2423.     }
  2424.     else if (land==6){
  2425.         //Buy
  2426.         if (goodType==0 && mem3==0){
  2427.             if (qty>potInvChi){
  2428.                 cout << "China does not have " << qty << " pottery.";
  2429.                 quantity();
  2430.             }
  2431.             else potInvChi -= qty;
  2432.         }
  2433.         else if (goodType==1 && mem3==0){
  2434.             if (qty>oilInvChi){
  2435.                 cout << "China does not have " << qty << " oil.";
  2436.                 quantity();
  2437.             }
  2438.             else oilInvChi -= qty;
  2439.         }
  2440.         else if (goodType==2 && mem3==0){
  2441.             if (qty>fishInvChi){
  2442.                 cout << "China does not have " << qty << " fish.";
  2443.                 quantity();
  2444.             }
  2445.             else fishInvChi -= qty;
  2446.         }
  2447.         else if (goodType==3 && mem3==0){
  2448.             if (qty>woolInvChi){
  2449.                 cout << "China does not have " << qty << " wool cloth.";
  2450.                 quantity();
  2451.             }
  2452.             else woolInvChi -= qty;
  2453.         }
  2454.         else if (goodType==4 && mem3==0){
  2455.             if (qty>velvetInvChi){
  2456.                 cout << "China does not have " << qty << " velvet.";
  2457.                 quantity();
  2458.             }
  2459.             else velvetInvChi -= qty;
  2460.         }
  2461.         else if (goodType==5 && mem3==0){
  2462.             if (qty>toolsInvChi){
  2463.                 cout << "China does not have " << qty << " tools.";
  2464.                 quantity();
  2465.             }
  2466.             else toolsInvChi -= qty;
  2467.         }
  2468.         else if (goodType==6 && mem3==0){
  2469.             if (qty>spiceInvChi){
  2470.                 cout << "China does not have " << qty << " spice.";
  2471.                 quantity();
  2472.             }
  2473.             else spiceInvChi -= qty;
  2474.         }
  2475.         else if (goodType==7 && mem3==0){
  2476.             if (qty>ironInvChi){
  2477.                 cout << "China does not have " << qty << " iron.";
  2478.                 quantity();
  2479.             }
  2480.             else ironInvChi -= qty;
  2481.         }
  2482.         else if (goodType==8 && mem3==0){
  2483.             if (qty>flourInvChi){
  2484.                 cout << "China does not have " << qty << " flour.";
  2485.                 quantity();
  2486.             }
  2487.             else flourInvChi -= qty;
  2488.         }
  2489.         else if (goodType==9 && mem3==0){
  2490.             if (qty>dyeInvChi){
  2491.                 cout << "China does not have " << qty << " dyes.";
  2492.                 quantity();
  2493.             }
  2494.             else dyeInvChi -= qty;
  2495.         }
  2496.         else if (goodType==10 && mem3==0){
  2497.             if (qty>leatherInvChi){
  2498.                 cout << "China does not have " << qty << " leatherworks.";
  2499.                 quantity();
  2500.             }
  2501.             else leatherInvChi -= qty;
  2502.         }
  2503.         else if (goodType==11 && mem3==0){
  2504.             if (qty>furInvChi){
  2505.                 cout << "China does not have " << qty << " fur.";
  2506.                 quantity();
  2507.             }
  2508.             else furInvChi -= qty;
  2509.         }
  2510.         else if (goodType==12 && mem3==0){
  2511.             if (qty>beerInvChi){
  2512.                 cout << "China does not have " << qty << " beer.";
  2513.                 quantity();
  2514.             }
  2515.             else beerInvChi -= qty;
  2516.         }
  2517.         else if (goodType==13 && mem3==0){
  2518.             if (qty>saltInvChi){
  2519.                 cout << "China does not have " << qty << " salt.";
  2520.                 quantity();
  2521.             }
  2522.             else saltInvChi -= qty;
  2523.         }
  2524.         else if (goodType==14 && mem3==0){
  2525.             if (qty>wineInvChi){
  2526.                 cout << "China does not have " << qty << " wine.";
  2527.                 quantity();
  2528.             }
  2529.             else wineInvChi -= qty;
  2530.         }
  2531.         //Sell
  2532.         else if (goodType==0 && mem3==1){
  2533.             potInvChi += qty;
  2534.         }
  2535.         else if (goodType==1 && mem3==1){
  2536.             oilInvChi += qty;
  2537.         }
  2538.         else if (goodType==2 && mem3==1){
  2539.             fishInvChi += qty;
  2540.         }
  2541.         else if (goodType==3 && mem3==1){
  2542.             woolInvChi += qty;
  2543.         }
  2544.         else if (goodType==4 && mem3==1){
  2545.             velvetInvChi += qty;
  2546.         }
  2547.         else if (goodType==5 && mem3==1){
  2548.             toolsInvChi += qty;
  2549.         }
  2550.         else if (goodType==6 && mem3==1){
  2551.             spiceInvChi += qty;
  2552.         }
  2553.         else if (goodType==7 && mem3==1){
  2554.             ironInvChi += qty;
  2555.         }
  2556.         else if (goodType==8 && mem3==1){
  2557.             flourInvChi += qty;
  2558.         }
  2559.         else if (goodType==9 && mem3==1){
  2560.             dyeInvChi += qty;
  2561.         }
  2562.         else if (goodType==10 && mem3==1){
  2563.             leatherInvChi += qty;
  2564.         }
  2565.         else if (goodType==11 && mem3==1){
  2566.             furInvChi += qty;
  2567.         }
  2568.         else if (goodType==12 && mem3==1){
  2569.             beerInvChi += qty;
  2570.         }
  2571.         else if (goodType==13 && mem3==1){
  2572.             saltInvChi += qty;
  2573.         }
  2574.         else if (goodType==14 && mem3==1){
  2575.             wineInvChi += qty;
  2576.         }
  2577.     }
  2578.  
  2579. }
  2580.  
  2581.  
  2582. //random function
  2583. void random(void){
  2584.     goodType = 0;
  2585.     for (int i = 1; i <= 15; i++){
  2586.         if (goodType == 0){
  2587.             if (land == 0){
  2588.                 inv_Country = potInvSwede;
  2589.             }
  2590.             else if (land == 1){
  2591.                 inv_Country = potInvPol;
  2592.             }
  2593.             else if (land == 2){
  2594.                 inv_Country = potInvRus;
  2595.             }
  2596.             else if (land == 3){
  2597.                 inv_Country = potInvCri;
  2598.             }
  2599.             else if (land == 4){
  2600.                 inv_Country = potInvSau;
  2601.             }
  2602.             else if (land == 5){
  2603.                 inv_Country = potInvUkr;
  2604.             }
  2605.             else if (land == 6){
  2606.                 inv_Country = potInvChi;
  2607.             }
  2608.            
  2609.             if (inv_Country >= 76 && inv_Country <= 100){
  2610.                 price = potPrice[land] + randomnum * 1;
  2611.             }
  2612.             else if (inv_Country >= 51 && inv_Country <= 75){
  2613.                 price = potPrice[land] * 1.25 + randomnum;
  2614.             }
  2615.             else if (inv_Country >= 26 && inv_Country <= 50){
  2616.                 price = potPrice[land] * 1.50 + randomnum;
  2617.             }
  2618.             else if (inv_Country <= 25){
  2619.                 price = potPrice[land] * 2 + randomnum;
  2620.             }
  2621.             else if (inv_Country > 100){
  2622.                 price = potPrice[land] * 0.5 + randomnum;
  2623.             }
  2624.             priceArrays[0] = price;
  2625.         }
  2626.         else if (goodType == 1){
  2627.             if (land == 0){
  2628.                 inv_Country = oilInvSwede;  
  2629.             }
  2630.             else if (land == 1){
  2631.                 inv_Country = oilInvPol;    
  2632.             }
  2633.             else if (land == 2){
  2634.                 inv_Country = oilInvRus;
  2635.             }
  2636.             //changes
  2637.             else if (land == 3){
  2638.                 inv_Country = oilInvCri;
  2639.             }
  2640.             else if (land == 4){
  2641.                 inv_Country = oilInvSau;
  2642.             }
  2643.             else if (land == 5){
  2644.                 inv_Country = oilInvUkr;
  2645.             }
  2646.             else if (land == 6){
  2647.                 inv_Country = oilInvChi;
  2648.             }
  2649.            
  2650.             if (inv_Country >= 38 && inv_Country <= 50){
  2651.                 price = oilPrice[land] + randomnum;
  2652.             }
  2653.             else if (inv_Country >= 26 && inv_Country <= 37){
  2654.                 price = oilPrice[land] * 1.25 + randomnum;
  2655.             }
  2656.             else if (inv_Country >= 13 && inv_Country <= 25){
  2657.                 price = oilPrice[land] * 1.50 + randomnum;
  2658.             }
  2659.             else if (inv_Country <= 12){
  2660.                 price = oilPrice[land] * 2 + randomnum;
  2661.             }
  2662.             else if (inv_Country > 50){
  2663.                 price = oilPrice[land] * 0.75 + randomnum;
  2664.             }
  2665.             priceArrays[1] = price;
  2666.         }
  2667.         else if (goodType == 2){
  2668.             if (land == 0){
  2669.                 inv_Country = fishInvSwede;  
  2670.             }
  2671.             else if (land == 1){
  2672.                 inv_Country = fishInvPol;    
  2673.             }
  2674.             else if (land == 2){
  2675.                 inv_Country = fishInvRus;
  2676.             }
  2677.             else if (land == 3){
  2678.                 inv_Country = fishInvCri;
  2679.             }
  2680.             else if (land == 4){
  2681.                 inv_Country = fishInvSau;
  2682.             }
  2683.             else if (land == 5){
  2684.                 inv_Country = fishInvUkr;
  2685.             }
  2686.             else if (land == 6){
  2687.                 inv_Country = fishInvChi;
  2688.             }
  2689.            
  2690.             if (inv_Country >= 114 && inv_Country <= 150){
  2691.                 price = fishPrice[land] + randomnum;
  2692.             }
  2693.             else if (inv_Country >= 76 && inv_Country <= 113){
  2694.                 price = fishPrice[land] * 1.25 + randomnum;
  2695.             }
  2696.             else if (inv_Country >= 39 && inv_Country <= 75){
  2697.                 price = fishPrice[land] * 1.50 + randomnum;
  2698.             }
  2699.             else if (inv_Country <= 38){
  2700.                 price = fishPrice[land] * 2 + randomnum;
  2701.             }
  2702.             else if (inv_Country > 150){
  2703.                 price = fishPrice[land] * 0.75 + randomnum;
  2704.             }
  2705.             priceArrays[2] = price;
  2706.         }
  2707.         else if (goodType == 3){
  2708.             if (land == 0){
  2709.                 inv_Country = woolInvSwede;  
  2710.             }
  2711.             else if (land == 1){
  2712.                 inv_Country = woolInvPol;    
  2713.             }
  2714.             else if (land == 2){
  2715.                 inv_Country = woolInvRus;
  2716.             }
  2717.             else if (land == 3){
  2718.                 inv_Country = woolInvCri;
  2719.             }
  2720.             else if (land == 4){
  2721.                 inv_Country = woolInvSau;
  2722.             }
  2723.             else if (land == 5){
  2724.                 inv_Country = woolInvUkr;
  2725.             }
  2726.             else if (land == 6){
  2727.                 inv_Country = woolInvChi;
  2728.             }
  2729.            
  2730.             if (inv_Country >= 38 && inv_Country <= 75){
  2731.                 price = woolPrice[land] + randomnum;
  2732.             }
  2733.             else if (inv_Country >= 26 && inv_Country <= 56){
  2734.                 price = woolPrice[land] * 1.25 + randomnum;
  2735.             }
  2736.             else if (inv_Country >= 13 && inv_Country <= 38){
  2737.                 price = woolPrice[land] * 1.50 + randomnum;
  2738.             }
  2739.             else if (inv_Country <= 12){
  2740.                 price = woolPrice[land] * 2 + randomnum;
  2741.             }
  2742.             else if (inv_Country < 75){
  2743.                 price = woolPrice[land] * 0.75 + randomnum;
  2744.             }
  2745.             priceArrays[3] = price;
  2746.         }
  2747.         else if (goodType == 4){
  2748.             if (land == 0){
  2749.                 inv_Country = velvetInvSwede;  
  2750.             }
  2751.             else if (land == 1){
  2752.                 inv_Country = velvetInvPol;    
  2753.             }
  2754.             else if (land == 2){
  2755.                 inv_Country = velvetInvRus;
  2756.             }
  2757.             else if (land == 3){
  2758.                 inv_Country = velvetInvCri;
  2759.             }
  2760.             else if (land == 4){
  2761.                 inv_Country = velvetInvSau;
  2762.             }
  2763.             else if (land == 5){
  2764.                 inv_Country = velvetInvUkr;
  2765.             }
  2766.             else if (land == 6){
  2767.                 inv_Country = velvetInvChi;
  2768.             }
  2769.            
  2770.             if (inv_Country >= 20 && inv_Country <= 25){
  2771.                 price = velvetPrice[land] + randomnum;
  2772.             }
  2773.             else if (inv_Country >= 14 && inv_Country <= 19){
  2774.                 price = velvetPrice[land] * 1.25 + randomnum;
  2775.             }
  2776.             else if (inv_Country >= 8 && inv_Country <= 13){
  2777.                 price = velvetPrice[land] * 1.50 + randomnum;
  2778.             }
  2779.             else if (inv_Country <= 7){
  2780.                 price = velvetPrice[land] * 2 + randomnum;
  2781.             }
  2782.             else if (inv_Country > 25){
  2783.                 price = velvetPrice[land] * 0.75 + randomnum;
  2784.             }
  2785.             priceArrays[4] = price;
  2786.         }
  2787.         else if (goodType == 5){
  2788.             if (land == 0){
  2789.                 inv_Country = toolsInvSwede;  
  2790.             }
  2791.             else if (land == 1){
  2792.                 inv_Country = toolsInvPol;    
  2793.             }
  2794.             else if (land == 2){
  2795.                 inv_Country = toolsInvRus;
  2796.             }
  2797.            
  2798.             else if (land == 3){
  2799.                 inv_Country = toolsInvCri;
  2800.             }
  2801.             else if (land == 4){
  2802.                 inv_Country = toolsInvSau;
  2803.             }
  2804.             else if (land == 5){
  2805.                 inv_Country = toolsInvUkr;
  2806.             }
  2807.             else if (land == 6){
  2808.                 inv_Country = toolsInvChi;
  2809.             }
  2810.            
  2811.             if (inv_Country >= 38 && inv_Country <= 50){
  2812.                 price = toolsPrice[land] + randomnum;
  2813.                 if (land == 6){
  2814.                     if (price < 0){
  2815.                         price *= -1;
  2816.                     }
  2817.                     price += 350;
  2818.                 }
  2819.             }
  2820.             else if (inv_Country >= 26 && inv_Country <= 37){
  2821.                 price = toolsPrice[land] * 1.25 + randomnum;
  2822.                 if (land == 6){
  2823.                     if (price < 0){
  2824.                         price *= -1;
  2825.                     }
  2826.                     price += 350;
  2827.                 }
  2828.             }
  2829.             else if (inv_Country >= 13 && inv_Country <= 25){
  2830.                 price = toolsPrice[land] * 1.50 + randomnum;
  2831.                  if (land == 6){
  2832.                     if (price < 0){
  2833.                         price *= -1;
  2834.                     }
  2835.                     price += 350;
  2836.                 }
  2837.             }
  2838.             else if (inv_Country <= 12){
  2839.                 price = toolsPrice[land] * 2 + randomnum;
  2840.                 if (land == 6){
  2841.                     if (price < 0){
  2842.                         price *= -1;
  2843.                     }
  2844.                     price += 350;
  2845.                 }
  2846.             }
  2847.             else if (inv_Country > 50){
  2848.                 price = toolsPrice[land] * 0.75 + randomnum;
  2849.                 if (land == 6){
  2850.                     if (price < 0){
  2851.                         price *= -1;
  2852.                     }
  2853.                     price += 350;
  2854.                 }
  2855.             }
  2856.             priceArrays[5] = price;
  2857.         }
  2858.         else if (goodType == 6){
  2859.             if (land == 0){
  2860.                 inv_Country = spiceInvSwede;  
  2861.             }
  2862.             else if (land == 1){
  2863.                 inv_Country = spiceInvPol;    
  2864.             }
  2865.             else if (land == 2){
  2866.                 inv_Country = spiceInvRus;
  2867.             }
  2868.             else if (land == 3){
  2869.                 inv_Country = spiceInvCri;
  2870.             }
  2871.             else if (land == 4){
  2872.                 inv_Country = spiceInvSau;
  2873.             }
  2874.             else if (land == 5){
  2875.                 inv_Country = spiceInvUkr;
  2876.             }
  2877.             else if (land == 6){
  2878.                 inv_Country = spiceInvChi;
  2879.             }
  2880.            
  2881.             if (inv_Country >= 24 && inv_Country <= 30){
  2882.                 price = spicePrice[land] + randomnum;
  2883.             }
  2884.             else if (inv_Country >= 16 && inv_Country <= 23){
  2885.                 price = spicePrice[land] * 1.25 + randomnum;
  2886.             }
  2887.             else if (inv_Country >= 9 && inv_Country <= 15){
  2888.                 price = spicePrice[land] * 1.50 + randomnum;
  2889.             }
  2890.             else if (inv_Country <= 8){
  2891.                 price = spicePrice[land] * 2 + randomnum;
  2892.             }
  2893.             else if (inv_Country > 30){
  2894.                 price = spicePrice[land] * 0.75 + randomnum;
  2895.             }
  2896.             priceArrays[6] = price;
  2897.         }
  2898.         else if (goodType == 7){
  2899.             if (land == 0){
  2900.                 inv_Country = ironInvSwede;  
  2901.             }
  2902.             else if (land == 1){
  2903.                 inv_Country = ironInvPol;    
  2904.             }
  2905.             else if (land == 2){
  2906.                 inv_Country = ironInvRus;
  2907.             }
  2908.             else if (land == 3){
  2909.                 inv_Country = ironInvCri;
  2910.             }
  2911.             else if (land == 4){
  2912.                 inv_Country = ironInvSau;
  2913.             }
  2914.             else if (land == 5){
  2915.                 inv_Country = ironInvUkr;
  2916.             }
  2917.             else if (land == 6){
  2918.                 inv_Country = ironInvChi;
  2919.             }
  2920.            
  2921.             if (inv_Country >= 76 && inv_Country <= 100){
  2922.                 price = ironPrice[land] + randomnum;
  2923.             }
  2924.             else if (inv_Country >= 51 && inv_Country <= 75){
  2925.                 price = ironPrice[land] * 1.25 + randomnum;
  2926.             }
  2927.             else if (inv_Country >= 26 && inv_Country <= 50){
  2928.                 price = ironPrice[land] * 1.50 + randomnum;
  2929.             }
  2930.             else if (inv_Country <= 25){
  2931.                 price = ironPrice[land] * 2 + randomnum;
  2932.             }
  2933.             else if (inv_Country > 100){
  2934.                 price = ironPrice[land] * 0.75 + randomnum;
  2935.             }
  2936.             priceArrays[7] = price;
  2937.         }
  2938.         else if (goodType == 8){
  2939.             if (land == 0){
  2940.                 inv_Country = flourInvSwede;  
  2941.             }
  2942.             else if (land == 1){
  2943.                 inv_Country = flourInvPol;    
  2944.             }
  2945.             else if (land == 2){
  2946.                 inv_Country = flourInvRus;
  2947.             }
  2948.             else if (land == 3){
  2949.                 inv_Country = flourInvCri;
  2950.             }
  2951.             else if (land == 4){
  2952.                 inv_Country = flourInvSau;
  2953.             }
  2954.             else if (land == 5){
  2955.                 inv_Country = flourInvUkr;
  2956.             }
  2957.             else if (land == 6){
  2958.                 inv_Country = flourInvChi;
  2959.             }
  2960.            
  2961.             if (inv_Country >= 114 && inv_Country <= 150){
  2962.                 price = flourPrice[land] + randomnum;
  2963.             }
  2964.             else if (inv_Country >= 76 && inv_Country <= 113){
  2965.                 price = flourPrice[land] * 1.25 + randomnum;
  2966.             }
  2967.             else if (inv_Country >= 39 && inv_Country <= 75){
  2968.                 price = flourPrice[land] * 1.50 + randomnum;
  2969.             }
  2970.             else if (inv_Country <= 38){
  2971.                 price = flourPrice[land] * 2 + randomnum;
  2972.             }
  2973.             else if (inv_Country > 150){
  2974.                 price = flourPrice[land] * 0.75 + randomnum;
  2975.             }
  2976.             priceArrays[8] = price;
  2977.         }
  2978.         else if (goodType == 9){
  2979.             if (land == 0){
  2980.                 inv_Country = dyeInvSwede;  
  2981.             }
  2982.             else if (land == 1){
  2983.                 inv_Country = dyeInvPol;    
  2984.             }
  2985.             else if (land == 2){
  2986.                 inv_Country = dyeInvRus;
  2987.             }
  2988.             else if (land == 3){
  2989.                 inv_Country = dyeInvCri;
  2990.             }
  2991.             else if (land == 4){
  2992.                 inv_Country = dyeInvSau;
  2993.             }
  2994.             else if (land == 5){
  2995.                 inv_Country = dyeInvUkr;
  2996.             }
  2997.             else if (land == 6){
  2998.                 inv_Country = dyeInvChi;
  2999.             }
  3000.            
  3001.             if (inv_Country >= 57 && inv_Country <= 75){
  3002.                 price = dyePrice[land] + randomnum;
  3003.             }
  3004.             else if (inv_Country >= 40 && inv_Country <= 56){
  3005.                 price = dyePrice[land] * 1.25 + randomnum;
  3006.             }
  3007.             else if (inv_Country >= 20 && inv_Country <= 39){
  3008.                 price = dyePrice[land] * 1.50 + randomnum;
  3009.             }
  3010.             else if (inv_Country <= 19){
  3011.                 price = dyePrice[land] * 2 + randomnum;
  3012.             }
  3013.             else if (inv_Country > 75){
  3014.                 price = dyePrice[land] * 0.75 + randomnum;
  3015.             }
  3016.             priceArrays[9] = price;
  3017.         }
  3018.         else if (goodType == 10){
  3019.             if (land == 0){
  3020.                 inv_Country = leatherInvSwede;  
  3021.             }
  3022.             else if (land == 1){
  3023.                 inv_Country = leatherInvPol;    
  3024.             }
  3025.             else if (land == 2){
  3026.                 inv_Country = leatherInvRus;
  3027.             }
  3028.             else if (land == 3){
  3029.                 inv_Country = leatherInvCri;
  3030.             }
  3031.             else if (land == 4){
  3032.                 inv_Country = leatherInvSau;
  3033.             }
  3034.             else if (land == 5){
  3035.                 inv_Country = leatherInvUkr;
  3036.             }
  3037.             else if (land == 6){
  3038.                 inv_Country = leatherInvChi;
  3039.             }
  3040.            
  3041.             if (inv_Country >= 57 && inv_Country <= 75){
  3042.                 price = leatherPrice[land] + randomnum;
  3043.             }
  3044.             else if (inv_Country >= 39 && inv_Country <= 56){
  3045.                 price = leatherPrice[land] * 1.25 + randomnum;
  3046.             }
  3047.             else if (inv_Country >= 20 && inv_Country <= 38){
  3048.                 price = leatherPrice[land] * 1.50 + randomnum;
  3049.             }
  3050.             else if (inv_Country <= 19){
  3051.                 price = leatherPrice[land] * 2 + randomnum;
  3052.             }
  3053.             else if (inv_Country > 75){
  3054.                 price = leatherPrice[land] * 0.75 + randomnum;
  3055.             }
  3056.             priceArrays[10] = price;
  3057.         }
  3058.         else if (goodType == 11){
  3059.             if (land == 0){
  3060.                 inv_Country = furInvSwede;  
  3061.             }
  3062.             else if (land == 1){
  3063.                 inv_Country = furInvPol;    
  3064.             }
  3065.             else if (land == 2){
  3066.                 inv_Country = furInvRus;
  3067.             }
  3068.             else if (land == 3){
  3069.                 inv_Country = furInvCri;
  3070.             }
  3071.             else if (land == 4){
  3072.                 inv_Country = furInvSau;
  3073.             }
  3074.             else if (land == 5){
  3075.                 inv_Country = furInvUkr;
  3076.             }
  3077.             else if (land == 6){
  3078.                 inv_Country = furInvChi;
  3079.             }
  3080.            
  3081.             if (inv_Country >= 57 && inv_Country <= 75){
  3082.                 price = furPrice[land] + randomnum;
  3083.             }
  3084.             else if (inv_Country >= 40 && inv_Country <= 56){
  3085.                 price = furPrice[land] * 1.25 + randomnum;
  3086.             }
  3087.             else if (inv_Country >= 20 && inv_Country <= 39){
  3088.                 price = furPrice[land] * 1.50 + randomnum;
  3089.             }
  3090.             else if (inv_Country <= 19){
  3091.                 price = furPrice[land] * 2 + randomnum;
  3092.             }
  3093.             else if (inv_Country > 75){
  3094.                 price = furPrice[land] * 0.75 + randomnum;
  3095.             }
  3096.             priceArrays[11] = price;
  3097.         }
  3098.         else if (goodType == 12){
  3099.             if (land == 0){
  3100.                 inv_Country = beerInvSwede;  
  3101.             }
  3102.             else if (land == 1){
  3103.                 inv_Country = beerInvPol;    
  3104.             }
  3105.             else if (land == 2){
  3106.                 inv_Country = beerInvRus;
  3107.             }
  3108.             else if (land == 3){
  3109.                 inv_Country = beerInvCri;
  3110.             }
  3111.             else if (land == 4){
  3112.                 inv_Country = beerInvSau;
  3113.             }
  3114.             else if (land == 5){
  3115.                 inv_Country = beerInvUkr;
  3116.             }
  3117.             else if (land == 6){
  3118.                 inv_Country = beerInvChi;
  3119.             }
  3120.            
  3121.             if (inv_Country >= 57 && inv_Country <= 75){
  3122.                 price = beerPrice[land] + randomnum;
  3123.             }
  3124.             else if (inv_Country >= 40 && inv_Country <= 56){
  3125.                 price = beerPrice[land] * 1.25 + randomnum;
  3126.             }
  3127.             else if (inv_Country >= 20 && inv_Country <= 39){
  3128.                 price = beerPrice[land] * 1.50 + randomnum;
  3129.             }
  3130.             else if (inv_Country <= 19){
  3131.                 price = beerPrice[land] * 2 + randomnum;
  3132.             }
  3133.             else if (inv_Country > 75){
  3134.                 price = beerPrice[land] * 0.75 + randomnum;
  3135.             }
  3136.             priceArrays[12] = price;
  3137.         }else if (goodType == 13){
  3138.             if (land == 0){
  3139.                 inv_Country = saltInvSwede;  
  3140.             }
  3141.             else if (land == 1){
  3142.                 inv_Country = saltInvPol;    
  3143.             }
  3144.             else if (land == 2){
  3145.                 inv_Country = saltInvRus;
  3146.             }
  3147.             else if (land == 3){
  3148.                 inv_Country = saltInvCri;
  3149.             }
  3150.             else if (land == 4){
  3151.                 inv_Country = saltInvSau;
  3152.             }
  3153.             else if (land == 5){
  3154.                 inv_Country = saltInvUkr;
  3155.             }
  3156.             else if (land == 6){
  3157.                 inv_Country = saltInvChi;
  3158.             }
  3159.            
  3160.             if (inv_Country >= 57 && inv_Country <= 75){
  3161.                 price = saltPrice[land] + randomnum;
  3162.             }
  3163.             else if (inv_Country >= 40 && inv_Country <= 56){
  3164.                 price = saltPrice[land] * 1.25 + randomnum;
  3165.             }
  3166.             else if (inv_Country >= 20 && inv_Country <= 39){
  3167.                 price = saltPrice[land] * 1.50 + randomnum;
  3168.             }
  3169.             else if (inv_Country <= 19){
  3170.                 price = saltPrice[land] * 2 + randomnum;
  3171.             }
  3172.             else if (inv_Country > 50){
  3173.                 price = saltPrice[land] * 0.75 + randomnum;
  3174.             }
  3175.             priceArrays[13] = price;
  3176.         }
  3177.         else if (goodType == 14){
  3178.             if (land == 0){
  3179.                 inv_Country = wineInvSwede;  
  3180.             }
  3181.             else if (land == 1){
  3182.                 inv_Country = wineInvPol;    
  3183.             }
  3184.             else if (land == 2){
  3185.                 inv_Country = wineInvRus;
  3186.             }
  3187.             else if (land == 3){
  3188.                 inv_Country = wineInvCri;
  3189.             }
  3190.             else if (land == 4){
  3191.                 inv_Country = wineInvSau;
  3192.             }
  3193.             else if (land == 5){
  3194.                 inv_Country = wineInvUkr;
  3195.             }
  3196.             else if (land == 6){
  3197.                 inv_Country = wineInvChi;
  3198.             }
  3199.            
  3200.             if (inv_Country >= 57 && inv_Country <= 75){
  3201.                 price = winePrice[land] + randomnum;
  3202.             }
  3203.             else if (inv_Country >= 40 && inv_Country <= 56){
  3204.                 price = winePrice[land] * 1.25 + randomnum;
  3205.             }
  3206.             else if (inv_Country >= 20 && inv_Country <= 39){
  3207.                 price = winePrice[land] * 1.50 + randomnum;
  3208.             }
  3209.             else if (inv_Country <= 19){
  3210.                 price = winePrice[land] * 2 + randomnum;
  3211.             }
  3212.             else if (inv_Country > 75){
  3213.                 price = winePrice[land] * 0.75 + randomnum;
  3214.             }
  3215.             priceArrays[14] = price;
  3216.         }
  3217.        
  3218.         cout << "[" << i << "] " << tradeGoods[goodType] << " - Eur " << price;
  3219.         cout << endl;
  3220.         goodType++;
  3221.     }
  3222.  
  3223.     }
  3224.  
  3225. float random(float x){
  3226.     srand(time(0));
  3227.     x = rand() % 20 + (-20);
  3228.     return x;
  3229. }
  3230.  
  3231. //inv country function
  3232. void determineCountry(void){
  3233.     if (land == 0){
  3234.         if (goodType == 0) inv_Country = potInvSwede;
  3235. //      //potInv = 0, oilInv = 0; fishInv = 0; woolInv=0; velvetInv=0; toolsInv=0; spiceInv=0; ironInv=0; flourInv=0; dyeInv=0; leatherInv=0; furInv=0; beerInv=0, saltInv=0; wineInv=0;
  3236.         else if (goodType == 1) inv_Country = oilInvSwede;
  3237.         //addition
  3238.         else if (goodType == 2) inv_Country = fishInvSwede;
  3239.         else if (goodType == 3) inv_Country = woolInvSwede;
  3240.         else if (goodType == 4) inv_Country = velvetInvSwede;
  3241.         else if (goodType == 5) inv_Country = toolsInvSwede;
  3242.         else if (goodType == 6) inv_Country = spiceInvSwede;
  3243.         else if (goodType == 7) inv_Country = ironInvSwede;
  3244.         else if (goodType == 8) inv_Country = flourInvSwede;
  3245.         else if (goodType == 9) inv_Country = dyeInvSwede;
  3246.         else if (goodType == 10) inv_Country = leatherInvSwede;
  3247.         else if (goodType == 11) inv_Country = furInvSwede;
  3248.         else if (goodType == 12) inv_Country = beerInvSwede;
  3249.         else if (goodType == 13) inv_Country = saltInvSwede;
  3250.         else if (goodType == 14) inv_Country = wineInvSwede;
  3251.        
  3252.     }
  3253.     else if (land == 1){
  3254.         if (goodType == 0) inv_Country = potInvPol;
  3255.         else if (goodType == 1) inv_Country = oilInvPol;
  3256.         else if (goodType == 2) inv_Country = fishInv;
  3257.         else if (goodType == 3) inv_Country = woolInvPol;
  3258.         else if (goodType == 4) inv_Country = velvetInvPol;
  3259.         else if (goodType == 5) inv_Country = toolsInvPol;
  3260.         else if (goodType == 6) inv_Country = spiceInvPol;
  3261.         else if (goodType == 7) inv_Country = ironInvPol;
  3262.         else if (goodType == 8) inv_Country = flourInvPol;
  3263.         else if (goodType == 9) inv_Country = dyeInvPol;
  3264.         else if (goodType == 10) inv_Country = leatherInvPol;
  3265.         else if (goodType == 11) inv_Country = furInvPol;
  3266.         else if (goodType == 12) inv_Country = beerInvPol;
  3267.         else if (goodType == 13) inv_Country = saltInvPol;
  3268.         else if (goodType == 14) inv_Country = wineInvPol;
  3269.     }
  3270.     else if (land == 2){
  3271.         if (goodType == 0) inv_Country = potInvRus;
  3272.         else if (goodType == 1) inv_Country = oilInvRus;
  3273.         else if (goodType == 2) inv_Country = fishInvRus;
  3274.         else if (goodType == 3) inv_Country = woolInvRus;
  3275.         else if (goodType == 4) inv_Country = velvetInvRus;
  3276.         else if (goodType == 5) inv_Country = toolsInvRus;
  3277.         else if (goodType == 6) inv_Country = spiceInvRus;
  3278.         else if (goodType == 7) inv_Country = ironInvRus;
  3279.         else if (goodType == 8) inv_Country = flourInvRus;
  3280.         else if (goodType == 9) inv_Country = dyeInvRus;
  3281.         else if (goodType == 10) inv_Country = leatherInvRus;
  3282.         else if (goodType == 11) inv_Country = furInvRus;
  3283.         else if (goodType == 12) inv_Country = beerInvRus;
  3284.         else if (goodType == 13) inv_Country = saltInvRus;
  3285.         else if (goodType == 14) inv_Country = wineInvRus;
  3286.     }
  3287.     //changes
  3288.     else if (land == 3){
  3289.         if (goodType == 0) inv_Country = potInvCri;
  3290.         else if (goodType == 1) inv_Country = oilInvCri;
  3291.         else if (goodType == 2) inv_Country = fishInvCri;
  3292.         else if (goodType == 3) inv_Country = woolInvCri;
  3293.         else if (goodType == 4) inv_Country = velvetInvCri;
  3294.         else if (goodType == 5) inv_Country = toolsInvCri;
  3295.         else if (goodType == 6) inv_Country = spiceInvCri;
  3296.         else if (goodType == 7) inv_Country = ironInvCri;
  3297.         else if (goodType == 8) inv_Country = flourInvCri;
  3298.         else if (goodType == 9) inv_Country = dyeInvCri;
  3299.         else if (goodType == 10) inv_Country = leatherInvCri;
  3300.         else if (goodType == 11) inv_Country = furInvCri;
  3301.         else if (goodType == 12) inv_Country = beerInvCri;
  3302.         else if (goodType == 13) inv_Country = saltInvCri;
  3303.         else if (goodType == 14) inv_Country = wineInvCri;
  3304.     }
  3305.     else if (land == 4){
  3306.         if (goodType == 0) inv_Country = potInvSau;
  3307.         else if (goodType == 1) inv_Country = oilInvSau;
  3308.         else if (goodType == 2) inv_Country = fishInvSau;
  3309.         else if (goodType == 3) inv_Country = woolInvSau;
  3310.         else if (goodType == 4) inv_Country = velvetInvSau;
  3311.         else if (goodType == 5) inv_Country = toolsInvSau;
  3312.         else if (goodType == 6) inv_Country = spiceInvSau;
  3313.         else if (goodType == 7) inv_Country = ironInvSau;
  3314.         else if (goodType == 8) inv_Country = flourInvSau;
  3315.         else if (goodType == 9) inv_Country = dyeInvSau;
  3316.         else if (goodType == 10) inv_Country = leatherInvSau;
  3317.         else if (goodType == 11) inv_Country = furInvSau;
  3318.         else if (goodType == 12) inv_Country = beerInvSau;
  3319.         else if (goodType == 13) inv_Country = saltInvSau;
  3320.         else if (goodType == 14) inv_Country = wineInvSau;
  3321.     }
  3322.     else if (land == 5){
  3323.         if (goodType == 0) inv_Country = potInvUkr;
  3324.         else if (goodType == 1) inv_Country = oilInvUkr;
  3325.         else if (goodType == 2) inv_Country = fishInvUkr;
  3326.         else if (goodType == 3) inv_Country = woolInvUkr;
  3327.         else if (goodType == 4) inv_Country = velvetInvUkr;
  3328.         else if (goodType == 5) inv_Country = toolsInvUkr;
  3329.         else if (goodType == 6) inv_Country = spiceInvUkr;
  3330.         else if (goodType == 7) inv_Country = ironInvUkr;
  3331.         else if (goodType == 8) inv_Country = flourInvUkr;
  3332.         else if (goodType == 9) inv_Country = dyeInvUkr;
  3333.         else if (goodType == 10) inv_Country = leatherInvUkr;
  3334.         else if (goodType == 11) inv_Country = furInvUkr;
  3335.         else if (goodType == 12) inv_Country = beerInvUkr;
  3336.         else if (goodType == 13) inv_Country = saltInvUkr;
  3337.         else if (goodType == 14) inv_Country = wineInvUkr;
  3338.     }
  3339.     else if (land == 6){
  3340.         if (goodType == 0) inv_Country = potInvChi;
  3341.         else if (goodType == 1) inv_Country = oilInvChi;
  3342.         else if (goodType == 2) inv_Country = fishInvChi;
  3343.         else if (goodType == 3) inv_Country = woolInvChi;
  3344.         else if (goodType == 4) inv_Country = velvetInvChi;
  3345.         else if (goodType == 5) inv_Country = toolsInvChi;
  3346.         else if (goodType == 6) inv_Country = spiceInvChi;
  3347.         else if (goodType == 7) inv_Country = ironInvChi;
  3348.         else if (goodType == 8) inv_Country = flourInvChi;
  3349.         else if (goodType == 9) inv_Country = dyeInvChi;
  3350.         else if (goodType == 10) inv_Country = leatherInvChi;
  3351.         else if (goodType == 11) inv_Country = furInvChi;
  3352.         else if (goodType == 12) inv_Country = beerInvChi;
  3353.         else if (goodType == 13) inv_Country = saltInvChi;
  3354.         else if (goodType == 14) inv_Country = wineInvChi;
  3355.     }
  3356.  
  3357.     }
  3358.  
  3359. void eventsNumbers(void)
  3360. {
  3361.     srand(time(0));
  3362.     int randomEvent;
  3363.     if (turn<=10)
  3364.     {randomEvent=rand()%10+1;
  3365.     events(randomEvent);}
  3366.     else if (turn>=11&&turn<=20)
  3367.     {randomEvent=rand()%20+1;
  3368.     events(randomEvent);}
  3369.     else if (turn>=21&&turn<=30)
  3370.     {randomEvent=rand()%30+1;
  3371.     events(randomEvent);}
  3372.     else if (turn>=31&&turn<=40)
  3373.     {randomEvent=rand()%40+1;
  3374.     events(randomEvent);}
  3375.     else if (turn>=41&&turn<=50)
  3376.     {randomEvent=rand()%50+1;
  3377.     events(randomEvent);}
  3378. }
  3379.  
  3380. void events(int random)
  3381. {
  3382.     int x;
  3383.     switch (random){
  3384.         case 1:
  3385.             cout<<"The company thought that you were incompetent, so they see fit that you would lose Eur 2000! Skip a turn and lose Eur 2000."<<endl;
  3386.  
  3387.             if(GOOJcard>=1)
  3388.             {
  3389.                 cout << "Turns out you have that get out of jail card . . . ";
  3390. cout << endl << "You can only get so lucky." << endl;
  3391.                 GOOJcard--;
  3392.             }
  3393.             else
  3394.             {
  3395.             turn++;
  3396.             balance=balance-2000;
  3397.             }
  3398.             break;
  3399.         case 3:
  3400.             cout<<"Psst! Someone just handed you a lucky card!"<<endl;
  3401.             GOOJcard=1;
  3402.             break;
  3403.         case 5:
  3404.             cout<<"The company's stocks gambit paid off! Your company saw fit to give you extra money for trading goods. Receive Eur 1000."<<endl;
  3405.             balance=balance+1000;
  3406.             break;
  3407.         case 7:
  3408.             cout<<"The company thought that your performance was astounding. Receive Eur 500 for trading."<<endl;
  3409.             balance=balance+500;
  3410.             break;
  3411.         case 9:
  3412.             cout<<"Your company wants to use the money from trading for other assets. Lose Eur 1500."<<endl;
  3413.             balance=balance-1500;
  3414.             break;
  3415.         case 11:
  3416.             cout<<"It's tax season! Lose a percentage of your trading balance based on the number of goods in Inventory."<<endl;
  3417.             balance=balance-(potInv*160*0.075+oilInv*400*0.075);
  3418.             break;
  3419.         case 13:
  3420.             cout<<"You go to jail! Skip a turn and lose Eur 2000."<<endl;
  3421.             if(GOOJcard>=1)
  3422.             {
  3423.                 cout<<"Turns out you have that get out of jail card . . . .” << endl << “You can only get so lucky."<<endl;
  3424.                 GOOJcard--;
  3425.             }
  3426.             else
  3427.             {
  3428.             turn++;
  3429.             balance=balance-2000;
  3430.             }
  3431.             break;
  3432.         case 15:
  3433.             cout<<"The company uses your trading balance to pay its debt. Lose half of your trading balance."<<endl;
  3434.             balance=balance/2;
  3435.             break;
  3436.         case 17:
  3437.             cout<<"The company's data was attacked by encryption virus. You lose half of your trading money to pay for ransomware."<<endl;
  3438.             balance=balance/2;
  3439.             break;
  3440.         case 19:
  3441.             cout<<"The company invested in a certain stock. The company used your trading money . . . Lose Eur 1000."<<endl;
  3442.             balance=balance-1000;
  3443.             investment++;
  3444.             break;
  3445.         case 21:
  3446.             cout<<"One of the cargo ships got lost in the transit! Lose Eur 7000."<<endl;
  3447.             balance-=7000;
  3448.             break;
  3449.         case 23:
  3450.             cout<<"The company thought that you were incompetent, so they see fit that you would lose Eur 2000! Skip a turn and lose Eur 2000."<<endl;
  3451.             if(GOOJcard>=1)
  3452.             {
  3453.                 cout<<"Turns out you have that get out of jail card . . . .” << endl << “You can only get so lucky."<<endl;
  3454.                 GOOJcard--;
  3455.             }
  3456.             else
  3457.             {
  3458.             turn++;
  3459.             balance=balance-2000;
  3460.             }
  3461.             break;
  3462.  
  3463.         case 25:
  3464.             cout<<"The company invested in a certain stock. The company used your trading money . . . Lose Eur 1000."<<endl;
  3465.             balance=balance-1000;
  3466.             investment++;
  3467.             break;
  3468.         case 27:
  3469.             if(investment>=4)
  3470.             {
  3471.                 cout<<"The company's investment paid off! Receive Eur 10000."<<endl;
  3472.                 balance+=10000;
  3473.             }
  3474.             else
  3475.             {
  3476.                 cout<<"The company's investment failed. Along with the few assets you gave them! Lose Eur 2000."<<endl;
  3477.                 balance-=2000;
  3478.             }
  3479.             break;
  3480.         case 29:
  3481.             cout<<"A corporation tried a hostile takeover! You managed to drive them off, but at what cost? Lose Eur 5000."<<endl;
  3482.             balance-=5000;
  3483. break;
  3484.         case 31:
  3485.             cout<<"The stakes are getting higher, you need more money. Receive 50% added more trading money."<<endl;
  3486.             balance=balance*1.5;
  3487. break;
  3488.         case 33:
  3489.             cout<<"Enemy corporations manufactured scandals about your company. Fighting lawsuit after lawsuit is tiring, as well as expensive. Skip 2 turns and lose Eur 8000."<<endl;
  3490.             if(GOOJcard>=1)
  3491.             {
  3492.                 cout<<"Fortunately however, you have that mysterious lucky card that man gave you. It vanished, as well as somehow the problems that plagued you."<<endl;
  3493.                 GOOJcard--;
  3494.             }
  3495.             else
  3496.             {
  3497.             turn++;
  3498.             balance=balance-2000;
  3499.             }
  3500. break;
  3501.         case 35:
  3502.             if (event35==0)
  3503.             {
  3504.                 cout<<"A man approached you, and said, 'I am part of an organization named Cauldron. We would like your sponsorship in order to progress our plans with saving Mother Earth.' What do you do? (1 Yes/2 No)"<<endl;
  3505.                 do {
  3506.                     cout << "Enter Input: ";
  3507.                     cin >> input;
  3508.                     stringstream(input) >> x;
  3509.                     switch (x){
  3510.                         case 1:
  3511.                             cout<<"Thank you for your patronage. We will not forget this.";
  3512.                             Cauldron++;
  3513.                             break;
  3514.                         case 2:
  3515.                             cout<<"I see . . . I hope you don't regret your decision.";
  3516.                             break;
  3517.                         default:
  3518.                             cout<<"Invalid input. Please try again.";
  3519.                             break;
  3520.                             }
  3521.                     break;
  3522.                 } while (input != "1" || input != "2");
  3523.                 event35=1;
  3524.             }
  3525.             else
  3526.             {
  3527.                 cout<<"A strange wind flows today. Had something changed?";
  3528.                 break;
  3529.             }
  3530. break;
  3531.         case 37:
  3532.             cout<<"The company invested in a certain stock. The company used your trading money . . . Lose Eur 1000."<<endl;
  3533.             balance=balance-1000;
  3534.             investment++;
  3535.             break;
  3536.         case 39:
  3537.             cout<<"A corporation tried a hostile takeover! You managed to drive them off, but at what cost? Lose €5000."<<endl;
  3538.             balance-=5000;
  3539. break;
  3540.         case 41:
  3541.             cout<<"A corporation tried a hostile takeover! You managed to drive them off, but at what cost? Lose €5000."<<endl;
  3542.             balance-=5000;
  3543.         case 43:
  3544.             cout<<"You invested in a certain stock. Something may come out of this . . . Lose Eur 1000."<<endl;
  3545.             balance=balance-1000;
  3546.             investment++;
  3547.             break;
  3548.         case 45:
  3549.             cout<<"A corporation tried a hostile takeover! You managed to drive them off, but at what cost? Lose Eur 5000."<<endl;
  3550.             balance-=5000;
  3551.         case 47:
  3552.             cout<<"The company invested in a certain stock. The company used your trading money . . . Lose Eur 1000."<<endl;
  3553.             balance=balance-1000;
  3554.             investment++;
  3555.             break;
  3556.         case 49:
  3557.             if(Cauldron==1)
  3558.             {
  3559.                 cout<<"All of a sudden, the company’s profits soared! Your money is doubled.";
  3560.                 balance=balance*2;
  3561.             }
  3562.             else
  3563.             {
  3564.                 cout<<"All of a sudden, natural disasters began to strike at your holdings! Your money is quartered.";
  3565.                 balance=balance/4;
  3566.             }
  3567.             break;
  3568.         default:
  3569.             cout << "No significant events have occurred!"<<endl;
  3570.             break;
  3571.     }
  3572. }
  3573.  
  3574.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement