Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

fish.c

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 #include "fish.h"
00013 
00016 fish_t freezer[MAX_FISH];
00017 
00020 void FillFreezer()
00021 {
00022     freezer[0].myType = fishType_none;
00023     freezer[0].myWeight = 0;
00024     freezer[1].myType = fishType_trout;
00025     freezer[1].myWeight = 1;
00026     freezer[2].myType = fishType_carp;
00027     freezer[2].myWeight = 2;
00028     freezer[3].myType = fishType_salmon;
00029     freezer[3].myWeight = 3;
00030 }
00031 
00038 int Weigh(fishTypes inType)
00039 {
00040     int i, result;
00041     for (i = 0; i < MAX_FISH; i++)
00042     {
00043         if (freezer[i].myType = inType)
00044         {
00045             result = result + freezer[i].myWeight;
00046         }
00047     }
00048     
00049     return result;
00050 }
00051 
00058 int WeighEm(fishTypes inType)
00059 {
00060     int i, result;
00061     for (i = 0; i <= MAX_FISH; i++)
00062     {
00063         if (freezer[i].myType = inType)
00064         {
00065             result = result + freezer[i].myWeight;
00066         }
00067     }
00068     
00069     return result;
00070 }

Generated on Wed Apr 28 17:08:09 2004 for Fish by doxygen 1.3.4