So right now I have two big problems. I am trying to create a slot machine. There are 4 images I can have. Obviously if all 3 images are the same, I win, if they aren't I lose. For my bool return function, I have:
And for my Image return function, I have:
Image out_image(Point pt, int w, int h, int symbol)
{
Image img = out_image(pt, w, h, symbol);
return (img);
}
I'm not sure if either of these are right, but what confuses me is what to write in "instint_main()". I have the math correct, but I can't seem to get a "winning" output when all 3 reels are equal, I'm guessing my bool statements are wrong. And also, for each random number (this is my last function):
int rand_pic(int min, int max)
{
int random_number = rand()%(max-min+1)+min;
return (random_number);
}
i do something like this in instinct_main() (not sure if correct though):
int reel1 = rand_pic(0,3);
int reel2 = rand_pic(0,3);
int reel3 = rand_pic(0,3);
and this goes right before the bool statement. the range is 0-3 because I have a total of 4 images, and each number (chosen randomly per reel) corresponds to that certain image, and I have NO clue whatsoever how to code that. ive tried everything, it just does not work. Please help, please!