Click here to Skip to main content
15,914,642 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRoll the dice Pin
---Mark---15-Aug-04 9:24
---Mark---15-Aug-04 9:24 
GeneralRe: Roll the dice Pin
Ravi Bhavnani15-Aug-04 10:17
professionalRavi Bhavnani15-Aug-04 10:17 
GeneralRe: Roll the dice Pin
---Mark---15-Aug-04 21:11
---Mark---15-Aug-04 21:11 
GeneralRe: Roll the dice Pin
Mike Beckerleg15-Aug-04 23:04
Mike Beckerleg15-Aug-04 23:04 
GeneralRe: Roll the dice Pin
mahade115-Aug-04 23:21
mahade115-Aug-04 23:21 
GeneralRe: Roll the dice Pin
---Mark---16-Aug-04 13:28
---Mark---16-Aug-04 13:28 
GeneralRe: Roll the dice Pin
mahade116-Aug-04 18:52
mahade116-Aug-04 18:52 
GeneralRe: Roll the dice Pin
Henry miller16-Aug-04 3:33
Henry miller16-Aug-04 3:33 
Basicly what the other two guys said, except you might want a do/while loop and not a standard while loop. Look it up, the do while will always give you one roll before asking if you want to roll again.

I recomend "the art of computer programing" by Donald Knuth http://www-cs-faculty.stanford.edu/~knuth/taocp.html which describes random numbers in far more detail than you ever thought possible. These are unfortuntly advanced books, completing one should be considered equivelant to a PHD! Still you should be aware of them, and (if you can afford them) have them on the bookshelf.

What I want you to get from these books: random numbers have been the most popular subject in advanced computer science since before there was comptuer science. I estimate that 1/3rd of all PHDs in computer science studied random numbers (and there is still pleny of room for more study) Your simple program is not complete until you understand something about random numbers.

In particular, the most common implimentation of rand() will ALWAYS give a odd-even-odd-even sequence! This is not something you want I'm going to guess. Issues like this are what seperate simple programs like yours (that look just fine) from complex programs done by an expert. You can never know it all, but I've just given you an area to look.
GeneralGiving command line arguments to VS 2003. Pin
blackmesa15-Aug-04 8:44
blackmesa15-Aug-04 8:44 
GeneralRe: Giving command line arguments to VS 2003. Pin
Ryan Binns15-Aug-04 18:22
Ryan Binns15-Aug-04 18:22 
GeneralRe: Giving command line arguments to VS 2003. Pin
blackmesa15-Aug-04 21:02
blackmesa15-Aug-04 21:02 
GeneralWindows VirtualDesktop Pin
ianmknight15-Aug-04 8:41
ianmknight15-Aug-04 8:41 
QuestionCan Any one Help me out Pin
Neelesh K J Jain15-Aug-04 6:35
Neelesh K J Jain15-Aug-04 6:35 
AnswerRe: Can Any one Help me out Pin
Ravi Bhavnani15-Aug-04 6:49
professionalRavi Bhavnani15-Aug-04 6:49 
GeneralNeed help fast... Pin
Larsson15-Aug-04 3:55
Larsson15-Aug-04 3:55 
GeneralRe: Need help fast... Pin
Ravi Bhavnani15-Aug-04 4:21
professionalRavi Bhavnani15-Aug-04 4:21 
GeneralRe: Need help fast... Pin
Larsson15-Aug-04 4:44
Larsson15-Aug-04 4:44 
GeneralRe: Need help fast... Pin
Ravi Bhavnani15-Aug-04 4:47
professionalRavi Bhavnani15-Aug-04 4:47 
GeneralRe: Need help fast... Pin
Larsson15-Aug-04 6:26
Larsson15-Aug-04 6:26 
GeneralRe: Need help fast... Pin
Ravi Bhavnani15-Aug-04 6:29
professionalRavi Bhavnani15-Aug-04 6:29 
GeneralRe: Need help fast... Pin
Larsson15-Aug-04 6:33
Larsson15-Aug-04 6:33 
GeneralRe: Need help fast... Pin
Ravi Bhavnani15-Aug-04 6:37
professionalRavi Bhavnani15-Aug-04 6:37 
GeneralRe: Need help fast... Pin
Larsson15-Aug-04 6:40
Larsson15-Aug-04 6:40 
GeneralRe: Need help fast... Pin
Ravi Bhavnani15-Aug-04 6:44
professionalRavi Bhavnani15-Aug-04 6:44 
GeneralRe: Need help fast... Pin
Larsson15-Aug-04 6:46
Larsson15-Aug-04 6:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.