### guessing game with points.

hi guys, need help. im having a problem on how to add or subtract the points from point of risk.
example output.
how many points would you like?200
guesses choice..
(switch case)
how many guesses would you like?2
enter choice:o
enter number:3
point at risk? 10
winning number is:
you lost/gain points:
here's my code so far:
 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231`` ``````#include #include #include #include main() { srand(time(NULL)); int guess,r,guesses; int points=0,n; printf("How many points would you like? "); scanf("%d",&points); char choice; int array[5],i; printf("\nGuesses Choices \n"); printf("O-Odd \t\t[01-35]\nE-Even\t\t[02-36] \nL-Low \t\t[01-12] \nM-Medium \t[13-24] \nH-High \t\t[25-36] \nN-Number\t[01-36]\n"); printf("\nGuess Limit is 5"); printf("\nHow many guesses would you like? "); scanf(" %d",&guesses); for(i=0;ib){ an=b; printf("Winning number is : %d",an); b1=r; printf("\nYou lost %d point(s).\n",b1); } if(guess==b) { an=b; printf("Winning number is : %d",an); b2=r+r; printf("\nYou gain %d point(s)\n",b2);} } int even(int guess,int r) { int c =2+(2*rand ()) %36,an2,c1,c2; printf("enter number: "); scanf("%d",&guess); printf("Point at risk? "); scanf("%d",&r); if(guessc){ an2=c; printf("Winning number is : %d",an2); c1=r; printf("\nYou lost %d point(s).\n",c1); } if(guess==c) { c2=r+r; printf("You gain %d point(s)",c2);} } int low(int guess,int r) { int l=rand() % 12+1,l2,l3,ans1; printf("enter number: "); scanf("%d",&guess); printf("Point at risk? "); scanf("%d",&r); if(guessl){ ans1=l; printf("Winning number is : %d",ans1); l2=r; printf("\nYou lost %d point(s).\n",l2); } if(guess==l) { l3=r+r; printf("You gain %d point(s) \n",l3);} } int medium(int guess,int r) { int m=rand() % 12+13,m2,m3,ans2; printf("enter number: "); scanf("%d",&guess); printf("Point at risk? "); scanf("%d",&r); if(guessm){ ans2=m; printf("Winning number is : %d",ans2); m2=r; printf("\nYou lost %d point(s).\n",m2); } if(guess==m) { m3=r+r; printf("You gain %d point(s)\n",m3);} } int high(int guess,int r) { int h=rand() % 12+25,h2,h3,ans3; printf("enter number: "); scanf("%d",&guess); printf("Point at risk? "); scanf("%d",&r); if(guessh){ ans3=h; printf("Winning number is : %d",ans3); h2=r; printf("\nYou lost %d point(s).\n",h2); } if(guess==h) { h3=r+r; printf("You gain %d point(s) \n",h3);} } int number(int guess,int r) { int number = rand() % 36,ans,p,t; printf("enter number: "); scanf("%d",&guess); printf("Point at risk? "); scanf("%d",&r); if(guessnumber){ ans=number; printf("Winning number is : %d",ans); p=r; printf("\nYou lost %d point(s).\n",p); } if(guess==number) { t=r+r; printf("You gain %d point(s) \n",t);} } ``````
Topic archived. No new replies allowed.