Advertisement
XOptimistixX

CryptoMiner Alpha 0.30

Jul 27th, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <stdbool.h>
  4.  
  5. int main()
  6. {
  7.     float version=0.30;
  8.  
  9.     int integratedGPUNumber=1, nvidiaGPUNumber=0, amdGPUNumber=0;
  10.     float btcBalance=0, btcInCurrentSession=0, btcPower=0.00000010, alternateBtcPower;
  11.     float ltcBalance=0, ltcInCurrentSession=0, ltcPower=0.00000010, alternateLtcPower;
  12.     float integratedGPUPrice, nvidiaGPUPrice, amdGPUPrice;
  13.  
  14.     int accessMenuNumber=0, accessMineNumber=1, accessShopNumber=2, accessBlackMarketNumber=3, accessCryptoMarketNumber=4, accessControlNumber=5, quitGameNumber=6;
  15.     int mineCryptoNumber=1, alternateMineCryptoNumber, showBalanceNumber=2, showItemsNumber=3;
  16.     int showControlsNumber=1, showSaveCodeNumber=2;
  17.  
  18.     int menuModeInput, miningModeInput=-1, miningModeChooseInput=-1, shopModeInput, controlModeInput=-1;
  19.     bool exitIntro=0, saveCode=0, inGame=1, choosingCurrency=0, alreadyInShop=0, shopEnteredBefore=0, firstTimeInMenu=1, notAvailableMessage=0;
  20.     bool menuMode=1, miningMode=0, btcMode=0, ltcMode=0, shopMode=0, controlMode=0;
  21.     bool generateSaveCodeBeforeExit=0, sureToQuit=0, quitLoop=1, endingPart=1;
  22.  
  23.     /*printf("CryptoMiner %.2f\n\n", version);
  24.     printf("Welcome to CryptoMiner!\n\nDo you have a save code?(1 for yes, 0 for no).\n");
  25.     scanf("%d", &saveCode);
  26.     if (saveCode==1)
  27.     {
  28.         printf("Load: ");
  29.         scanf("%d %d %d", &btcBalance*100000000, &nvidiaGPUNumber, &amdGPUNumber);
  30.         cookiePower+=nvidiaGPUNumber;
  31.         exitIntro=1;
  32.         printf("\nWelcome back to CryptoMiner!\n");
  33.     }
  34.     else if (saveCode!=0)
  35.         printf("Please try again!");*/
  36.     if (exitIntro==0)
  37.     {
  38.         printf("CryptoMiner %.2f\n\n", version);
  39.         printf("This game is about cryptocurrencies and mining them.\n\n");
  40.         printf("In this game, you are poor at the start and can buy GPUs for mining\n");
  41.         printf("but you require typing on the keyboard, which also is counted as mining\n");
  42.         printf("to power the GPUs with kinetic energy, 1 second per click.\n\n");
  43.         printf("You can buy more equipment to help you with getting more cryptocurrency.\n");
  44.         printf("To access the main menu, type in %d anywhere during the game.\n\n", accessMenuNumber);
  45.         printf("Press \"1\" to continue.\n");
  46.         scanf("%d", &exitIntro);
  47.         while (exitIntro!=1)
  48.         {
  49.             printf("Please try again.\n");
  50.             scanf("%d", &exitIntro);
  51.         }
  52.     }
  53.     while(inGame==1)
  54.     {
  55.         while (menuMode==1)
  56.         {
  57.             printf("CryptoMiner %.2f\n\n", version);
  58.             printf("Main Menu\n\n");
  59.             printf("<1> Mine\n");
  60.             printf("<2> Shop\n");
  61.             printf("<3> Black Market\n");
  62.             printf("<4> CryptoMarket\n");
  63.             printf("<5> Control Menu\n");
  64.             printf("<6> Exit Game\n");
  65.             if (firstTimeInMenu==1)
  66.             {
  67.                 printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  68.                 firstTimeInMenu=0;
  69.             }
  70.             else if (menuModeInput==accessBlackMarketNumber)
  71.             {
  72.                 printf("\n");
  73.                 printf("The Black Market is not available yet\n");
  74.                 notAvailableMessage=1;
  75.             }
  76.             else if (menuModeInput==accessCryptoMarketNumber)
  77.             {
  78.                 printf("\n");
  79.                 printf("The CryptoMarket is not available yet\n");
  80.                 notAvailableMessage=1;
  81.             }
  82.             else if (menuModeInput<0 || menuModeInput>6)
  83.             {
  84.                 printf("\n");
  85.                 printf("That is not a valid location\n");
  86.                 printf("\n\n\n\n\n\n\n\n\n\n\n\n");
  87.             }
  88.             if (notAvailableMessage==1)
  89.             {
  90.                 printf("\n\n\n\n\n\n\n\n\n\n\n\n");
  91.                 notAvailableMessage=0;
  92.             }
  93.             scanf("%d", &menuModeInput);
  94.             if (menuModeInput==accessMineNumber)
  95.             {
  96.                 menuMode=0;
  97.                 miningMode=1;
  98.                 firstTimeInMenu=1;
  99.             }
  100.             else if (menuModeInput==accessShopNumber)
  101.             {
  102.                 menuMode=0;
  103.                 shopMode=1;
  104.                 firstTimeInMenu=1;
  105.             }
  106.             else if (menuModeInput==accessControlNumber)
  107.             {
  108.                 menuMode=0;
  109.                 controlMode=1;
  110.                 firstTimeInMenu=1;
  111.             }
  112.             else if (menuModeInput==quitGameNumber)
  113.             {
  114.                 printf("Are you sure you want to quit the game? (1 for yes, 0 for no)\n");
  115.                 printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  116.                 scanf("%d", &sureToQuit);
  117.                 while (quitLoop==1)
  118.                 {
  119.                     if (sureToQuit==1)
  120.                     {
  121.                         quitLoop=0;
  122.                         menuMode=0;
  123.                         inGame=0;
  124.                     }
  125.                     else if (sureToQuit==0)
  126.                     {
  127.                         quitLoop=0;
  128.                     }
  129.                 }
  130.                 firstTimeInMenu=1;
  131.                 quitLoop=1;
  132.             }
  133.         }
  134.         while(miningMode==1)
  135.         {
  136.             choosingCurrency=1;
  137.             while (choosingCurrency==1)
  138.             {
  139.                 printf("Cryptocurrency Mines\n\n");
  140.                 printf("<1> BTC - SHA-256\n");
  141.                 printf("<2> LTC - Scrypt\n");
  142.                 printf("<0> Back\n");
  143.                 if (miningModeChooseInput==-1)
  144.                     printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  145.                 else if (miningModeChooseInput<0 || miningModeChooseInput>2)
  146.                 {
  147.                     printf("\n");
  148.                     printf("That is not a valid currency.\n");
  149.                     printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  150.                 }
  151.                 scanf("%d", &miningModeChooseInput);
  152.                 if (miningModeChooseInput==1)
  153.                 {
  154.                     choosingCurrency=0;
  155.                     miningModeChooseInput=-1;
  156.                     btcMode=1;
  157.                 }
  158.                 else if (miningModeChooseInput==2)
  159.                 {
  160.                     choosingCurrency=0;
  161.                     miningModeChooseInput=-1;
  162.                     ltcMode=1;
  163.                     printf("LTC Mine\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  164.                 }
  165.                 if (miningModeChooseInput==0)
  166.                 {
  167.                     choosingCurrency=0;
  168.                     miningModeChooseInput=-1;
  169.                     miningMode=0;
  170.                     menuMode=1;
  171.                 }
  172.             }
  173.             while(btcMode==1)
  174.             {
  175.                 printf("BTC Mine\n\n");
  176.                 printf("Mined %.8f BTC in this session\n", btcInCurrentSession);
  177.                 printf("Balance: %.8f BTC\n\n", btcBalance);
  178.                 alternateMineCryptoNumber=mineCryptoNumber*11;
  179.                 alternateBtcPower=btcPower*2;
  180.                 if (miningModeInput!=showBalanceNumber && miningModeInput!= showItemsNumber)
  181.                     printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  182.                 if (miningModeInput==showBalanceNumber)
  183.                 {
  184.                     printf("Other Balances\n");
  185.                     printf("%.8f LTC\n", ltcBalance);
  186.                     printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  187.                 }
  188.                 else if (miningModeInput==showItemsNumber)
  189.                 {
  190.                     printf("Integrated GPU: %d\n", integratedGPUNumber);
  191.                     printf("NVIDIA GPU: %d\n", nvidiaGPUNumber);
  192.                     printf("AMD GPU: %d\n", amdGPUNumber);
  193.                     printf("Total BTC Mining Power: %.8f BTC/s\n", btcPower);
  194.                     printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  195.                 }
  196.                 scanf("%d", &miningModeInput);
  197.                 if (miningModeInput==mineCryptoNumber)
  198.                 {
  199.                     btcBalance+=btcPower;
  200.                     btcInCurrentSession+=btcPower;
  201.                 }
  202.                 else if (miningModeInput==alternateMineCryptoNumber)
  203.                 {
  204.                     btcBalance+=alternateBtcPower;
  205.                     btcInCurrentSession+=alternateBtcPower;
  206.                 }
  207.                 else if (miningModeInput==accessMenuNumber)
  208.                 {
  209.                     btcMode=0;
  210.                     btcInCurrentSession=0;
  211.                     miningModeInput=-1;
  212.                 }
  213.             }
  214.             /*while(ltcMode==1)
  215.             {
  216.                 printf("LTC Mine\n\n");
  217.                 printf("Mined %.8f LTC in this session\n", ltcInCurrentSession);
  218.                 printf("Balance: %.8f LTC\n\n", ltcBalance);
  219.                 alternateMineCryptoNumber=mineCryptoNumber*11;
  220.                 alternateLtcPower=ltcPower*2;
  221.                 if (miningModeInput!=showBalanceNumber && miningModeInput!= showItemsNumber)
  222.                     printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  223.                 if (miningModeInput==showBalanceNumber)
  224.                 {
  225.                     printf("Other Balances\n");
  226.                     printf("%.8f LTC\n", ltcBalance);
  227.                     printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  228.                 }
  229.                 else if (miningModeInput==showItemsNumber)
  230.                 {
  231.                     printf("Integrated GPU: %d\n", integratedGPUNumber);
  232.                     printf("NVIDIA GPU: %d\n", nvidiaGPUNumber);
  233.                     printf("AMD GPU: %d\n", amdGPUNumber);
  234.                     printf("Total LTC Mining Power: %.8f LTC/s\n", ltcPower);
  235.                     printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  236.                 }
  237.                 scanf("%d", &miningModeInput);
  238.                 if (miningModeInput==mineCryptoNumber)
  239.                 {
  240.                     ltcBalance+=ltcPower;
  241.                     ltcInCurrentSession+=ltcPower;
  242.                 }
  243.                 else if (miningModeInput==alternateMineCryptoNumber)
  244.                 {
  245.                     ltcBalance+=alternateLtcPower;
  246.                     ltcInCurrentSession+=alternateLtcPower;
  247.                 }
  248.                 else if (miningModeInput==accessMenuNumber)
  249.                 {
  250.                     ltcMode=0;
  251.                     ltcInCurrentSession=0;
  252.                     miningModeInput=-1;
  253.                 }
  254.             }*/
  255.         }
  256.         while (shopMode==1)
  257.         {
  258.             if (alreadyInShop==0)
  259.             {
  260.                 if (shopEnteredBefore==0)
  261.                 {printf("CryptoMiner %.2f\n\n", version);
  262.                     printf("Welcome to the GPU shop!\n");
  263.                     shopEnteredBefore=1;
  264.                 }
  265.                 else
  266.                     printf("Welcome back to the GPU shop!\n");
  267.                 alreadyInShop=1;
  268.             }
  269.             integratedGPUPrice=((750+(integratedGPUNumber*integratedGPUNumber*250))*0.00000001);
  270.             nvidiaGPUPrice=((5000+(nvidiaGPUNumber*nvidiaGPUNumber*400))*0.00000001);
  271.             amdGPUPrice=((10000+(amdGPUNumber*amdGPUNumber*600))*0.00000001);
  272.             printf("BTC: %.8f\n", btcBalance);
  273.             printf("Number\t%-4s\t\t\t%-10s", "Name", "Price\t\tYou Have\tAdded BTC/s\n");
  274.             printf("<1>\t%s(1)\t%-.8f\t%d\t\t%.8f\n", "Integrated GPU", integratedGPUPrice, integratedGPUNumber, integratedGPUNumber*0.00000010);
  275.             printf("<2>\t%s(1)\t\t%-.8f\t%d\t\t%.8f\n", "NVIDIA GPU", nvidiaGPUPrice, nvidiaGPUNumber, nvidiaGPUNumber*0.00000250);
  276.             printf("<3>\t%s(5)\t\t%-.8f\t%d\t\t%.8f\n\n", "AMD GPU", amdGPUPrice, amdGPUNumber, amdGPUNumber*0.00001000);
  277.             printf("<0> Back\n");
  278.             printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  279.             scanf("%d",&shopModeInput);
  280.             if (shopModeInput==1)
  281.             {
  282.                 if (btcBalance>=integratedGPUPrice)
  283.                 {
  284.                     printf("You bought 1 Integrated GPU for %.8f\n", integratedGPUPrice);
  285.                     integratedGPUNumber++;
  286.                     btcPower+=0.00000010;
  287.                     btcBalance-=integratedGPUPrice;
  288.                 }
  289.                 else
  290.                 {
  291.                     printf("You don't have enough BTC.\n");
  292.                     printf("You only have %f BTC.\n", btcBalance);
  293.                 }
  294.             }
  295.             else if (shopModeInput==2)
  296.             {
  297.                 if (btcBalance>=nvidiaGPUPrice)
  298.                 {
  299.                     printf("You bought 1 NVIDIA GPU for %.8f\n", nvidiaGPUPrice);
  300.                     nvidiaGPUNumber++;
  301.                     btcPower+=0.00000250;
  302.                     btcBalance-=nvidiaGPUPrice;
  303.                 }
  304.                 else
  305.                 {
  306.                     printf("You don't have enough BTC.\n");
  307.                     printf("You only have %f BTC.\n", btcBalance);
  308.                 }
  309.             }
  310.             else if (shopModeInput==3)
  311.             {
  312.                 if (btcBalance>=amdGPUPrice)
  313.                 {
  314.                     printf("You bought 1 AMD GPU for %.8f\n", amdGPUPrice);
  315.                     amdGPUNumber++;
  316.                     btcPower+=0.00001000;
  317.                     btcBalance-=amdGPUPrice;
  318.                 }
  319.                 else
  320.                 {
  321.                     printf("You don't have enough BTC.\n");
  322.                     printf("You only have %f BTC.\n", btcBalance);
  323.                 }
  324.             }
  325.             else if (shopModeInput==accessMenuNumber)
  326.             {
  327.                 printf("You have exit the shop, welcome back to your CryptoMine!\n");
  328.                 alreadyInShop=0;
  329.                 shopMode=0;
  330.                 menuMode=1;
  331.             }
  332.             else
  333.             {
  334.                 printf("That is not a valid piece of equipment\n");
  335.             }
  336.         }
  337.         while (controlMode==1)
  338.         {
  339.             printf("Control Menu\n\n<1> Show Controls\n<2> Generate Save Code\n<0> Back\n");
  340.             if (controlModeInput==-1)
  341.                 printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  342.             else if (controlModeInput==showControlsNumber)
  343.             {
  344.                 printf("\n");
  345.                 printf("Controls\n\n");
  346.                 printf("Mine cryptocurrency: %d\n", mineCryptoNumber);
  347.                 printf("Show balance: %d\n", showBalanceNumber);
  348.                 printf("Show list of bought items: %d\n", showItemsNumber);
  349.                 printf("Back: %d\n", accessMenuNumber);
  350.                 printf("\n\n\n\n\n\n\n\n\n\n\n\n");
  351.             }
  352.             /*else if (controlModeInput==showSaveCodeNumber)
  353.             {
  354.                 printf("\n\n");
  355.                 printf("Save Code: %d %d %d\n", btcBalance*100000000, nvidiaGPUNumber, amdGPUNumber);
  356.                 printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  357.             }*/
  358.             else if (controlModeInput<-1 || controlModeInput>quitGameNumber)
  359.             {
  360.                 printf("\n\n");
  361.                 printf("Unknown command");
  362.                 printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  363.             }
  364.             scanf("%d", &controlModeInput);
  365.             if (controlModeInput==accessMenuNumber)
  366.             {
  367.                 controlMode=0;
  368.                 menuMode=1;
  369.             }
  370.         }
  371.     }
  372.         printf("Are you sure you want to quit the game? (1 for yes, 0 for no)\n");
  373.         printf("\n");
  374.         printf("Do you want to generate a save code before leaving?\n");
  375.         printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  376.         scanf("%d", &generateSaveCodeBeforeExit);
  377.     if (generateSaveCodeBeforeExit==1)
  378.     {
  379.         printf("Are you sure you want to quit the game? (1 for yes, 0 for no)\n");
  380.         printf("\n");
  381.         printf("Do you want to generate a save code before leaving?\n");
  382.         printf("\n");
  383.         printf("Save Code: %d %d %d\n", (int)btcBalance*100000000, nvidiaGPUNumber, amdGPUNumber);
  384.         printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  385.     }
  386.     else
  387.     {
  388.         printf("Are you sure you want to quit the game? (1 for yes, 0 for no)\n");
  389.         printf("\n");
  390.         printf("Do you want to generate a save code before leaving?\n");
  391.         printf("\n");
  392.         printf("Ok then.\n");
  393.         printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  394.     }
  395.     return 0;
  396. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement