Category : Recently Uploaded Files
Archive   : HEADZIP.EXE
Filename : TESTANCS.CPP

 
Output of file : TESTANCS.CPP contained in archive : HEADZIP.EXE
//----------------------------------------------------------------------
// testancs.cpp
// This is a test driver for the recursive Ancs function
//----------------------------------------------------------------------
#include

enum Relative {
NanBlack, BobHowe, TimHowe, BenJones,
IraJones, AnnJones, JoeJones, MiaJones,
SamJones, BevOlson, JimSmith, MelSmith,
KaySmith, SueSmith, AdaWhite, Unknown
};

Relative mother[] = {
Unknown, TimHowe, Unknown, Unknown, SamJones,
SamJones, BenJones, SamJones, BenJones, Unknown,
MelSmith, Unknown, JimSmith, JimSmith, Unknown
};

Relative father[] = {
Unknown, KaySmith, Unknown, Unknown, SueSmith,
SueSmith, AdaWhite, SueSmith, AdaWhite, Unknown,
BevOlson, Unknown, NanBlack, NanBlack, Unknown
};

int Ancs( Relative );

int main()
{
cout << "No. ancestors of Ann Jones: " << Ancs(AnnJones) << '\n';
cout << "No. ancestors of Jim Smith: " << Ancs(JimSmith) << '\n';
return 0;
}

//----------------------------------------------------------------------
int Ancs( /* in */ Relative thisOne )
//..................................................................
// PRE: Assigned(thisOne)
// POST: FCTVAL == count of known ancestors of thisOne
// NOTE: The person thisOne is included in the count
//..................................................................

{
if (thisOne == Unknown)
return 0;
else
return Ancs(mother[thisOne]) + Ancs(father[thisOne]) + 1;
}


  3 Responses to “Category : Recently Uploaded Files
Archive   : HEADZIP.EXE
Filename : TESTANCS.CPP

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/