Skip to content

Instantly share code, notes, and snippets.

@riza
Created December 9, 2017 18:20
Show Gist options
  • Save riza/c5fdd8b7ded0b682034a04220edf30b4 to your computer and use it in GitHub Desktop.
Save riza/c5fdd8b7ded0b682034a04220edf30b4 to your computer and use it in GitHub Desktop.
for irem adsfdsgf
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
int dice() {
return ((rand() % 6) + 1);
}
int main()
{
int aim = 2;
int attemp = 1;
int a,b;
for(;;) {
srand(time(NULL));
a = dice();
b = dice();
if (a == b && a == aim) {
printf("Zarlar %d - %d\n",a,b);
if (attemp == 1) {
attemp = 2;
aim = 4;
} else if (attemp == 2) {
attemp = 3;
aim = 6;
} else if (attemp == 3){
printf("Bitti :D \n");
break;
}
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment