Skip to content

Commit

Permalink
Merge branch 'potstruct'
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeastwood committed Aug 3, 2011
2 parents 359e633 + 8ecc39b commit b60ed6b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pot.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,17 @@ typedef struct {

//constructor for our pot struct.
void resetPot(potStruct * pot) {
int i;

pot->finBrew=0;
pot->cupWaiting=FALSE;
pot->additionsAdded=FALSE;
pot->addUnitsPerSec=0;
pot->startPour=0;
strcpy(pot->waitingAdditions, "");

for(i=0;i < 20; i++) {
strcpy(pot->waitingAdditions[i], "");
}
}

int getState(potStruct * pot) {
Expand Down Expand Up @@ -87,8 +92,9 @@ int main() {
resetPot(&pot);

pot.cupWaiting=TRUE;
pot.finBrew=time(NULL)-5;
pot.addUnitsPerSec=10;
pot.finBrew=time(NULL)-50;
pot.addUnitsPerSec=45;
pot.startPour=time(NULL);
result=getState(&pot);

printf("Result: %d\n", result);
Expand Down

0 comments on commit b60ed6b

Please sign in to comment.