Advertisement
XOptimistixX

CryptoMiner Alpha 0.31

Jul 27th, 2014
210
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 sureToQuit=0;
  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.  
  83.             else if (menuModeInput==quitGameNumber)
  84.             {
  85.                 printf("\n");
  86.                 printf("Are you sure you want to quit the game? (1 for yes, 0 for no)\n");
  87.                 printf("\n\n\n\n\n\n\n\n\n\n\n\n");
  88.                 scanf("%d", &sureToQuit);
  89.                 if (sureToQuit==1)
  90.                 {
  91.                     printf("Thanks for playing CryptoMiner!\n");
  92.                     printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  93.                     menuMode=0;
  94.                     inGame=0;
  95.                     return 0;
  96.                 }
  97.                 else
  98.                     firstTimeInMenu=1;
  99.             }
  100.             else if (menuModeInput<0 || menuModeInput>6)
  101.             {
  102.                 printf("\n");
  103.                 printf("That is not a valid location\n");
  104.                 printf("\n\n\n\n\n\n\n\n\n\n\n\n");
  105.             }
  106.  
  107.             if (notAvailableMessage==1)
  108.             {
  109.                 printf("\n\n\n\n\n\n\n\n\n\n\n\n");
  110.                 notAvailableMessage=0;
  111.             }
  112.             scanf("%d", &menuModeInput);
  113.             if (menuModeInput==accessMineNumber)
  114.             {
  115.                 menuMode=0;
  116.                 miningMode=1;
  117.                 firstTimeInMenu=1;
  118.             }
  119.             else if (menuModeInput==accessShopNumber)
  120.             {
  121.                 menuMode=0;
  122.                 shopMode=1;
  123.                 firstTimeInMenu=1;
  124.             }
  125.             else if (menuModeInput==accessControlNumber)
  126.             {
  127.                 menuMode=0;
  128.                 controlMode=1;
  129.                 firstTimeInMenu=1;
  130.             }
  131.         }
  132.         while(miningMode==1)
  133.         {
  134.             choosingCurrency=1;
  135.             while (choosingCurrency==1)
  136.             {
  137.                 printf("Cryptocurrency Mines\n\n");
  138.                 printf("<1> BTC - SHA-256\n");
  139.                 printf("<2> LTC - Scrypt\n");
  140.                 printf("<0> Back\n");
  141.                 if (miningModeChooseInput==-1)
  142.                     printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  143.                 else if (miningModeChooseInput<0 || miningModeChooseInput>2)
  144.                 {
  145.                     printf("\n");
  146.                     printf("That is not a valid currency.\n");
  147.                     printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  148.                 }
  149.                 scanf("%d", &miningModeChooseInput);
  150.                 if (miningModeChooseInput==1)
  151.                 {
  152.                     choosingCurrency=0;
  153.                     miningModeChooseInput=-1;
  154.                     btcMode=1;
  155.                 }
  156.                 else if (miningModeChooseInput==2)
  157.                 {
  158.                     choosingCurrency=0;
  159.                     miningModeChooseInput=-1;
  160.                     ltcMode=1;
  161.                     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");
  162.                 }
  163.                 if (miningModeChooseInput==0)
  164.                 {
  165.                     choosingCurrency=0;
  166.                     miningModeChooseInput=-1;
  167.                     miningMode=0;
  168.                     menuMode=1;
  169.                 }
  170.             }
  171.             while(btcMode==1)
  172.             {
  173.                 printf("BTC Mine\n\n");
  174.                 printf("Mined %.8f BTC in this session\n", btcInCurrentSession);
  175.                 printf("Balance: %.8f BTC\n\n", btcBalance);
  176.                 alternateMineCryptoNumber=mineCryptoNumber*11;
  177.                 alternateBtcPower=btcPower*2;
  178.                 if (miningModeInput!=showBalanceNumber && miningModeInput!= showItemsNumber)
  179.                     printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  180.                 if (miningModeInput==showBalanceNumber)
  181.                 {
  182.                     printf("Other Balances\n");
  183.                     printf("%.8f LTC\n", ltcBalance);
  184.                     printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  185.                 }
  186.                 else if (miningModeInput==showItemsNumber)
  187.                 {
  188.                     printf("Integrated GPU: %d\n", integratedGPUNumber);
  189.                     printf("NVIDIA GPU: %d\n", nvidiaGPUNumber);
  190.                     printf("AMD GPU: %d\n", amdGPUNumber);
  191.                     printf("Total BTC Mining Power: %.8f BTC/s\n", btcPower);
  192.                     printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  193.                 }
  194.                 scanf("%d", &miningModeInput);
  195.                 if (miningModeInput==mineCryptoNumber)
  196.                 {
  197.                     btcBalance+=btcPower;
  198.                     btcInCurrentSession+=btcPower;
  199.                 }
  200.                 else if (miningModeInput==alternateMineCryptoNumber)
  201.                 {
  202.                     btcBalance+=alternateBtcPower;
  203.                     btcInCurrentSession+=alternateBtcPower;
  204.                 }
  205.                 else if (miningModeInput==accessMenuNumber)
  206.                 {
  207.                     btcMode=0;
  208.                     btcInCurrentSession=0;
  209.                     miningModeInput=-1;
  210.                 }
  211.             }
  212.             /*while(ltcMode==1)
  213.             {
  214.                 printf("LTC Mine\n\n");
  215.                 printf("Mined %.8f LTC in this session\n", ltcInCurrentSession);
  216.                 printf("Balance: %.8f LTC\n\n", ltcBalance);
  217.                 alternateMineCryptoNumber=mineCryptoNumber*11;
  218.                 alternateLtcPower=ltcPower*2;
  219.                 if (miningModeInput!=showBalanceNumber && miningModeInput!= showItemsNumber)
  220.                     printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  221.                 if (miningModeInput==showBalanceNumber)
  222.                 {
  223.                     printf("Other Balances\n");
  224.                     printf("%.8f LTC\n", ltcBalance);
  225.                     printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  226.                 }
  227.                 else if (miningModeInput==showItemsNumber)
  228.                 {
  229.                     printf("Integrated GPU: %d\n", integratedGPUNumber);
  230.                     printf("NVIDIA GPU: %d\n", nvidiaGPUNumber);
  231.                     printf("AMD GPU: %d\n", amdGPUNumber);
  232.                     printf("Total LTC Mining Power: %.8f LTC/s\n", ltcPower);
  233.                     printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  234.                 }
  235.                 scanf("%d", &miningModeInput);
  236.                 if (miningModeInput==mineCryptoNumber)
  237.                 {
  238.                     ltcBalance+=ltcPower;
  239.                     ltcInCurrentSession+=ltcPower;
  240.                 }
  241.                 else if (miningModeInput==alternateMineCryptoNumber)
  242.                 {
  243.                     ltcBalance+=alternateLtcPower;
  244.                     ltcInCurrentSession+=alternateLtcPower;
  245.                 }
  246.                 else if (miningModeInput==accessMenuNumber)
  247.                 {
  248.                     ltcMode=0;
  249.                     ltcInCurrentSession=0;
  250.                     miningModeInput=-1;
  251.                 }
  252.             }*/
  253.         }
  254.         while (shopMode==1)
  255.         {
  256.             if (alreadyInShop==0)
  257.             {
  258.                 if (shopEnteredBefore==0)
  259.                 {printf("CryptoMiner %.2f\n\n", version);
  260.                     printf("Welcome to the GPU shop!\n");
  261.                     shopEnteredBefore=1;
  262.                 }
  263.                 else
  264.                     printf("Welcome back to the GPU shop!\n");
  265.                 alreadyInShop=1;
  266.             }
  267.             integratedGPUPrice=((750+(integratedGPUNumber*integratedGPUNumber*250))*0.00000001);
  268.             nvidiaGPUPrice=((5000+(nvidiaGPUNumber*nvidiaGPUNumber*400))*0.00000001);
  269.             amdGPUPrice=((10000+(amdGPUNumber*amdGPUNumber*600))*0.00000001);
  270.             printf("BTC: %.8f\n", btcBalance);
  271.             printf("Number\t%-4s\t\t\t%-10s", "Name", "Price\t\tYou Have\tAdded BTC/s\n");
  272.             printf("<1>\t%s(1)\t%-.8f\t%d\t\t%.8f\n", "Integrated GPU", integratedGPUPrice, integratedGPUNumber, integratedGPUNumber*0.00000010);
  273.             printf("<2>\t%s(1)\t\t%-.8f\t%d\t\t%.8f\n", "NVIDIA GPU", nvidiaGPUPrice, nvidiaGPUNumber, nvidiaGPUNumber*0.00000250);
  274.             printf("<3>\t%s(5)\t\t%-.8f\t%d\t\t%.8f\n\n", "AMD GPU", amdGPUPrice, amdGPUNumber, amdGPUNumber*0.00001000);
  275.             printf("<0> Back\n");
  276.             printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  277.             scanf("%d",&shopModeInput);
  278.             if (shopModeInput==1)
  279.             {
  280.                 if (btcBalance>=integratedGPUPrice)
  281.                 {
  282.                     printf("You bought 1 Integrated GPU for %.8f\n", integratedGPUPrice);
  283.                     integratedGPUNumber++;
  284.                     btcPower+=0.00000010;
  285.                     btcBalance-=integratedGPUPrice;
  286.                 }
  287.                 else
  288.                 {
  289.                     printf("You don't have enough BTC.\n");
  290.                     printf("You only have %f BTC.\n", btcBalance);
  291.                 }
  292.             }
  293.             else if (shopModeInput==2)
  294.             {
  295.                 if (btcBalance>=nvidiaGPUPrice)
  296.                 {
  297.                     printf("You bought 1 NVIDIA GPU for %.8f\n", nvidiaGPUPrice);
  298.                     nvidiaGPUNumber++;
  299.                     btcPower+=0.00000250;
  300.                     btcBalance-=nvidiaGPUPrice;
  301.                 }
  302.                 else
  303.                 {
  304.                     printf("You don't have enough BTC.\n");
  305.                     printf("You only have %f BTC.\n", btcBalance);
  306.                 }
  307.             }
  308.             else if (shopModeInput==3)
  309.             {
  310.                 if (btcBalance>=amdGPUPrice)
  311.                 {
  312.                     printf("You bought 1 AMD GPU for %.8f\n", amdGPUPrice);
  313.                     amdGPUNumber++;
  314.                     btcPower+=0.00001000;
  315.                     btcBalance-=amdGPUPrice;
  316.                 }
  317.                 else
  318.                 {
  319.                     printf("You don't have enough BTC.\n");
  320.                     printf("You only have %f BTC.\n", btcBalance);
  321.                 }
  322.             }
  323.             else if (shopModeInput==accessMenuNumber)
  324.             {
  325.                 printf("You have exit the shop, welcome back to your CryptoMine!\n");
  326.                 alreadyInShop=0;
  327.                 shopMode=0;
  328.                 menuMode=1;
  329.             }
  330.             else
  331.             {
  332.                 printf("That is not a valid piece of equipment\n");
  333.             }
  334.         }
  335.         while (controlMode==1)
  336.         {
  337.             printf("Control Menu\n\n<1> Show Controls\n<2> Generate Save Code\n<0> Back\n");
  338.             if (controlModeInput==-1)
  339.                 printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  340.             else if (controlModeInput==showControlsNumber)
  341.             {
  342.                 printf("\n");
  343.                 printf("Controls\n\n");
  344.                 printf("Mine cryptocurrency: %d\n", mineCryptoNumber);
  345.                 printf("Show balance: %d\n", showBalanceNumber);
  346.                 printf("Show list of bought items: %d\n", showItemsNumber);
  347.                 printf("Back: %d\n", accessMenuNumber);
  348.                 printf("\n\n\n\n\n\n\n\n\n\n\n\n");
  349.             }
  350.             /*else if (controlModeInput==showSaveCodeNumber)
  351.             {
  352.                 printf("\n\n");
  353.                 printf("Save Code: %d %d %d\n", btcBalance*100000000, nvidiaGPUNumber, amdGPUNumber);
  354.                 printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  355.             }*/
  356.             else if (controlModeInput<-1 || controlModeInput>quitGameNumber)
  357.             {
  358.                 printf("\n\n");
  359.                 printf("Unknown command");
  360.                 printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  361.             }
  362.             scanf("%d", &controlModeInput);
  363.             if (controlModeInput==accessMenuNumber)
  364.             {
  365.                 controlMode=0;
  366.                 menuMode=1;
  367.             }
  368.         }
  369.     }
  370. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement