|
|
@ -6,7 +6,9 @@ |
|
|
|
|
|
|
|
char* getWelcomeMessageSSP(); |
|
|
|
int selectCOMChoice(); |
|
|
|
void printResult(int, int); |
|
|
|
void printResult(int, int, int); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void schereSteinPapier() |
|
|
|
{ |
|
|
@ -27,7 +29,7 @@ void schereSteinPapier() |
|
|
|
{ |
|
|
|
comChoice = selectCOMChoice(); |
|
|
|
int winNum = calculateWinner(userChoice, comChoice); |
|
|
|
printResult(winNum, comChoice); |
|
|
|
printResult(winNum, comChoice, userChoice); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@ -85,13 +87,13 @@ int selectCOMChoice() |
|
|
|
|
|
|
|
char* getWelcomeMessageSSP() |
|
|
|
{ |
|
|
|
return "\nHallo und Willkommen zu Schere-Stein-Papier!\n\nIn diesem Spiel spielst du gegen einen COM Schere-Stein-Papier!\n" |
|
|
|
return "\nHallo und Willkommen zu Schere-Stein-Papier\n\n" |
|
|
|
"In diesem Spiel spielst du gegen einen COM Schere-Stein-Papier!\n" |
|
|
|
"Waehle, sobald dich die Konsole dazu auffordert, deine 'Waffe' aus, indem du die entsprechende Zahl eintippst.\n" |
|
|
|
"Gibst du bei der Aufforderung 0 ein, gelangst du zurueck ins Hauptmenue!\n\n"; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void printResult(int winNumb, int comSelect) |
|
|
|
void printResult(int winNumb, int comSelect, int userSelect) |
|
|
|
{ |
|
|
|
char comWeapon[10]; |
|
|
|
switch(comSelect) |
|
|
@ -109,6 +111,118 @@ void printResult(int winNumb, int comSelect) |
|
|
|
strcpy(comWeapon, "Not found"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if(userSelect == 1) |
|
|
|
{ |
|
|
|
switch (comSelect) |
|
|
|
{ |
|
|
|
case(1): |
|
|
|
printf(" _______ _______\n" |
|
|
|
"---' ____)____ ____(____ '---\n" |
|
|
|
" ______) (______\n" |
|
|
|
" __________) (__________\n" |
|
|
|
" (____) (____)\n" |
|
|
|
"---.__(___) (___)__.---\n" |
|
|
|
" Scissor vs Scissor\n"); |
|
|
|
break; |
|
|
|
case(2): |
|
|
|
printf(" _______ _______\n" |
|
|
|
"---' ____)____ (____ '---\n" |
|
|
|
" ______) (_____)\n" |
|
|
|
" __________) (_____)\n" |
|
|
|
" (____) (____)\n" |
|
|
|
"---.__(___) (___)__.---\n" |
|
|
|
" Scissor vs Rock\n"); |
|
|
|
break; |
|
|
|
case(3): |
|
|
|
printf(" _______ _______\n" |
|
|
|
"---' ____)____ ____(____ '----\n" |
|
|
|
" ______) (______\n" |
|
|
|
" __________) (_______\n" |
|
|
|
" (____) (_______\n" |
|
|
|
"---.__(___) (_________.---\n" |
|
|
|
" Scissor vs Paper\n"); |
|
|
|
break; |
|
|
|
default: |
|
|
|
printf("ungültige Eingabe\n"); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
else if(userSelect ==2) |
|
|
|
{ |
|
|
|
switch (comSelect) |
|
|
|
{ |
|
|
|
case(1): |
|
|
|
printf(" _______ _______\n" |
|
|
|
"---' ____) ____(____ '---\n" |
|
|
|
" (_____) (______\n" |
|
|
|
" (_____) (__________\n" |
|
|
|
" (____) (____)\n" |
|
|
|
"---.__(___) (___)__.---\n" |
|
|
|
" Rock VS Scissor\n"); |
|
|
|
break; |
|
|
|
case(2): |
|
|
|
printf(" _______ _______\n" |
|
|
|
"---' ____) (____ '---\n" |
|
|
|
" (_____) (_____)\n" |
|
|
|
" (_____) (_____)\n" |
|
|
|
" (____) (____)\n" |
|
|
|
"---.__(___) (___)__.---\n" |
|
|
|
" Rock VS Rock\n"); |
|
|
|
break; |
|
|
|
case(3): |
|
|
|
printf(" _______ _______\n" |
|
|
|
"---' ____) ____(____ '----\n" |
|
|
|
" (_____) (______\n" |
|
|
|
" (_____) (_______\n" |
|
|
|
" (____) (_______\n" |
|
|
|
"---.__(___) (_________.---\n" |
|
|
|
" Rock VS Paper\n"); |
|
|
|
break; |
|
|
|
default: |
|
|
|
printf("ungültige Eingabe\n"); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
else if(userSelect ==3) |
|
|
|
{ |
|
|
|
switch (comSelect) |
|
|
|
{ |
|
|
|
case(1): |
|
|
|
printf(" _______ _______\n" |
|
|
|
"---' ____)____ ____(____ '---\n" |
|
|
|
" ______) (______\n" |
|
|
|
" _______) (__________\n" |
|
|
|
" _______) (____)\n" |
|
|
|
"---.__________) (___)__.---\n" |
|
|
|
" Paper VS Scissor\n"); |
|
|
|
break; |
|
|
|
case(2): |
|
|
|
printf(" _______ _______\n" |
|
|
|
"---' ____)____ (____ '---\n" |
|
|
|
" ______) (_____)\n" |
|
|
|
" _______) (_____)\n" |
|
|
|
" _______) (____)\n" |
|
|
|
"---.__________) (___)__.---\n" |
|
|
|
" Paper VS Rock\n"); |
|
|
|
break; |
|
|
|
case(3): |
|
|
|
printf(" _______ _______\n" |
|
|
|
"---' ____)____ ____(____ '----\n" |
|
|
|
" ______) (______\n" |
|
|
|
" _______) (_______\n" |
|
|
|
" _______) (_______\n" |
|
|
|
"---.__________) (_________.---\n" |
|
|
|
" Paper VS Paper\n"); |
|
|
|
break; |
|
|
|
default: |
|
|
|
printf("ungültige Eingabe\n"); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
printf("ungültige Eingabe"); |
|
|
|
} |
|
|
|
switch (winNumb) |
|
|
|
{ |
|
|
|
case(-1):printf("Der Computer hat %s gewaehlt, Du hast verloren!!!\n\n", comWeapon); |
|
|
|