summaryrefslogtreecommitdiff
path: root/ouija.c
blob: 74b66ffee381e1ab3f2b86b70dcc1cb2336ab7ac (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
#include "session.h"
#include <stdio.h>
#include <stdlib.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]) == 1)
		{
			dictionary = fopen(argv[1], "r");
		}
	}

	if (dictionary != NULL)
	{
		startSession(dictionary);
		fclose(dictionary);
	}

	return 0;
}