Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <stdbool.h>
- int main()
- {
- float version=0.30;
- int integratedGPUNumber=1, nvidiaGPUNumber=0, amdGPUNumber=0;
- float btcBalance=0, btcInCurrentSession=0, btcPower=0.00000010, alternateBtcPower;
- float ltcBalance=0, ltcInCurrentSession=0, ltcPower=0.00000010, alternateLtcPower;
- float integratedGPUPrice, nvidiaGPUPrice, amdGPUPrice;
- int accessMenuNumber=0, accessMineNumber=1, accessShopNumber=2, accessBlackMarketNumber=3, accessCryptoMarketNumber=4, accessControlNumber=5, quitGameNumber=6;
- int mineCryptoNumber=1, alternateMineCryptoNumber, showBalanceNumber=2, showItemsNumber=3;
- int showControlsNumber=1, showSaveCodeNumber=2;
- int menuModeInput, miningModeInput=-1, miningModeChooseInput=-1, shopModeInput, controlModeInput=-1;
- bool exitIntro=0, saveCode=0, inGame=1, choosingCurrency=0, alreadyInShop=0, shopEnteredBefore=0, firstTimeInMenu=1, notAvailableMessage=0;
- bool menuMode=1, miningMode=0, btcMode=0, ltcMode=0, shopMode=0, controlMode=0;
- bool generateSaveCodeBeforeExit=0, sureToQuit=0, quitLoop=1, endingPart=1;
- /*printf("CryptoMiner %.2f\n\n", version);
- printf("Welcome to CryptoMiner!\n\nDo you have a save code?(1 for yes, 0 for no).\n");
- scanf("%d", &saveCode);
- if (saveCode==1)
- {
- printf("Load: ");
- scanf("%d %d %d", &btcBalance*100000000, &nvidiaGPUNumber, &amdGPUNumber);
- cookiePower+=nvidiaGPUNumber;
- exitIntro=1;
- printf("\nWelcome back to CryptoMiner!\n");
- }
- else if (saveCode!=0)
- printf("Please try again!");*/
- if (exitIntro==0)
- {
- printf("CryptoMiner %.2f\n\n", version);
- printf("This game is about cryptocurrencies and mining them.\n\n");
- printf("In this game, you are poor at the start and can buy GPUs for mining\n");
- printf("but you require typing on the keyboard, which also is counted as mining\n");
- printf("to power the GPUs with kinetic energy, 1 second per click.\n\n");
- printf("You can buy more equipment to help you with getting more cryptocurrency.\n");
- printf("To access the main menu, type in %d anywhere during the game.\n\n", accessMenuNumber);
- printf("Press \"1\" to continue.\n");
- scanf("%d", &exitIntro);
- while (exitIntro!=1)
- {
- printf("Please try again.\n");
- scanf("%d", &exitIntro);
- }
- }
- while(inGame==1)
- {
- while (menuMode==1)
- {
- printf("CryptoMiner %.2f\n\n", version);
- printf("Main Menu\n\n");
- printf("<1> Mine\n");
- printf("<2> Shop\n");
- printf("<3> Black Market\n");
- printf("<4> CryptoMarket\n");
- printf("<5> Control Menu\n");
- printf("<6> Exit Game\n");
- if (firstTimeInMenu==1)
- {
- printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- firstTimeInMenu=0;
- }
- else if (menuModeInput==accessBlackMarketNumber)
- {
- printf("\n");
- printf("The Black Market is not available yet\n");
- notAvailableMessage=1;
- }
- else if (menuModeInput==accessCryptoMarketNumber)
- {
- printf("\n");
- printf("The CryptoMarket is not available yet\n");
- notAvailableMessage=1;
- }
- else if (menuModeInput<0 || menuModeInput>6)
- {
- printf("\n");
- printf("That is not a valid location\n");
- printf("\n\n\n\n\n\n\n\n\n\n\n\n");
- }
- if (notAvailableMessage==1)
- {
- printf("\n\n\n\n\n\n\n\n\n\n\n\n");
- notAvailableMessage=0;
- }
- scanf("%d", &menuModeInput);
- if (menuModeInput==accessMineNumber)
- {
- menuMode=0;
- miningMode=1;
- firstTimeInMenu=1;
- }
- else if (menuModeInput==accessShopNumber)
- {
- menuMode=0;
- shopMode=1;
- firstTimeInMenu=1;
- }
- else if (menuModeInput==accessControlNumber)
- {
- menuMode=0;
- controlMode=1;
- firstTimeInMenu=1;
- }
- else if (menuModeInput==quitGameNumber)
- {
- printf("Are you sure you want to quit the game? (1 for yes, 0 for no)\n");
- printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- scanf("%d", &sureToQuit);
- while (quitLoop==1)
- {
- if (sureToQuit==1)
- {
- quitLoop=0;
- menuMode=0;
- inGame=0;
- }
- else if (sureToQuit==0)
- {
- quitLoop=0;
- }
- }
- firstTimeInMenu=1;
- quitLoop=1;
- }
- }
- while(miningMode==1)
- {
- choosingCurrency=1;
- while (choosingCurrency==1)
- {
- printf("Cryptocurrency Mines\n\n");
- printf("<1> BTC - SHA-256\n");
- printf("<2> LTC - Scrypt\n");
- printf("<0> Back\n");
- if (miningModeChooseInput==-1)
- printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- else if (miningModeChooseInput<0 || miningModeChooseInput>2)
- {
- printf("\n");
- printf("That is not a valid currency.\n");
- printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- }
- scanf("%d", &miningModeChooseInput);
- if (miningModeChooseInput==1)
- {
- choosingCurrency=0;
- miningModeChooseInput=-1;
- btcMode=1;
- }
- else if (miningModeChooseInput==2)
- {
- choosingCurrency=0;
- miningModeChooseInput=-1;
- ltcMode=1;
- 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");
- }
- if (miningModeChooseInput==0)
- {
- choosingCurrency=0;
- miningModeChooseInput=-1;
- miningMode=0;
- menuMode=1;
- }
- }
- while(btcMode==1)
- {
- printf("BTC Mine\n\n");
- printf("Mined %.8f BTC in this session\n", btcInCurrentSession);
- printf("Balance: %.8f BTC\n\n", btcBalance);
- alternateMineCryptoNumber=mineCryptoNumber*11;
- alternateBtcPower=btcPower*2;
- if (miningModeInput!=showBalanceNumber && miningModeInput!= showItemsNumber)
- printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- if (miningModeInput==showBalanceNumber)
- {
- printf("Other Balances\n");
- printf("%.8f LTC\n", ltcBalance);
- printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- }
- else if (miningModeInput==showItemsNumber)
- {
- printf("Integrated GPU: %d\n", integratedGPUNumber);
- printf("NVIDIA GPU: %d\n", nvidiaGPUNumber);
- printf("AMD GPU: %d\n", amdGPUNumber);
- printf("Total BTC Mining Power: %.8f BTC/s\n", btcPower);
- printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- }
- scanf("%d", &miningModeInput);
- if (miningModeInput==mineCryptoNumber)
- {
- btcBalance+=btcPower;
- btcInCurrentSession+=btcPower;
- }
- else if (miningModeInput==alternateMineCryptoNumber)
- {
- btcBalance+=alternateBtcPower;
- btcInCurrentSession+=alternateBtcPower;
- }
- else if (miningModeInput==accessMenuNumber)
- {
- btcMode=0;
- btcInCurrentSession=0;
- miningModeInput=-1;
- }
- }
- /*while(ltcMode==1)
- {
- printf("LTC Mine\n\n");
- printf("Mined %.8f LTC in this session\n", ltcInCurrentSession);
- printf("Balance: %.8f LTC\n\n", ltcBalance);
- alternateMineCryptoNumber=mineCryptoNumber*11;
- alternateLtcPower=ltcPower*2;
- if (miningModeInput!=showBalanceNumber && miningModeInput!= showItemsNumber)
- printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- if (miningModeInput==showBalanceNumber)
- {
- printf("Other Balances\n");
- printf("%.8f LTC\n", ltcBalance);
- printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- }
- else if (miningModeInput==showItemsNumber)
- {
- printf("Integrated GPU: %d\n", integratedGPUNumber);
- printf("NVIDIA GPU: %d\n", nvidiaGPUNumber);
- printf("AMD GPU: %d\n", amdGPUNumber);
- printf("Total LTC Mining Power: %.8f LTC/s\n", ltcPower);
- printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- }
- scanf("%d", &miningModeInput);
- if (miningModeInput==mineCryptoNumber)
- {
- ltcBalance+=ltcPower;
- ltcInCurrentSession+=ltcPower;
- }
- else if (miningModeInput==alternateMineCryptoNumber)
- {
- ltcBalance+=alternateLtcPower;
- ltcInCurrentSession+=alternateLtcPower;
- }
- else if (miningModeInput==accessMenuNumber)
- {
- ltcMode=0;
- ltcInCurrentSession=0;
- miningModeInput=-1;
- }
- }*/
- }
- while (shopMode==1)
- {
- if (alreadyInShop==0)
- {
- if (shopEnteredBefore==0)
- {printf("CryptoMiner %.2f\n\n", version);
- printf("Welcome to the GPU shop!\n");
- shopEnteredBefore=1;
- }
- else
- printf("Welcome back to the GPU shop!\n");
- alreadyInShop=1;
- }
- integratedGPUPrice=((750+(integratedGPUNumber*integratedGPUNumber*250))*0.00000001);
- nvidiaGPUPrice=((5000+(nvidiaGPUNumber*nvidiaGPUNumber*400))*0.00000001);
- amdGPUPrice=((10000+(amdGPUNumber*amdGPUNumber*600))*0.00000001);
- printf("BTC: %.8f\n", btcBalance);
- printf("Number\t%-4s\t\t\t%-10s", "Name", "Price\t\tYou Have\tAdded BTC/s\n");
- printf("<1>\t%s(1)\t%-.8f\t%d\t\t%.8f\n", "Integrated GPU", integratedGPUPrice, integratedGPUNumber, integratedGPUNumber*0.00000010);
- printf("<2>\t%s(1)\t\t%-.8f\t%d\t\t%.8f\n", "NVIDIA GPU", nvidiaGPUPrice, nvidiaGPUNumber, nvidiaGPUNumber*0.00000250);
- printf("<3>\t%s(5)\t\t%-.8f\t%d\t\t%.8f\n\n", "AMD GPU", amdGPUPrice, amdGPUNumber, amdGPUNumber*0.00001000);
- printf("<0> Back\n");
- printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- scanf("%d",&shopModeInput);
- if (shopModeInput==1)
- {
- if (btcBalance>=integratedGPUPrice)
- {
- printf("You bought 1 Integrated GPU for %.8f\n", integratedGPUPrice);
- integratedGPUNumber++;
- btcPower+=0.00000010;
- btcBalance-=integratedGPUPrice;
- }
- else
- {
- printf("You don't have enough BTC.\n");
- printf("You only have %f BTC.\n", btcBalance);
- }
- }
- else if (shopModeInput==2)
- {
- if (btcBalance>=nvidiaGPUPrice)
- {
- printf("You bought 1 NVIDIA GPU for %.8f\n", nvidiaGPUPrice);
- nvidiaGPUNumber++;
- btcPower+=0.00000250;
- btcBalance-=nvidiaGPUPrice;
- }
- else
- {
- printf("You don't have enough BTC.\n");
- printf("You only have %f BTC.\n", btcBalance);
- }
- }
- else if (shopModeInput==3)
- {
- if (btcBalance>=amdGPUPrice)
- {
- printf("You bought 1 AMD GPU for %.8f\n", amdGPUPrice);
- amdGPUNumber++;
- btcPower+=0.00001000;
- btcBalance-=amdGPUPrice;
- }
- else
- {
- printf("You don't have enough BTC.\n");
- printf("You only have %f BTC.\n", btcBalance);
- }
- }
- else if (shopModeInput==accessMenuNumber)
- {
- printf("You have exit the shop, welcome back to your CryptoMine!\n");
- alreadyInShop=0;
- shopMode=0;
- menuMode=1;
- }
- else
- {
- printf("That is not a valid piece of equipment\n");
- }
- }
- while (controlMode==1)
- {
- printf("Control Menu\n\n<1> Show Controls\n<2> Generate Save Code\n<0> Back\n");
- if (controlModeInput==-1)
- printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- else if (controlModeInput==showControlsNumber)
- {
- printf("\n");
- printf("Controls\n\n");
- printf("Mine cryptocurrency: %d\n", mineCryptoNumber);
- printf("Show balance: %d\n", showBalanceNumber);
- printf("Show list of bought items: %d\n", showItemsNumber);
- printf("Back: %d\n", accessMenuNumber);
- printf("\n\n\n\n\n\n\n\n\n\n\n\n");
- }
- /*else if (controlModeInput==showSaveCodeNumber)
- {
- printf("\n\n");
- printf("Save Code: %d %d %d\n", btcBalance*100000000, nvidiaGPUNumber, amdGPUNumber);
- printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- }*/
- else if (controlModeInput<-1 || controlModeInput>quitGameNumber)
- {
- printf("\n\n");
- printf("Unknown command");
- printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- }
- scanf("%d", &controlModeInput);
- if (controlModeInput==accessMenuNumber)
- {
- controlMode=0;
- menuMode=1;
- }
- }
- }
- printf("Are you sure you want to quit the game? (1 for yes, 0 for no)\n");
- printf("\n");
- printf("Do you want to generate a save code before leaving?\n");
- printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- scanf("%d", &generateSaveCodeBeforeExit);
- if (generateSaveCodeBeforeExit==1)
- {
- printf("Are you sure you want to quit the game? (1 for yes, 0 for no)\n");
- printf("\n");
- printf("Do you want to generate a save code before leaving?\n");
- printf("\n");
- printf("Save Code: %d %d %d\n", (int)btcBalance*100000000, nvidiaGPUNumber, amdGPUNumber);
- printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- }
- else
- {
- printf("Are you sure you want to quit the game? (1 for yes, 0 for no)\n");
- printf("\n");
- printf("Do you want to generate a save code before leaving?\n");
- printf("\n");
- printf("Ok then.\n");
- printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement