//Ablauf
int main() {
char wahlSpiel;
int wahlMenu=0;
char oberbegriff[20];
char wort[20];
char wortPruefen[20];
int zufallszahl;
int counterVersuche=0;
char anzeigen[10];
int i;
char taste;
int counterEnthalten=0;
int kopf=0;
int kopf1=0;
int arm1=0;
int arm2=0;
int oberkoerper=0;
int bein1=0;
int bein2=0;
int fuss1=0;
int fuss2=0;
int buchstabenEnthalten=0;
while (wahlMenu==0) {
Startmenu(&wahlSpiel);
switch(wahlSpiel) {
case 'N': zufallszahl = NewGameTeil1();
wahlMenu = 1;
break;
case 'A': Anleitung();
wahlMenu = 0;
break;
case 'B': ExitGame(&wahlMenu);
wahlMenu = 1;
break;
}
}
switch(zufallszahl)
{
case 1: strcpy(wort, "JAPAN");
buchstabenEnthalten = 5;
strcpy(oberbegriff, "Land");
break;
case 2: strcpy(wort, "MEXICO");
buchstabenEnthalten = 6;
strcpy(oberbegriff, "Land");
break;
case 3: strcpy(wort, "PERU");
buchstabenEnthalten = 4;
strcpy(oberbegriff, "Land");
break;
case 4: strcpy(wort, "MAZEDONIEN");
buchstabenEnthalten = 10;
strcpy(oberbegriff, "Land");
break;
case 5: strcpy(wort, "UNGARN");
buchstabenEnthalten = 6;
strcpy(oberbegriff, "Land");
break;
case 6: strcpy(wort, "LETTLAND");
counterEnthalten = 8;
strcpy(oberbegriff, "Land");
break;
case 7: strcpy(wort, "NIEDERLAND");
buchstabenEnthalten = 10;
strcpy(oberbegriff, "Land");
break;
case 8: strcpy(wort, "INDIEN");
buchstabenEnthalten = 6;
strcpy(oberbegriff, "Land");
break;
case 9: strcpy(wort, "KENIA");
buchstabenEnthalten = 5;
strcpy(oberbegriff, "Land");
break;
case 10: strcpy(wort, "ARMENIEN");
buchstabenEnthalten = 8;
strcpy(oberbegriff, "Land");
break;
}
while (counterEnthalten < buchstabenEnthalten && counterVersuche < 7) {
printf("\tTIPP: %s", oberbegriff);
printf("\n\t oooooooooo");
printf("\n\t o o");
printf("\n\t o o");
printf("\n\t o %c%c%c", kopf, kopf, kopf);
printf("\n\t o %c %c", kopf, kopf);
printf("\n\t o %c %c %c %c", kopf, kopf, kopf, kopf);
printf("\n\t o %c %c %c", kopf, kopf, kopf);
printf("\n\t o %c %c%c%c %c", kopf, kopf1, kopf1, kopf1, kopf);
printf("\n\t o %c %c", kopf, kopf);
printf("\n\t o %c%c%c", kopf, kopf, kopf);
printf("\n\t o %c %c %c", arm1, oberkoerper, arm2);
printf("\n\t o %c %c %c", arm1, oberkoerper, arm2);
printf("\n\t o %c%c%c", arm1, oberkoerper, arm2);
printf("\n\t o %c", oberkoerper);
printf("\n\t o %c", oberkoerper);
printf("\n\t o %c%c%c", bein1, oberkoerper, bein2);
printf("\n\t o %c %c", bein1, bein2);
printf("\n\t o %c %c", bein1, bein2);
printf("\n\t o %c %c", bein1, bein2);
printf("\n\t o %c%c%c%c %c%c%c%c", fuss1, fuss1, fuss1, fuss1, fuss2, fuss2, fuss2, fuss2);
printf("\n\t o");
printf("\n\toooooooooo");
printf("\n\tWaehlen Sie bitte einen Buchstaben: ");
scanf("%s", &taste);
fflush(stdin);
//prüfen ob vorhanden, an welcher, Stelle, und einstellen ob es angezeigt werden soll
for(i=0; i<strlen(wort); i++)
{
if(wort[i] == taste)
anzeigen[i]=1;
}
//Ausgabe
for(i=0; i<strlen(wort); i++)
{
if(anzeigen[i] == 1) {
printf("Wort: %c", wort[i]);
counterEnthalten++;
}
else
printf("_");
}
if (counterEnthalten==0) {
switch(counterVersuche) {
case 0: kopf=111;
kopf1=95;
break;
case 1: oberkoerper=111;
break;
case 2: arm1=111;
break;
case 3: arm2=111;
break;
case 4: bein1=111;
break;
case 5: bein2=111;
break;
case 6: fuss1=111;
break;
case 7: fuss2=111;
break;
}
}