summaryrefslogtreecommitdiff
path: root/ouija.c
diff options
context:
space:
mode:
authorrafa_99 <rafa99@protonmail.com>2020-11-22 13:59:43 +0000
committerrafa_99 <rafa99@protonmail.com>2020-11-22 13:59:43 +0000
commit596b63a8700e2953ce81b65f46a5b3015d45d904 (patch)
tree69914e1beaad9e15ce6dbd2ce2ce470c30b02504 /ouija.c
parent41b6afe198856399aaaa35a51ad9becda6d9e8e0 (diff)
Updated Some Bad Written Code
Diffstat (limited to 'ouija.c')
-rw-r--r--ouija.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/ouija.c b/ouija.c
index 123a705..74b66ff 100644
--- a/ouija.c
+++ b/ouija.c
@@ -1,31 +1,30 @@
-#include "logic.h"
-#include <stdlib.h>
+#include "session.h"
#include <stdio.h>
-#include <string.h>
+#include <stdlib.h>
int main(int argc, char **argv)
{
- char *dictionary = (char *)calloc(MAX_LINE, sizeof(char));
+ FILE *dictionary = NULL;
switch (argc)
{
case 1:
if (checkIfFileExists("dictionary.dict") == 0)
{
- strcpy(dictionary, "dictionary.dict");
+ dictionary = fopen("dictionary.dict", "r");
}
break;
case 2:
if (checkIfFileExists(argv[1]) == 1)
{
- strcpy(dictionary, argv[1]);
+ dictionary = fopen(argv[1], "r");
}
}
if (dictionary != NULL)
{
- char *string = getLine(dictionary, getRandomNumber(1, lineCounter(dictionary)));
- free(dictionary);
+ startSession(dictionary);
+ fclose(dictionary);
}
return 0;