Greed Game Problem - Hang Up In The Middle of a Function

Hello everyone,

I'm having a bit of trouble with my code following through with the rest of a particular function. I've done some printf tests throughout and am finding that it doesn't seem to be doing anything after the user presses enter to continue on with the game.

I know my code is long and not very efficient, but I only need to be able to present a functional program this time around and not focus on function separation and whatnot. I believe it's hung up in the diceRoll function. Any insight would be greatly appreciated

PS - I worked in the Java environment about a year ago and haven't touched on it at all since, and am starting in C without ever having programmed in it before. I know that Java derives from C, but there's quite a bit of difference from what I can see. It wouldn't surprise me if it was something entirely mundane that I was forgetting.

*EDIT* Okay, so I've found that by using "getch()" instead of "getchar()", it will wait for the user to press enter before continuing on. I've also found out that I haven't been having it properly checking through ALL the dice in all of the logicals by using "for(i = 0; i < 5 (instead of 6); i++), so I fixed that, but now it outputs the 6 dice values, but then won't continue on from there. It's like it's not calling any of the called functions I list below the printing of the dice values. Any idea what I might be doing wrong here? Thank you!!

*EDIT* Alright, so I did some additional tests: after putting "printf("test");" at the top of each function in the list that I call in the list, only 3 "test" prints come out. So, to me, it is indicating that it is making it through six1(), straight(), and threePair() (or maybe threePair() is where it gets hung up and doesn't want to continue - I'm not really sure). Sorry, for posting so much on my own, I just want to show that I'm trying to do individual troubleshooting and perhaps can give you a better idea of how to help me. Thanks again!

*EDIT* Sorry, I forgot about post editing... So I've gotten a 4th "test" to show up, and it was because of an error in my logic in threePair(). I'm going to update my code with what I've got current.

*EDIT* Okay... so I finally get the program to run all the way through. It was all issues with my for-statements and the else-if statements that were running when going through the array of "defines". Now the only problem seems to be that the math is all wrong. It seems to be adding an additional 1000 or so onto the correct total.

I spotted some bug in there at a glance and they are ones that the compiler should pick up for you as warnings (e.g. line 691). Turn your compiler's warning level up to the max and pay attention to the warnings it then generates.

My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger

Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"