Add makefile
This commit is contained in:
+1
-31
@@ -4,6 +4,7 @@
|
||||
#include <string.h>
|
||||
#include <ncurses.h>
|
||||
#include "typing_test.h"
|
||||
#include "utilities.h"
|
||||
|
||||
/* Prints Centered Text To Console Screen */
|
||||
void print_centered_text(WINDOW *win, int row, char str[]) {
|
||||
@@ -43,37 +44,6 @@ void print_centered_text_menu(WINDOW *win, int row, int target, char str[][MAX_S
|
||||
}
|
||||
}
|
||||
|
||||
/* This will go through the word_array structure and find the requested
|
||||
amount of words */
|
||||
int generate_words(int num_words, Word_array *words, char *to_return) {
|
||||
int i, k, number_words_in_txt;
|
||||
|
||||
to_return = malloc(num_words * 64); /* Each word will be less than 64 chars */
|
||||
|
||||
for (i = 0; i < words->number_of_words; i++) {
|
||||
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/* This will dynamically allocate memory to a 2d char array of all the words
|
||||
in words.txt */
|
||||
int parse_words_file(FILE *words_file, Word_array *words) {
|
||||
int i, number_of_words;
|
||||
char buf[256];
|
||||
|
||||
/* Counts number of lines in words file (Each line contains a unique word) */
|
||||
while (fgets(buf, sizeof(buf), words) != NULL) {
|
||||
number_of_words++;
|
||||
}
|
||||
|
||||
printf("Number of words: %d\n", number_of_words);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
void typing_ui(WINDOW *win, int level, int mode, FILE *word_file) {
|
||||
int run = 1, ch, i, words, win_x = win->_maxx;
|
||||
char str[1024];
|
||||
|
||||
Reference in New Issue
Block a user