forked from vectorniner/gitlabSpring21
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrpgGame.c
More file actions
8698 lines (7583 loc) · 285 KB
/
rpgGame.c
File metadata and controls
8698 lines (7583 loc) · 285 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//Contributors
//G. Poppe
//Meredith Quail
//Benjamin Lozano
//Room 1: Mohammad Karahassan
//Room 19: Jonathan Chua
//room 18-Gary Boze
//Cristian Lopez - Room 9
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
#include <stdio.h>
#include <stdbool.h>
#include <unistd.h> /* Room 19 additional includes */
void eTeenfillArray(int *ptr, int x);//18
void eTeenPrinter(int *ptr, int x);//18
double jumpAvg(char y);//18
char eTeenLakePrompt(void);//18
void eTeenLakeprinter(double average);//18
int RollArray(int arr[]);//LA
void Prt(int arr[]);//LA
void nV(char a[]);//LA
void BBGprnt();//LA
void BagTossed(int *arr);//lA
void TossBag(int *arr);//lA
void patrickInitialPrompt(void);
void demondoor(void);
void angeldoor(char name[]);
void broomcloset(void);
/* Start of Room 19 Function Prototypes */
int room19_doorDecision(void);
int room19_heroChoice(void);
float room19_getAvg(int*);
void room19_criteriaBomb(int*);
void room19_readFile(FILE*);
void room19_dragonRAWRS(FILE*);
void room19_heroToast(FILE*);
void room19_ending3(FILE*);
/* End of Room 19 Function Prototyping */
char *randomString(char *p);
char *shiftString(char *p, int choice);
void mQhelpMenu(void); //mquail
void mQcontinue(void); //mquail
int mQuserInput(void); //mquail
int mQparser1(FILE *writePointer, FILE *readPointer, bool *clearParserPointer); //mquail
int mQparser2(FILE *writePointer, FILE *readPointer, bool inventory[7]); //mquail
void mQprintInventory(bool inventory[7]); //mquail
void mQprintLocations(int noteCount, const char* const locations[10]); //mquail
char uInput[20]; //mquail
const char* const locations[10] = {"stove", "fridge", "freezer", "sink", "cabinets", "microwave"}; //mquail
bool inventory[10] = {false /*[0]tomato*/,false /*[1]onions*/,false /*[2]meat*/,false /*[3]beans*/,false /*[4]spices*/,false /*[5]tortillas*/,false /*[6]GameEnd*/, false /*[7]Can Opener*/, false /*[8]CO used*/, false /*[9]5found*/}; //mquail
bool clearParser = false; //mquail
void printIntroduction(void); // Manuel Castaneda
void printRules(int rollsPerTurn, int pointsToLoose); // Manuel Castaneda
double averageM(int rolls[], int numberOfRolls); // Manuel Castaneda
double sumM(double sums[], int maxSums); // Manuel Castaneda
void printRollResults(int rolls[], int numberOfRolls, int isUser); // Manuel Castaneda
void play(int *ptr);//josue
void story(void);//josue
void elf(void);//josue
void results(int *ptr);//Josue
double avgElf(int a[]);//Josue
void outcome(double x, double y);//Josue
void afterElf(void);//Josue
void vendingMachine(void);//Josue
void door(void);//Josue
void secondGame(void);//Josue
int game21Opponent();//Josue
int game21(int d[]);//Josue
void cardgameResult(int o, int y);//Josue
void afterSecond(void);//Josue
int theFinale(int f[]);//Josue
int theAngel(int f[]);//Josue
void lastResult(int a, int o);//Josue
void finalization(void);//Josue
// Talise
void printMessage(int msg[]);
void decodeMessage(char alphabet[], int codedMessage[], int *totalGuesses, int *wrong);
void userFate(int x);
//Monika
void monikawelcome(char name[]);
void monikacase1(char yellowdecision[]);
void monikacase2(char reddecision[]);
void monikacase3(char greenchoice[]);
//Monika
// Tien Tran Functions Start
void room_37_read_instructions_from_file();
int room_37_guess_number(int);
int room_37_prompt_guess(int, int);
int room_37_average();
void room_37_fill_array(int *, int);
// Tien Tran Functions End
//Carlos Gonzalez
int dpsCalc(int x, int y, int a);
void printResults(int z, int a);
void wordGame(char *pointer);
//Benjamin Lozano
int greenUSB26(int *arrPtr26);
int blueUSB26(int *arrPtr26);
int redUSB26();
void lockedDoor26(int targetNumber1, int targetNumber2, int targetNumber3);
//Benjamin Lozano
//Cristian Lopez
_Bool cLopezValidBet(double amount, double bal);
void cLopezFillFlipArray(int *pntr);
_Bool cLopezScanFlipArray(int *pntr, int userPick);
//Cristian Lopez
//AndyV
int p(void);
int strikes(int p);
int weapon(int a[], int strikes, int wpn);
int totalHits(int a[], int strikes);
double avgHitPower(int totalHits, int strikes);
void noteFromRick(void);//Berenis Castruita
void stars(void);//Berenis Castruita
void flurbos(void);//Berenis Castruita
void planets(void);//Berenis Castruita
void goodBye(void);//Berenis Castruita
//Matthew Bunma
void mbchoice(void);
void mbchoice2(void);
void mining(int *p,int *tCoin, int it[]) ; //David Ko
void status(int *p,int tCoin, int it[]);
void gamble(int *p, char n[]);
void flipCoin(int *p);
void shop(int *p, int it[]);
void VIProom(int *p, char n[]);
void pause27();
int fairy(int *p, char n[]);
int total();//Elizabeth Flores prototype function
int prompt(void);
void modArray(int arrInt[], int size);
void printArray(int arrInt[], int size);
void eflores(char strings[]);
//Room 10, Yoelin R
void nameToUpper(char lowerName[], int length1, char uppername[], int length2);
int nextGame(char name[], int length);
void writeRegistration(void);
//Room 10, Yoelin R
int averageMk(int x, int y); //mkarahassan room#1
void ggPromtMk(int x); //mkarahassan room#1
//Fernando Rodriguez
int Coinflip21(int x ,int z);
void codeH(void);
void codeT(void);
//Norville Amao
int aCharCreator(char charName[], int charRace, int charStats[]);
int aPartOne(int choice, char charName[], int charRace, int charStats[]);
int aPartTwoWrong(int nextArea, int charRace, int charStats[]);
void aPartTwo(char charName[], int charRace, int charStats[]);
int mainC(void);//Arpit
int fill(float *randnu);//Arpit
int printer(float *prntArray);//Arpit
int crush(void);//Arpit
int main(int argc, char *argv[])
{
FILE *ETrptr,*ETwptr;//18
ETrptr = fopen("inputET.txt", "r");//18
ETwptr = fopen("outputET.txt", "w");//18
int a,x,y,z,i,h,g,k,request,choice=0;
char name[256];
char tech[256];
char *pointer = tech;
int boxNum=0;
int sum = 0;
int number;
int action=0,totalCoin=0, item[5]={0};// 1 actions 2 pickaxe
int *ptr;
float average;
srand(time(NULL));
printf("Please enter your name: "); //Input any number of array inputs
scanf("%s",name);
printf("Hello %s welcome to the rpgGame!\n",name);
while(choice != 99)
{
puts("You find yourself in a dark room and you are not sure how you got here.");
puts("As you look around you see the room has 40 doors, each labeled with a number. You are not sure how such a small room can have 40 doors, sooo magic...");
puts("The room starts filling with water and you must choose a door to open or you will likely drown. you may quit anytime by selecting option 99");
puts("What door do you choose?");
scanf("%d",&choice);
switch(choice)
{
case 1:
{
int i = 0, length = 0;
char c;
//arrays
int value[10] = {2,4,6,1,8,20,9,0,7,35};
char string[100]="";
int counter = 0;
int denom = 0;
int calc = 0;
//pointers
FILE *wrptr, *wptr;
//File manipulation
wptr = fopen("stravo.txt","w+");
wrptr = fopen("newStravo.txt","w");
while(choice != 99)
{
puts("You open the door and find a lot of people jumping around");
puts("You are almost certain that you have found a hidden civilization");
fprintf(wptr, "You open the door and find a lot of people jumping around..\nYou are almost certain that you have found a hidden civilization.\nEvery option you choose has a hidden value related to it..\nChoose wisely to earn enough points to win this game!!\n");
puts("At this point it seems like you have three options");
puts("Every option you choose has a hidden value related to it..");
puts("Choose wisely to earn enough points to win this game!!");
puts("1. Talk to the poeple and figure out why is everyone jumping!!");
puts("2. Walk further down and explore the place");
puts("3. Go back into the door you came from and drown");
scanf("%d",&choice);
if (choice == 1)
{
puts("You talk to one of the elders and find out that a monster has threatened the city and everyone is panicking");
fprintf(wptr, "You talk to one of the elders and find out that a monster has threatened the city and everyone is panicking.\nThe monster is a big red dragon that came upon the city to burn its lands and steal its princess.\n");
counter+=2;
denom ++;
puts("The monster is a big red dragon that came upon the city to burn its lands and steal its princess");
printf("Once again.. You have 3 options.\n1. You can fight with them\n2. You can run away\n3. You can have a random option be chosen for you.\n");
scanf("%d",&choice);
//switch statement
switch(choice)
{
case 1:
{
puts("GREAT!! You chose to fight!");
fprintf(wptr, "GREAT!! You chose to fight!\n");
counter+=3;
denom ++;
puts("1. Meet the princess and tell her not to worry.... You will protect her");
puts("2. Pick up a weapon and go straight to the battlefield.");
scanf("%d",&choice);
if (choice == 1)
{
printf("You meet the princess and promise her that you will protect her\nShe tells you that she would marry you if you save the city.\nYou pick up your sword and fight the dragon.\nThe fight gets intense as the dragon breathes fire everywhere.\nHe flies at you and you swing your sword and cut his neck.\nThe city starts sheering your name!!\nThe princess comes up to you and gives you a kiss\nFinally, you get married with the princess and become the prince of the city\nEveryone lives happily ever after\n\nThank you for playing. GG\n");
fprintf(wptr,"You meet the princess and promise her that you will protect her\nShe tells you that she would marry you if you save the city.\nYou pick up your sword and fight the dragon.\nThe fight gets intense as the dragon breathes fire everywhere.\nHe flies at you and you swing your sword and cut his neck.\nThe city starts sheering your name!!\nThe princess comes up to you and gives you a kiss\nFinally, you get married with the princess and become the prince of the city.\nEveryone lives happily ever after.\n\nThank you for playing. GG..\n");
counter+=4;
denom ++;
}
if (choice == 2)
{
printf("You pick up your weapon and go straight to the battlefield\nThe dragon is breathing fire everywhere! He is killing a lot of people!!\nYou start swinging your sword at the dragon and that gets him angry\nHe flies at you and you find a chance to cut his neck with your sword.\nThe city sheers your name! You are now the hero of the city.\nThe princess comes up to you and gives you a kiss\nEver since then, you became the protector of the city and everyone respects you!\n\nThank you for playing. GG\n");
fprintf(wptr,"You pick up your weapon and go straight to the battlefield..\nThe dragon is breathing fire everywhere! He is killing a lot of people!!\nYou start swinging your sword at the dragon and that gets him angry.\nHe flies at you and you find a chance to cut his neck with your sword.\nThe city sheers your name! You are now the hero of the city.\nThe princess comes up to you and gives you a kiss.\nEver since then, you became the protector of the city and everyone respects you!\n\nThank you for playing. GG..\n");
counter+=3;
denom ++;
}
break;
}
case 2:
{
puts("WOAH! You chose to be a coward! You do not deserve to play anymore.. GG");
fprintf(wptr, "WOAH! You chose to be a coward! You do not deserve to play anymore.. GG\n");
counter--;
denom ++;
break;
}
case 3:
{
//random
choice = rand()%2 + 1;
if (choice == 1)
{
puts("GREAT!! You chose to fight!");
fprintf(wptr, "GREAT!! You chose to fight!\n");
counter+=3;
denom ++;
puts("1. Meet the princess and tell her not to worry.... You will protect her");
puts("2. Pick up a weapon and go straight to the battlefield.");
scanf("%d",&choice);
if (choice == 1)
{
printf("You meet the princess and promise her that you will protect her\nShe tells you that she would marry you if you save the city.\nYou pick up your sword and fight the dragon.\nThe fight gets intense as the dragon breathes fire everywhere.\nHe flies at you and you swing your sword and cut his neck.\nThe city starts sheering your name!!\nThe princess comes up to you and gives you a kiss\nFinally, you get married with the princess and become the prince of the city\nEveryone lives happily ever after\n\nThank you for playing. GG\n");
fprintf(wptr,"You meet the princess and promise her that you will protect her\nShe tells you that she would marry you if you save the city.\nYou pick up your sword and fight the dragon.\nThe fight gets intense as the dragon breathes fire everywhere.\nHe flies at you and you swing your sword and cut his neck.\nThe city starts sheering your name!!\nThe princess comes up to you and gives you a kiss\nFinally, you get married with the princess and become the prince of the city.\nEveryone lives happily ever after\n\nThank you for playing. GG..\n");
counter+=4;
denom ++;
break;
}
if (choice == 2)
{
printf("You pick up your weapon and go straight to the battlefield\nThe dragon is breathing fire everywhere! He is killing a lot of people!!\nYou start swinging your sword at the dragon and that gets him angry\nHe flies at you and you find a chance to cut his neck with your sword.\nThe city sheers your name! You are now the hero of the city.\nThe princess comes up to you and gives you a kiss\nEver since then, you became the protector of the city and everyone respects you!\n\nThank you for playing. GG\n");
fprintf(wptr,"You pick up your weapon and go straight to the battlefield\nThe dragon is breathing fire everywhere! He is killing a lot of people!!\nYou start swinging your sword at the dragon and that gets him angry.\nHe flies at you and you find a chance to cut his neck with your sword.\nThe city sheers your name! You are now the hero of the city.\nThe princess comes up to you and gives you a kiss.\nEver since then, you became the protector of the city and everyone respects you!\n\nThank you for playing. GG..\n");
counter+=3;
denom ++;
break;
}
}
if (choice == 2)
{
puts("WOAH! You chose to be a coward! You do not deserve to play anymore.. GG");
fprintf(wptr, "WOAH! You chose to be a coward! You do not deserve to play anymore.. GG\n");
counter--;
denom ++;
}
break;
}
}
break;
}
else if (choice == 2)
{
puts("You walk further down the street and you get amazed by how beautiful the city is");
puts("However, you notice that people are panicking!!");
puts("It seems like a big scary dragon is coming to attack the city and take the princess away!");
fprintf(wptr, "You walk further down the street and you get amazed by how beautiful the city is.\nHowever, you notice that people are panicking!!\nIt seems like a big scary dragon is coming to attack the city and take the princess away!\n");
counter++;
denom ++;
printf("Once again.. You have 3 options.\n1. You can offer any help\n2. You can pick a number (0-9) that has a hidden value (The value will determine if you win or lose the game) Try your luck?\n3. You can flee the city and never come back.\n");
scanf("%d",&choice);
if (choice == 1)
{
printf("You ask the citizens if they need any help.\nPeople tell you that they need a fearless fighter to get rid of this monster that is threatening their beautiful city \n");
fprintf(wptr, "You ask the citizens if they need any help.\nPeople tell you that they need a fearless fighter to get rid of this monster that is threatening their beautiful city. \n");
counter+=3;
denom ++;
puts("1. Meet the princess and tell her not to worry.... You will protect her");
puts("2. Pick up a weapon and go straight to the battlefield.");
scanf("%d",&choice);
if (choice == 1)
{
printf("You meet the princess and promise her that you will protect her\nShe tells you that she would marry you if you save the city.\nYou pick up your sword and fight the dragon.\nThe fight gets intense as the dragon breathes fire everywhere.\nHe flies at you and you swing your sword and cut his neck.\nThe city starts sheering your name!!\nThe princess comes up to you and gives you a kiss\nFinally, you get married with the princess and become the prince of the city\nEveryone lives happily ever after\n\nThank you for playing. GG\n");
fprintf(wptr,"You meet the princess and promise her that you will protect her\nShe tells you that she would marry you if you save the city.\nYou pick up your sword and fight the dragon.\nThe fight gets intense as the dragon breathes fire everywhere.\nHe flies at you and you swing your sword and cut his neck.\nThe city starts sheering your name!!\nThe princess comes up to you and gives you a kiss\nFinally, you get married with the princess and become the prince of the city.\nEveryone lives happily ever after\n\nThank you for playing. GG..\n");
counter+=4;
denom ++;
}
else if (choice == 2)
{
printf("You pick up your weapon and go straight to the battlefield\nThe dragon is breathing fire everywhere! He is killing a lot of people!!\nYou start swinging your sword at the dragon and that gets him angry\nHe flies at you and you find a chance to cut his neck with your sword.\nThe city sheers your name! You are now the hero of the city.\nThe princess comes up to you and gives you a kiss\nEver since then, you became the protector of the city and everyone respects you!\n\nThank you for playing. GG\n");
fprintf(wptr,"You pick up your weapon and go straight to the battlefield\nThe dragon is breathing fire everywhere! He is killing a lot of people!!\nYou start swinging your sword at the dragon and that gets him angry\nHe flies at you and you find a chance to cut his neck with your sword.\nThe city sheers your name! You are now the hero of the city.\nThe princess comes up to you and gives you a kiss.\nEver since then, you became the protector of the city and everyone respects you!\n\nThank you for playing. GG..\n");
counter+=3;
denom ++;
}
}
else if (choice == 2)
{
puts("You chose to pick a number (0-9)");
puts("I hope you are lucky enough to win. GG");
fprintf(wptr, "You chose to pick a number (0-9)\nI hope you are lucky enough to win. GG\n");
scanf("%d",&y);
//Arrays
counter = value[y];
denom ++;
}
else if (choice == 3)
{
puts("You chose to flee the city.. You are a coward.. GG");
fprintf(wptr, "You chose to flee the city.. You are a coward.. GG..\n");
counter--;
denom ++;
}
break;
}
else if (choice == 3)
{
puts("You opened the door and the water killed you.. GG");
fprintf(wptr, "You opened the door and the water killed you.. GG..\n");
counter++;
denom ++;
break;
}
else
{
puts("Wrong choice!!!");
}
}
calc = averageMk(counter, denom);
printf("Average = %d / %d = %d. \n \n", counter,denom,calc);
ggPromtMk(calc);
printf("\n\nYour whole progress in the story has been saved to a file called (stravo.txt)\nYou can modify this file into a new file called (newStravo.txt)\n\n1. Change the whole story to uppercase letters.\n2. Change the whole story to lowercase letters.\n");
scanf("%d",&x);
//File manipulation
if (x == 1)
{
rewind(wptr);
//while loop
while(fscanf(wptr,"%s",&string) != EOF)
{
//string function
length = strlen(string);
//for loop
for(i=0;i<length;i++)
{
// character function
string[i] = toupper(string[i]);
}
fprintf(wrptr,"%s ",string);
}
}
else if (x == 2)
{
rewind(wptr);
while(fscanf(wptr,"%s",&string) != EOF)
{
length = strlen(string);
for(i=0;i<length;i++)
{
string[i] = tolower(string[i]);
}
fprintf(wrptr,"%s ",string);
}
}
fclose(wptr);
fclose(wrptr);
break;
}
case 2:
{
while(choice != 99)
{
puts("you open the door and find ........ \n");
puts("Watch out, look behind you, A Meeseeks is coming towarsds you.\n");
puts("Hi I'm Mr.Meeseeks look at me, waving hands around.\n");
puts("Ask him for a request and he will complete it and disapear.\n");
puts("What type of request would you want to make?\n");
puts("1st choice is Meeseeks can take you to Blips\n");
puts("2nd choice is you can join Morty and go on an Adventure\n");
puts("3rd choice is go back through the door you came from\n");
scanf("%d",&choice);
if(choice == 1)
{
puts("Hi I'm Mr Meeseeks look at me.\n");
printf("Okay %s are you ready to go to Blips?\n", name);
puts("First you need Flurbos.\n");
flurbos();
return 0;
}
if(choice == 2)
{
printf("Hey %s its Morty, hurry get in, Rick isn't watching, let go on a adventure\n",name);
stars();
puts("I will let you choose what plannet we go to \n");
planets();
break;
}
if(choice == 3)
{
puts("You selected to exit.\n");
goodBye();
return 0;
}
else
{
puts("Incorrect input, please selecte from the following choices, 1, 2, or 3.\n");
}
}
break;
}
case 3:
{
while(choice != 99)
{
puts("You open the door and find a mysterious man saying: \n'Wendy, darling, Light of my Life! I'm not gonna hurt ya \n");
puts("He looks at you menancingly and starts to run to you with a knife, there are multiple doors behind you and the door you came from.\n ");
puts("QUICK! which door do you pick?");
puts("you may quit anytime by selecting option:99");
scanf("%d",&choice);
if(choice==1)
{
int DieArr[1]={0};
int q,f=0,c=0;
double l=0.00;
printf("your average is %f \n", l);
puts("You stumble into a room, and a skeleton behind a counter and holds a 6 sided die");
puts("He asks you with a hollow voice, Hi would you like to roll the dice? you cannot leave the room without rolling 6 times.");
puts("Depending on ur average you will get a prize or punishment");
puts("[1] for Yes or [2] for No");
scanf("%d",&x);
if(x == 1)
{
for (i=0;i<6;i++)
{
q=RollArray(DieArr);
f=f+q;
Prt(DieArr);
}
l=f/(float)6; //average
printf("your average is %lf \n", l);
if (l<3)
{
puts("you will fall into the abyss once you exit this room");
choice=99;
}
else if (l<4)
{
puts("I have looked at your name");
nV(name);
}
else if (l<5)
{
puts("Good job");
}
else if (l<6)
{
puts("you will now exit the room");
break;
}
}
else
{
puts("Alright good bye");
}
puts("You turn around and go back outside");
puts("ONCE AGAIN");
}
if(choice==2)
{
char pic[42];
FILE *wptr;
wptr = fopen("squirrel.txt","w");
FILE *rptr;
rptr = fopen("pic.txt","r");
puts("Enjoy a picture of a Camel");
while(!feof(rptr))
{
if(rptr)
{
fscanf(rptr,"%s",pic);
printf("%s \n",pic);
fprintf(wptr,"%s \n",pic);
}
}
fclose(wptr);
fclose(rptr);
puts("You turn around and go back outside");
puts("ONCE AGAIN");
}
if (choice==3)
{
int holes[3];
for (i=0;i<3;i++)
{
holes[i]=0;
}
puts("you are suddenly teleported outside and there you see an angled plank with 3 holes and 3 bags beside it\n");
puts("a voice above asked if you want to play bean bag toss");
puts("[1] for Yes or [2] for No");
scanf("%d",&x);
if (x==1)
{
puts("The voice above says: 'for you to win, you must put at least 2 bags into 2 of the 3 holes'");
BBGprnt();
TossBag(holes);
BagTossed(holes);
puts("now wasnt that fun?");
puts("you can come back here whenever you want\n");
}
else
{
puts("Alright good bye");
}
puts("You turn around and go back outside");
puts("ONCE AGAIN");
}
}
break;
}
case 4:
{
while(choice != 99)
{
puts("You open the door and find yourself completely alone in a bright room. \n");
puts("You look around but there is nobody in sight nor a single sound..... \n");
puts("Suddenly, you are greeted by an angelic voice from above! \n ");
puts("'Welcome! My child. You've lived a decent life but now it's all behind you because you are in \n' ");
puts(" 'AFTERLIFE' ");
puts("------------------------------------------------------------------------------------------------");
puts("Now, I know you've got a lot of question to ask but I am not here to answer it for you! \n");
puts("My goal simply here is to take a last look at some major points in your life, and see, if there are any changes you would like to made so, your life would pan out to be different. \n");
printf("So, tell me %s, would you like to change the life you've lived starting now? \n", name);
printf("Type '1' for YES or '2' for NO.");
scanf("%d",&choice);
switch(choice)
{
case 1:
a = mainC();
if (a==1)
{
int i=0;
char b[100],c[4];
printf("When you were age 15, you were introduced to this game called \n");
scanf("%s",b);
printf("After that, it was all downhil. You put countless hours grinding %s, trying to be the best in a video game, whereas your social skills and studies all took a massive dip \n",b);
puts("Trapping yourself inside 4 walls, you forgot how beautiful life could be and instead continue to deteriorate your mental and physical health. \n");
puts("Now, believe it or not, you have the power right here to change that. By typing 'STOP' multiple times in different lines, you have the ability to send brain signals to your 15 year self to totally lose interest in the game. Go ahead and type the said letter if you want to continue. \n");
scanf("%s",c);
puts("------------------------------------------>");
if (strcmp(c, "STOP") == 0 || strcmp(c, "stop") == 0)
{
while (i <= 1)
{
scanf("%s",c);
puts("------------------->");
i++;
}
printf("Congratulations %s !! You've successfully negated your gaming addicition. \n",name);
puts("This has resulted you in being more extroverted, with more friends,and more happy. \n");
puts("Do other to complete the game \n");
}
else
{
printf("Unfortunately, you've failed to stop your old self!! Hopefully, you make a better choice next time. \n");
}
}
else if(a==2)
{
float arrt[5], e;
char x[100];
char *want = x;
puts("This path guides you through the time where you stil had high hopes about yourself and was full of determination that you were ging to do something with your life \n");
printf("You always wanted to be a ");
scanf("%s", x);
printf("but with family issues and financial problems, ended up taking the majors that you didn't enjoyed nor indulged yourself into doing anything interesting \n ");
puts("But today we are changing it! If you successfully answer both of the answer below, you will be able to believe that you always had that firepower and will push for the things you like. \n");
puts("1. If you successfully calculate the average of the number, you will be able to move onto the next step. \n" );
fill(arrt);
printer(arrt);
}
else if(a==3)
{
int choice1, choice2;
h = crush();
printf("Your crush: 'Hi %s! You look really great today. How was your day?'\n",name);
puts("Choose [1] or [2]");
scanf("%d", &choice1);
puts("1. It was really good actually. I started the day by going to the gym, had a family brunch at noon, worked on some projects with my friends, and here I am! So, tell me how was your day?\n");
puts("2. Forget about the day. Tell me, how are you so pretty? I kept thinking about you all the time. How you smell, how your skin feels, how do you sleep, waht do you eat!!! You complete me. Without you, I wouldn't even lvive in this planet \n");
puts("Choose [1] or [2]\n");
scanf("%d", &choice1);
if(choice1==1)
{
puts("Great choice! Your choice shows that you have a great connectio with your family, takes good of yourself, have a good social circle and knows how to treat other people.\n");
puts("\nAfter a while, your crush notices you, wearing one of her favourite music artist shirt. You guys talk about it, for a while after which she requests if she can show her song playlists. \n");
puts("Take [1] to accept and [2] to decline \n");
scanf("%d", &choice2);
if(choice2==1)
{
int choice = 0, year, n;
char sname[30],str[100],name[30];
char str1;
FILE *rptr;
rptr = fopen("arpitinput.txt","r");
if ((rptr = fopen("arpitinput.txt", "a")) == NULL)
{
puts("Couldn't open the file");
}
puts("\nYou really liked her playlist and decides to even add few of youe own favourite songs to her playlists, if she agree. \n");
printf(" Input the number of songs you want to add: ");
scanf("%d", &n);
printf(" The songs are: \n");
for(i = 0;i < n+1;i++)
{
fgets(str, sizeof str, stdin);
fputs(str, rptr);
}
fclose(rptr);
rptr = fopen ("arpitinput.txt", "r");
printf("\n The content of the file is :\n");
str1 = fgetc(rptr);
while (str1 != EOF)
{
printf ("%c", str1);
str1 = fgetc(rptr);
}
fclose (rptr);
puts("\nTalking about music works as a really good ice-breaker and the rest of the date goes smoothly. \n");
puts("Congratuations, you have completed the game and ended your journey here :)");
}
}
}
else
{
puts("Your refusal completely ruined the vibe and the atmosphere around the table. It gets really awkward and your date decides to leave. \n");
}
case 2:
puts("I hope you had a good time trying out this game!! \n" );
break;
default:
puts("Invalid Input. Enter only 1 or 2. \n");
}
return 0;
}
break;
}
case 5:
{
while(choice != 99)
{
puts("you open the door slowly, you hear a click in the distance:");
puts("Do you close the door or open it fast? Type 1 for open and 2 for close.");
scanf("%d",&choice);
switch(choice)
{
case 1:
{
puts("you get hit with an arrow in the knee!");
break;
}
case 2:
{
puts("you hear an arrow hit the door");
break;
}
}
}
break;
}
case 6:
{
while(choice != 99)
{
FILE *wptrTalise;
wptrTalise = fopen(argv[2], "w");
int totalGuesses = 0;
int wrongGuesses = 0;
int *totalPtr = &totalGuesses;
int *wrongPtr = &wrongGuesses;
char alphabet[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'z', 'y', 'z', '\0'};
int codedMessage[10] = {8, 5, 12, 12, 15, 23, 15, 18, 12, 4};
char message[] = "Hello World";
puts("You open the door and walk inside the room.");
puts("The door locks, and the only way out is to decode a message.");
printMessage(codedMessage);
decodeMessage(alphabet, codedMessage, totalPtr, wrongPtr);
fprintf(wptrTalise, "Total Guesses: %d \nWrong Guesses: %d \nDecoded Message: %s \n", totalGuesses, wrongGuesses, message);
x = (rand() % (3 + 1 - 1) + 1);
userFate(x);
for(i = 0; name[i] != '\0'; i++)
{
name[i] = toupper(name[i]);
}
printf("That's all, %s \n", name);
fclose(wptrTalise);
printf("Enter 1-40 to go to another room or 99 to quit. \n");
scanf("%d", &choice);
}
break;
}
case 7:
{
while(choice != 99)
{
char ladder;
int rollDie, door1;
float numbers[50], average, sum = 0.0;
rollDie = rand()%9;
puts("\nYou open the door and all the water drains");
puts("In front of you are five doors");
puts(" ----- ----- ----- ----- ----- ");
puts("| | | | | | | | | | ");
puts("| 1 | | 2 | | 3 | | 4 | | 5 | ");
puts("| | | | | | | | | | ");
puts(" ----- ----- ----- ----- ----- ");
puts("Which door will you choose? (99 will exit the program)");
scanf("%d", &choice);
switch(choice)
{
case 1:
{
puts("\nYou picked the first door");
puts("You look and see a small figure in the distance");
puts("As you walk closer you see that it's a skeleton running straight towards you!");
puts("There is another door to your right and written on the door says: ");
puts("In order to move escape the skeleton you need to add up 5 numbers averaging at least 10");
printf("\nEnter 5 numbers\n");
for(i = 0; i < 5; i++)
{
printf("Number %d : ",i+1);
scanf("%f", &numbers[i]);
sum += numbers[i];
}
average = sum / 5;
printf("Your average is = %.2f \n", average);
if(average < 10)
{
printf("\n\nPlease try again \n");
printf("Retutning to the main menu\n\n");
break;
}
else if (average > 10)
{
printf("\n\nCongrats! You escaped the skeleton!\n");
printf("Returning to the main menu\n\n");
break;
}
case 2:
{
puts("\nYou enter door number 2 and find a man rolling dice");
puts("You approach the man");
puts("The man says to you, if you roll the correct number I will give you this gold ingot but if you lose then you'll be stuck down here forever");
printf("\nWould you like to roll? [1] = yes, [2] = no\n");
scanf("%d", &choice);
if(choice == 1)
{
puts("\nThe man says to pick a number 1 - 10");
printf("Enter a number: ");
printf("%d", rollDie);//Random number appears to test the correct guess
scanf("%d", &choice);
if(choice == rollDie)
{
puts("Congrats you won the gold ingot!");
mbchoice();
break;
}
else
{
puts("You lose");
puts("Returning back to the main menu");
break;
}
}
else if(choice == 2)
{
printf("\nYou choose 2\n");
mbchoice();
break;
break;
}
}
case 3:
{
char welp[200];
FILE *mbrptr;
mbrptr = fopen("mwrongdoor.txt", "r");
printf("WRONG DOOR YOU CHOOSE WRONG \n");
while(!feof(mbrptr))
{
if(mbrptr)
{
fscanf(mbrptr, "%s",welp);
printf("%s \n", welp);
}
}
fclose(mbrptr);
printf("Returning to the Main Menu \n");
break;
}
case 4:
{
puts("\nYou have chosen the 4th door, this door leads you to riches");
puts("Walking down the hallway you see a paper on the ground");
puts("You pick up the paper and on it says PASSWORD: Lakers");
puts("You continue on and make a sharp left down the hallway and find yourself staring at a sophisticated keypad");
mbchoice2();
break;
}
case 5:
{
puts("This door will test your ability to count");
puts("Enter a word and after will ask you how many letters are in the word");
char mbstr[100];
int i = 0;
int count = 0;