Advertisement
Cnvmendoza

Complete Trading

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