10 char* absorb_words (int count
, char** string_list
, int start_index
)
12 char* result
= calloc(sizeof(char), (count
* 20));
13 for (int i
= start_index
; i
< count
; i
++)
14 strcat(result
, string_list
[i
]);
19 char* __upcase (char* original
)
21 char* result
= calloc(sizeof(char), strlen(original
));
23 while (original
[index
])
25 result
[index
] = toupper(original
[index
]);
32 char* strip_nonalpha (char* original
)
34 int length
= strlen(original
);
35 char* result
= calloc(sizeof(char), length
);
38 for (int i
= 0; i
< length
; i
++)
40 if (isalpha(original
[i
]))
42 result
[count
] = original
[i
];
50 char* strip_dupes (char* original
)
52 int length
= strlen(original
);
53 char* upcased
= __upcase(original
);
54 char* result
= calloc(sizeof(char), 26); // 26 unique characters in
55 // the english alphabet
57 for (int i
= 0; i
< length
; i
++)
59 if (!strchr(result
, (int) upcased
[i
]))
61 result
[count
] = upcased
[i
];
70 char* string_process (char* string
)
72 char* filtered
= strip_nonalpha(string
);
73 char* result
= strip_dupes(filtered
);