/* Phast Phind Phone list v 1.1 */ /* The world's fastest phone number finder */ /* My second ever useful program that ACTUALLY WORKS! */ #include #include #define NAMESIZE 40 #define LISTLENGTH 85 char first[LISTLENGTH][NAMESIZE] = {"allan", "alan", "alex", "amy", "angela", "avril", "barbara", "barry", "belasis", "bke", "bob", "bob", "bracknell", "carl", "carol", "civils", "conference", "conference", "dave", "dave", "dave", "dave", "dave", "dave", "dawn", "dean", "denis", "derek", "emma", "engineering", "fax", "fax", "fax", "fax", "fax", "fax", "fax", "gary", "graham", "helen", "hugh", "i.t.", "i.t.", "iain", "irene", "jaron", "john", "julie", "kath", "kitchen", "lesley", "lyn", "margot", "mark", "martin", "martin", "matt", "mike", "mike", "nick", "paul", "paul", "personnel", "peter", "peter", "peter", "peter", "phil", "richard", "richard", "ritchie", "roger", "rose", "russell", "shell", "steve", "steve", "stuart", "sue", "tank", "teresa", "w&g", "w&g", "white", "white"}; char sur[LISTLENGTH][NAMESIZE] = {"kennah", "tysoe", "sheldon", "burns", "kelly", "delamere", "percival", "thomas (Garage)", "office", "office", "garner", "taylor", "office", "hudson", "myler", "building", "room mes office", "room terrapin", "brown", "kellock", "parry", "sykes", "wilson", "ashcroft", "lowe", "sheldon", "cullen", "ashworth", "baker", "building", "accounts", "barbara", "dawn", "kath", "lesley", "proposals", "stores", "mckevitt", "arner", "carter", "mcfaddon", "helpdesk", "helpdesk", "mcbride", "hornbuckle", "whalley", "davies", "davies", "campbell", "kitchen", "elliott", "williams", "lightfoot", "o'neill", "archer", "knox", "hill", "alexander", "hardman", "davies", "coles", "kelly", "belasis", "davies", "forrester", "wade", "hyland", "campion", "security", "smith", "nuttall", "rickett", "bethell", "jones", "building", "rodger", "skinner", "mccormick", "richardson (wages)", "serv ", "george", "wainwright", "wainwright", "lion court", "lion court"}; char phone[LISTLENGTH][NAMESIZE] = {"2317 (private)", "2419", "2329", "2309", "2316", "(#6 200)", " (#6 229)", "(#6 144)", "(#6 141)", "(#6 112)", "2321", "2341", "(#6 157)", "2314", "(#6 227)", "private", "2304", "2328", "2339", "2349", "(#6 225)", "2427", "2345", "2300", "2319", "2346", "2305", "private", "(#6 223)", "(FAX) private", "private", "private", "private", "private", "private", "private", "private", "private", "2401", "2202", "private", "Fax. private", "private (#6 126)", "2321", "private", "2318", "2429", "private (#6 221)", "2325", "2331", "2409", "private (#6 226)", "2316", "private(#6 228)", "2400", "2320", "2313", "2334", "2323", "(#6 222)", "2336", "private", "2307/2308", "2407", "2332 (private)", "2423", "private", "2405 (private)", "2337", "2418 (private)", "2353", "private", "2302", "2351 (private)", "(#6 109)", "2335", "2348 (private)", "2322 (private)", "(#6 135)", "(FAX) private", "2352", "private (#6 101)", "(fax) private", "private (#6 156)", "(fax) private"}; char both[LISTLENGTH][NAMESIZE] = {"allan kennah", "alan tysoe", "alex sheldon", "amy burns", "angela kelly", "avril delamere", "barbara percival", "barry thomas (Garage)", "belasis office", "bke office", "bob garner", "bob taylor", "bracknell office", "carl hudson", "carol myler", "civils building", "conference room mes office", "conference room terrapin", "dave brown", "dave kellock", "dave parry", "dave sykes", "dave wilson", "dave ashcroft", "dawn lowe", "dean sheldon", "denis cullen", "derek ashworth", "emma baker", "engineering building", "fax accounts", "fax barbara", "fax dawn", "fax kath", "fax lesley", "fax proposals", "fax stores", "gary mckevitt", "graham arner", "helen carter", "hugh mcfaddon", "i.t. helpdesk", "i.t. helpdesk", "iain mcbride", "irene hornbuckle", "jaron whalley", "john davies", "julie davies", "kath campbell", "kitchen kitchen", "lesley elliott", "lyn williams", "margot lightfoot", "mark o'neill", "martin archer", "martin knox", "matt hill", "mike alexander", "mike hardman", "nick davies", "paul coles", "paul kelly", "personnel belasis", "peter davies", "peter forrester", "peter wade", "peter hyland", "phil campion", "richard security", "richard smith", "ritchie nuttall", "roger rickett", "rose bethell", "russell jones", "shell building", "steve rodger", "steve skinner", "stuart mccormick", "sue richardson (wages)", "tank serv ", "teresa george", "w&g wainwright", "w&g wainwright", "white lion court", "white lion court"}; char find(void); main() { char again; printf("PhastPhind 1.1 The world's fastest phone number finder.\n"); printf("By Alex Sheldon, 2005\n\n"); do again = find(); while(again != 'q'); /* Go again, unless "q" for quit is pressed */ } /* find() finds all the relevant phone numbers */ char find(void) { char name[NAMESIZE]; /* the name you are looking for */ static char tempname[NAMESIZE]; /* a temp name, this is what you are checking against */ int namelength; /* length of the name you typed in */ int x,y, match = 0; char again; /* Go again? flag. */ printf("Enter the name (or part of it) :"); gets(name); printf("\n"); namelength = strlen(name); for(x=0;x