-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNAMES.BAK
More file actions
87 lines (74 loc) · 2.31 KB
/
Copy pathNAMES.BAK
File metadata and controls
87 lines (74 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include <dos.h>
#include <io.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
char *girls [] =
{
"Aneta", "Anna", "Bridget", "Cathy", "Catherine", "Charlotte",
"Denise", "Kate", "Katie", "Kay", "Louise", "Natasha",
"Sarah", "Harriet", "Vicky", "Emma", "Paula", "Sophie", "Margaret",
"Jenny", "Debbie", "Sue", "Launa", "Zoe", "Nicola", "Alexa", "Sally", "ZZ"
} ; int no_girls ;
char *boys [] =
{
"Andrew", "Mark", "John", "Scott", "Leon", "Philip", "Richard",
"Barry", "James", "Jamie", "Matthew", "Paul", "Jason", "Lars",
"Kirk", "Stephen", "David", "Thomas", "Ralph", "Fred", "Lawrence",
"Arnold", "Edward", "Adrian", "Robert", "Hugh", "Ben", "Peter", "ZZ"
} ; int no_boys ;
char *surnames [] =
{
"Hetfield", "Newsted", "Hammet", "Ulrich", "Morris", "Johnson",
"Smith", "Guest", "Hamilton", "Arnold", "Brooke", "Price", "Ward",
"Hume", "Burton", "Banks", "Shirley", "Roper", "Taylor", "Tyler",
"Collins", "Samson", "Green", "Harris", "West", "Barker", "Baker",
"Black", "Major", "Roberts", "Hancock", "Malin", "Rose", "Davidson",
"Hammond", "Thompson", "Fowler", "Jackson", "Franklin", "Murphy",
"Goodman", "Burch", "Scott", "Whitaker", "Walker", "Hughes",
"Burnstein", "Wright", "McDonald", "Pierce", "Fox", "Anderson",
"Vasey", "Marshall", "Howard", "Russell", "ZZ"
} ; int no_surnames ;
main ()
{
FILE * fp1, * fp2 ;
char szFile [80] ;
char szIn [80] ;
char szOut [80] ;
char szName1 [80], szName2 [80] ;
int i ;
i = 0 ;
while (strcmp (girls [i ++], "ZZ") != 0) ;
no_girls = i - 1 ;
i = 0 ;
while (strcmp (boys [i ++], "ZZ") != 0) ;
no_boys = i - 1 ;
i = 0 ;
while (strcmp (surnames [i ++], "ZZ") != 0) ;
no_surnames = i - 1 ;
printf ("Name Scrambler\n\n") ;
gets (szFile) ;
fp1 = fopen (szFile, "r") ;
if (fp1 == NULL)
printf ("Error 1\n") ;
fp2 = fopen ("outp", "w+") ;
if (fp2 == NULL)
printf ("Error 2\n") ;
randomize () ;
while (fgets (szIn, 80, fp1) != NULL)
{
i = 0 ;
while (szIn [i] != ';') i ++ ;
if (random (2) == 0) // GIRL
strcpy (szName1, girls [random (no_girls)]) ;
else // BOY
strcpy (szName1, boys [random (no_boys)]) ;
strcpy (szName2, surnames [random (no_surnames)]) ;
printf ("%s %s%s\n", szName1, szName2, &szIn [i]) ;
fprintf (fp2, "%s %s%s", szName1, szName2, &szIn [i]) ;
}
fclose (fp1) ;
fclose (fp2) ;
return (0) ;
}