Click here to Skip to main content
16,006,749 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question30-Team League Pin
compmaniac25-Jan-07 9:58
compmaniac25-Jan-07 9:58 
AnswerRe: 30-Team League Pin
Mark Salsbery25-Jan-07 10:39
Mark Salsbery25-Jan-07 10:39 
GeneralRe: 30-Team League Pin
compmaniac25-Jan-07 10:47
compmaniac25-Jan-07 10:47 
GeneralRe: 30-Team League Pin
Mark Salsbery25-Jan-07 10:56
Mark Salsbery25-Jan-07 10:56 
GeneralRe: 30-Team League Pin
compmaniac25-Jan-07 11:04
compmaniac25-Jan-07 11:04 
GeneralRe: 30-Team League Pin
Mark Salsbery25-Jan-07 11:14
Mark Salsbery25-Jan-07 11:14 
GeneralRe: 30-Team League Pin
compmaniac25-Jan-07 11:16
compmaniac25-Jan-07 11:16 
GeneralRe: 30-Team League Pin
Mark Salsbery25-Jan-07 11:19
Mark Salsbery25-Jan-07 11:19 
Here's what I got from the link. This code will get stuck in the while loop.
What have you changed to make this work?
for(int c = 0; c < amountofGames[a][b]; c++)
{
   randomMonth = 200;
   randomDay = 200;
   while(randomMonth == 200 || randomDay == 200 || 
                teamOpponents[a][randomMonth][randomDay] != 100 ||
                teamOpponents[b][randomMonth][randomDay] != 100)
   {
      randomMonth = rand()%6;
      randomDay = rand()%31;
   } 
                 
   // Store Dates in Array            
                     
   teamOpponents[a][randomMonth][randomDay] = b;
   teamOpponents[b][randomMonth][randomDay] = a;
                
   random = rand()%2;
                
   if (random == 0)
   {
      home[a][randomMonth][randomDay] = 1;
      home[b][randomMonth][randomDay] = 0;
   }else
   {
      home[a][randomMonth][randomDay] = 0;
      home[b][randomMonth][randomDay] = 1; 
   }
 
   // End Store Dates in Array
}

GeneralRe: 30-Team League Pin
compmaniac25-Jan-07 11:26
compmaniac25-Jan-07 11:26 
GeneralRe: 30-Team League Pin
Mark Salsbery25-Jan-07 11:37
Mark Salsbery25-Jan-07 11:37 
GeneralRe: 30-Team League [modified] Pin
compmaniac25-Jan-07 11:43
compmaniac25-Jan-07 11:43 
GeneralRe: 30-Team League Pin
Mark Salsbery25-Jan-07 11:50
Mark Salsbery25-Jan-07 11:50 
GeneralRe: 30-Team League Pin
compmaniac25-Jan-07 11:53
compmaniac25-Jan-07 11:53 
GeneralRe: 30-Team League Pin
Mark Salsbery25-Jan-07 12:04
Mark Salsbery25-Jan-07 12:04 
GeneralRe: 30-Team League Pin
compmaniac25-Jan-07 12:07
compmaniac25-Jan-07 12:07 
GeneralRe: 30-Team League Pin
Mark Salsbery25-Jan-07 12:22
Mark Salsbery25-Jan-07 12:22 
GeneralRe: 30-Team League Pin
Mark Salsbery25-Jan-07 12:32
Mark Salsbery25-Jan-07 12:32 
GeneralRe: 30-Team League Pin
compmaniac25-Jan-07 12:48
compmaniac25-Jan-07 12:48 
GeneralRe: 30-Team League Pin
Mark Salsbery25-Jan-07 13:18
Mark Salsbery25-Jan-07 13:18 
GeneralRe: 30-Team League [modified] Pin
compmaniac25-Jan-07 13:26
compmaniac25-Jan-07 13:26 
QuestionRe: 30-Team League Pin
David Crow26-Jan-07 3:18
David Crow26-Jan-07 3:18 
AnswerRe: 30-Team League Pin
compmaniac26-Jan-07 12:12
compmaniac26-Jan-07 12:12 
QuestionAccelerator Pin
JennK25-Jan-07 9:52
JennK25-Jan-07 9:52 
AnswerRe: Accelerator Pin
Blake Miller25-Jan-07 11:19
Blake Miller25-Jan-07 11:19 
GeneralRe: Accelerator Pin
JennK25-Jan-07 22:20
JennK25-Jan-07 22:20 

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.