32 lines
477 B
C
32 lines
477 B
C
#ifndef main_h
|
|
#define main_h
|
|
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
|
|
int getRandomNumber(int limiter)
|
|
{
|
|
return rand() % limiter;
|
|
}
|
|
|
|
int askForRepeat()
|
|
{
|
|
char nochmal;
|
|
printf("Willst du nochmal spielen?\n");
|
|
scanf("%c", &nochmal);
|
|
if (nochmal == 'j')
|
|
{
|
|
return 1;
|
|
}
|
|
else if (nochmal == 'n')
|
|
{
|
|
return 0;
|
|
}
|
|
else
|
|
{
|
|
printf("Input konnte nicht gelesen werden\n");
|
|
return askForRepeat();
|
|
}
|
|
}
|
|
|
|
#endif |