View difference between Paste ID: PrhNJZYX and 5cmHsnsy
SHOW: | | - or go back to the newest paste.
1
#include <stdio.h>
2
#include <stdlib.h>
3
#include <stdbool.h>
4
5
int main()
6
{
7-
    int amountOfCookies=0, cookiePower=10, alternateCookiePower, exitIntro=0;
7+
    float version=0.30;
8-
    int cookieClickNumber=1, alternateCookieClickNumber, showCookiesNumber=2, showBoughtItems=3;
8+
9-
    int shopAccessNumber=0, showControlMenu=100;
9+
    int integratedGPUNumber=1, nvidiaGPUNumber=0, amdGPUNumber=0;
10-
    int showControlsNumber=1, showSaveCodeNumber=2, quitGameNumber=3;
10+
    float btcBalance=0, btcInCurrentSession=0, btcPower=0.00000010, alternateBtcPower;
11-
    int cookieModeInput, shopModeInput, controlModeInput=-1;
11+
    float ltcBalance=0, ltcInCurrentSession=0, ltcPower=0.00000010, alternateLtcPower;
12-
    int cursorNumber=0, cursorPrice, bakerNumber=0, bakerPrice;
12+
    float integratedGPUPrice, nvidiaGPUPrice, amdGPUPrice;
13-
    bool saveCode=0, printMessage=1, inGame=1, cookieMode=1, shopMode=0, controlMode=0, shopEnteredBefore=0;
13+
14-
    bool boughtSomething=1, generateSaveCodeBeforeExit=0, sureToQuit=0, quitLoop=1;
14+
    int accessMenuNumber=0, accessMineNumber=1, accessShopNumber=2, accessBlackMarketNumber=3, accessCryptoMarketNumber=4, accessControlNumber=5, quitGameNumber=6;
15-
    printf("Welcome to Cookie Clicker!\nDo you have a save code?(1 for yes, 0 for no).\n");
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-
        scanf("%d %d %d", &amountOfCookies, &cursorNumber, &bakerNumber);
20+
    bool menuMode=1, miningMode=0, btcMode=0, ltcMode=0, shopMode=0, controlMode=0;
21-
        cookiePower+=cursorNumber;
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-
        printf("Please try again!");
25+
26
    if (saveCode==1)
27
    {
28-
        printf("In the beginning, you get 10 cookie each time.\nYou can buy things to help you with getting more cookies.\n");
28+
29-
        printf("To access the controls menu, \ntype in %d anywhere during the game.\n", showControlMenu);
29+
        scanf("%d %d %d", &btcBalance*100000000, &nvidiaGPUNumber, &amdGPUNumber);
30-
        printf("Press 1 to continue.\n");
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-
        if (printMessage==1)
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("\nStart fabricating cookies!\nHave fun!\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
43+
        printf("You can buy more equipment to help you with getting more cryptocurrency.\n");
44-
            printMessage=0;
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-
            quitLoop=1;
48+
49-
            printf("Control Menu\n\n<1> Show Controls\n<2> Generate Save Code\n<3> Quit Game\n");
49+
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("Controls\n");
61+
            printf("<3> Black Market\n");
62-
                printf("Click cookie: %d\n", cookieClickNumber);
62+
            printf("<4> CryptoMarket\n");
63-
                printf("Go to shop: %d\n", shopAccessNumber);
63+
            printf("<5> Control Menu\n");
64-
                printf("Access Control Menu: %d\n", showControlMenu);
64+
            printf("<6> Exit Game\n");
65-
                printf("\n\n\n\n\n\n\n\n\n\n\n\n\n");
65+
            if (firstTimeInMenu==1)
66
            {
67-
            else if (controlModeInput==showSaveCodeNumber)
67+
                printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
68
                firstTimeInMenu=0;
69
            }
70-
                printf("Save Code: %d %d %d\n", amountOfCookies, cursorNumber, bakerNumber);
70+
            else if (menuModeInput==accessBlackMarketNumber)
71
            {
72
                printf("\n");
73-
            else if (controlModeInput==0)
73+
                printf("The Black Market is not available yet\n");
74
                notAvailableMessage=1;
75
            }
76-
                cookieMode=1;
76+
            else if (menuModeInput==accessCryptoMarketNumber)
77-
                controlModeInput=-1;
77+
78
                printf("\n");
79
                printf("The CryptoMarket is not available yet\n");
80-
            if (controlModeInput==quitGameNumber)
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-
                        controlMode=0;
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-
                        controlModeInput=-1;
94+
            if (menuModeInput==accessMineNumber)
95
            {
96
                menuMode=0;
97
                miningMode=1;
98
                firstTimeInMenu=1;
99
            }
100-
        while(cookieMode==1)
100+
            else if (menuModeInput==accessShopNumber)
101
            {
102-
            alternateCookieClickNumber=cookieClickNumber*11;
102+
                menuMode=0;
103-
            alternateCookiePower=cookiePower*2;
103+
104-
            scanf("%d",&cookieModeInput);
104+
                firstTimeInMenu=1;
105-
            if (cookieModeInput==cookieClickNumber)
105+
106
            else if (menuModeInput==accessControlNumber)
107-
                amountOfCookies+=cookiePower;
107+
108-
                printf("Made %d cookies!\n", cookiePower);
108+
                menuMode=0;
109
                controlMode=1;
110-
            else if (cookieModeInput==alternateCookieClickNumber)
110+
                firstTimeInMenu=1;
111
            }
112-
                amountOfCookies+=alternateCookiePower;
112+
            else if (menuModeInput==quitGameNumber)
113-
                printf("Made %d cookies!\n", alternateCookiePower);
113+
114
                printf("Are you sure you want to quit the game? (1 for yes, 0 for no)\n");
115-
            else if (cookieModeInput==showCookiesNumber)
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-
                printf("Cookies: %d\n", amountOfCookies);
116+
117-
            else if (cookieModeInput==shopAccessNumber)
117+
118
                {
119-
                cookieMode=0;
119+
120
                    {
121
                        quitLoop=0;
122-
            else if (cookieModeInput==showControlMenu)
122+
                        menuMode=0;
123
                        inGame=0;
124
                    }
125-
                cookieMode=0;
125+
126
                    {
127
                        quitLoop=0;
128-
        if (shopMode==1)
128+
129
                }
130-
            if (shopEnteredBefore==0)
130+
                firstTimeInMenu=1;
131
                quitLoop=1;
132-
                printf("Welcome to the shop!(Exit:0)\n");
132+
133-
                shopEnteredBefore=1;
133+
134
        while(miningMode==1)
135
        {
136-
                printf("Welcome back to the shop!\n");
136+
            choosingCurrency=1;
137-
            while (shopMode==1)
137+
            while (choosingCurrency==1)
138
            {
139-
                cursorPrice=500+(cursorNumber*cursorNumber*400);
139+
                printf("Cryptocurrency Mines\n\n");
140-
                bakerPrice=1000+(cursorNumber*cursorNumber*600);
140+
                printf("<1> BTC - SHA-256\n");
141-
                boughtSomething=1;
141+
                printf("<2> LTC - Scrypt\n");
142-
                if(boughtSomething==1)
142+
                printf("<0> Back\n");
143
                if (miningModeChooseInput==-1)
144-
                    printf("Cookies: %d\n\n", amountOfCookies);
144+
                    printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
145-
                    printf("Number\t\t%-4s\t\t%-10s", "Name", "Price\t\tYou Have\tAdded CPC\n");
145+
                else if (miningModeChooseInput<0 || miningModeChooseInput>2)
146-
                    printf("<1>\t\t%s(1)\t%-d\t\t%d\t\t%d\n", "Cursor", cursorPrice, cursorNumber, cursorNumber);
146+
147-
                    printf("<2>\t\t%s(5)\t%-d\t\t%d\t\t%d\n", "Baker", bakerPrice, bakerNumber, bakerNumber*5);
147+
                    printf("\n");
148-
                    printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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-
                    printf("You only have %d cookies.\n", amountOfCookies);
151+
                scanf("%d", &miningModeChooseInput);
152-
                scanf("%d",&shopModeInput);
152+
                if (miningModeChooseInput==1)
153-
                if (shopModeInput==1)
153+
154
                    choosingCurrency=0;
155-
                    if (amountOfCookies>=cursorPrice)
155+
                    miningModeChooseInput=-1;
156
                    btcMode=1;
157-
                        printf("You bought 1 Cursor for %d\n", cursorPrice);
157+
158-
                        cursorNumber++;
158+
                else if (miningModeChooseInput==2)
159-
                        cookiePower++;
159+
160-
                        amountOfCookies-=cursorPrice;
160+
                    choosingCurrency=0;
161-
                        boughtSomething=1;
161+
                    miningModeChooseInput=-1;
162
                    ltcMode=1;
163-
                    else
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-
                        printf("You don't have enough cookies.\n");
165+
                if (miningModeChooseInput==0)
166-
                        boughtSomething=0;
166+
167
                    choosingCurrency=0;
168
                    miningModeChooseInput=-1;
169-
                else if (shopModeInput==2)
169+
                    miningMode=0;
170
                    menuMode=1;
171-
                    if (amountOfCookies>=bakerPrice)
171+
172
            }
173-
                        printf("You bought 1 Baker for %d\n", bakerPrice);
173+
            while(btcMode==1)
174-
                        bakerNumber++;
174+
175-
                        cookiePower+=5;
175+
                printf("BTC Mine\n\n");
176-
                        amountOfCookies-=bakerPrice;
176+
                printf("Mined %.8f BTC in this session\n", btcInCurrentSession);
177-
                        boughtSomething=1;
177+
                printf("Balance: %.8f BTC\n\n", btcBalance);
178
                alternateMineCryptoNumber=mineCryptoNumber*11;
179-
                    else
179+
                alternateBtcPower=btcPower*2;
180
                if (miningModeInput!=showBalanceNumber && miningModeInput!= showItemsNumber)
181-
                        printf("You don't have enough cookies.\n");
181+
                    printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
182-
                        boughtSomething=0;
182+
                if (miningModeInput==showBalanceNumber)
183
                {
184
                    printf("Other Balances\n");
185-
                else if (shopModeInput==0)
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-
                    printf("You have exit the shop, welcome back to your cookie fabricator!\n");
187+
188-
                    printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
188+
                else if (miningModeInput==showItemsNumber)
189-
                    boughtSomething=0;
189+
190-
                    shopMode=0;
190+
                    printf("Integrated GPU: %d\n", integratedGPUNumber);
191-
                    cookieMode=1;
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-
    printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
196+
                scanf("%d", &miningModeInput);
197-
    printf("Do you want to generate a save code before leaving?\n");
197+
                if (miningModeInput==mineCryptoNumber)
198-
    scanf("%d", &generateSaveCodeBeforeExit);
198+
199
                    btcBalance+=btcPower;
200-
        printf("Save Code: %d %d %d\n", amountOfCookies, cursorNumber, bakerNumber);
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
}