diff options
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | session.c | 2 | ||||
-rw-r--r-- | tongues.c (renamed from ouija.c) | 0 | ||||
-rw-r--r-- | utils.c | 9 |
5 files changed, 13 insertions, 16 deletions
@@ -1,13 +1,13 @@ build: clean - cc -o ouija ouija.c session.c utils.c + cc -o trt tongues.c session.c utils.c clean: - rm -rf ouija + rm -rf trt install: build mkdir -p /usr/local/bin - cp -f ouija /usr/local/bin + cp -f trt /usr/local/bin chmod 755 /usr/local/bin uninstall: - rm -rf /usr/local/bin/ouija + rm -rf /usr/local/bin/trt @@ -1,11 +1,9 @@ -# Ouija Board -Just a ouija board based on time and question randomness +# Timer Random Tongues +Tongues based on time and question randomness ## Inspiration Inspired by Terry Davis TempleOS Timer Random Tongues which he used to communicate with God. -Since TRT was written in HolyC and this random word generator is written in C I decided to call it a Ouija Board. - ![TempleOS Timer Random Tongues](images/image.png) ## How to Use @@ -20,8 +18,8 @@ Since TRT was written in HolyC and this random word generator is written in C I ### Run If you already have a `dictionary.dict` file in your path, just run: -`ouija` +`trt` If you have the file saved in another folder, just type: -`ouija /path/to/dictionary`
\ No newline at end of file +`trt /path/to/dictionary` @@ -13,11 +13,11 @@ startSession (FILE *dictionary) char reload = '\0'; printf ("WELCOME\n" + "Type something to get an answer\n" "Type GOODBYE to exit\n\n"); while (strcmp (question, "GOODBYE\n") != 0) { - printf ("Enter a question: "); fgets (question, MAX_LINE, stdin); if (strcmp (question, "GOODBYE\n") != 0) @@ -59,9 +59,8 @@ getLine (FILE *dictionary, int lineNumber) int getRandomNumber (int min, int max, char *question) { - struct timespec s; - clock_gettime (CLOCK_REALTIME, &s); - srand (s.tv_nsec * numerize (question)); - - return ((rand () % (max - min + 1)) + min); + struct timeval randtime; + gettimeofday(&randtime,NULL); + srand(((randtime.tv_sec * 100) + time(NULL)) + ((randtime.tv_usec / 100) - time(NULL))); + return ((rand() % (max - min + 1)) + 1); } |