summaryrefslogtreecommitdiff
path: root/utils.h
blob: 5ccabe3921a5c2dfc0a2a2c8d715b2f0cc026173 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>

#define MAX_LINE 256

/* Checks if a file exists */
int checkIfFileExists (char *path);
/* Turns a string into a number by
 * using the sum of its ascii values.
 */
int numerize (char *string);
/* Counts the lines from a dictionary file */
int lineCounter (FILE *dictionary);
/* Returns a specified line from a dictionary file */
char *getLine (FILE *dictionary, int line);
/* Returns a random number within the inclusive number range
 * and based on the inputted question.
 * Uses a fast seeded number generator.
 */
int getRandomNumber (int min, int max, char *question);