It allows you to run dice as often as you want, the problem is that after u roll dice and try to go back to the main menu it does
Enter command:
Enter h for help:
Enter command:
It allows you to run dice as often as you want, the problem is that after u roll dice and try to go back to the main menu it does
Enter command:
Enter h for help:
Enter command:
What main menu?
You have a main function, which repeatedly calls commandmain() until it returns non zero. When it gets a non zero, it exits.
In commandmain() you set commain to zero, all of the options return zero except quit which returns -1.
Each of the options are effectively the same, you roll some dice and it gives you a value you have rolled.
As I have said, twice now, and posted a picture of it, the program does just that, you can run the options until you enter quit, when it quits. Where is this main menu? Post a picture of it "not working", frankly I don't see what your problem is.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
What I think 'noobie' is trying to say is, yes, it works in that you can keep rolling the dice until you type 'quit', but instead of just saying
it says:Code:Enter a command:dice Enter a number of 6-sided dice to roll:36 You rolled for a total of 114! Enter a command:
with the extraneous 'Enter help...Enter a command'. Noobie - I believe the problem is due to the fact that you call the function 'commandmain' in the 'while' condition, then you call it again as part of the while loop - as noted by orbitz. You may want to modify the 'while' condition.Code:Enter a command:dice Enter a number of 6-sided dice to roll:36 You rolled for a total of 114! Enter a command: Enter help for assistance: Enter a command:
If that is what he means, he has an odd way of phrasing his questions! He said it doesn't work after rolling the dice once, but it does. Now he is talking about a main menu, there isn't one!
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.