I developed the program below with help from another thread.
Now, I only want the program to calculate the likelihood of a team winning the first game in THREE game series...AFTER another three game series.
In other words...I want the program to scan through the results and detect all instances of two back-to-back 3-game series, and calculate results ONLY for those events.
Please let me know if any further clarification is needed.
prevTeam = "N/A";
char *Date, *Team, *Score, *Line, *overUnder;
int first = 1,
second = 0,
test = 0,
column = 0,
count = 0,
wins = 0,
losses = 0,
winAfterSeries = 0,
lossAfterSeries = 0;
fp = fopen("c:\\odds.txt", "r");
if(fp != NULL)
while(fgets(str, sizeof(str), fp) != NULL)
Date = strtok(str, ",");
Team = strtok(NULL, ",");
Score = strtok(NULL, ",");
Line = strtok(NULL, ",");
overUnder = strtok(NULL, ",");
if(strcmp(Team, prevTeam) == 0)
count++; //team is the same as prev line
if(*Score == 'W')
count = 0;
printf(" First game of series won %d\n", winAfterSeries);
printf(" First game of series lost %d\n", lossAfterSeries);
scanf("Waiting %d", second);