Hello!
I'm trying to make a bulls function! On average I would like it to hit the Bull 70% of the time and the other 30% (miss) between 1 to 20. As you can see I have the basic code, but I'm just learning so don't really understand what each part does.
Thanks in advance! :-)Code:int Bull() { int percent = rand()%100; //lower percent is more throws needed int r = rand()%100; //lower r is less throws needed if(r<percent) // hit return 50; else // miss return 1 + rand()%20; }