CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #3
    Join Date
    Feb 2006
    Location
    Croatia - Zagreb
    Posts
    459

    Re: dice game of pig

    It's because you didn't specify what will happen after "1" is rolled.
    You just carry on with the loop.
    Try putting break or something in the if keyword when "1" is rolled.

    Oh and BTW if you want different values every time you run a program, use:
    srand(time(0)); this will randomize the rand() seed, based on the timer.
    rand(); is made to get the same values everytime because it's easier to debug.
    Last edited by Odiee; October 29th, 2008 at 03:33 AM.
    You just divided by zero, didn't you?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured