summaryrefslogtreecommitdiff
path: root/ouija.c
blob: aab31c55295e0cb51ca4b9e81d7e4c6f82f4479e (plain)
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
#include <stdio.h>
#include <stdlib.h>
#include "session.h"

int main(int argc, char **argv)
{

	FILE *dictionary = NULL;

	switch (argc)
	{
		case 1:
			if (checkIfFileExists("dictionary.dict") == 0)
			{
				dictionary = fopen("dictionary.dict", "r");
			}
			break;
		case 2:
			if (checkIfFileExists(argv[1]) == 0)
			{
				dictionary = fopen(argv[1], "r");
			}
	}

	if (dictionary != NULL)
	{
		startSession(dictionary);
		fclose(dictionary);
	}
	else
	{
		printf("No Dictionary Found\n");
	}

	return 0;
}