diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..1992e5c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "unistd.h": "c" + } +} \ No newline at end of file diff --git a/README.md b/README.md index 6bb7b8c..2561a05 100644 --- a/README.md +++ b/README.md @@ -1 +1,17 @@ # Typing-Test-C + +Typing Test Written in C Programming Language + +Tests User WPM in a variety of different modes. + +Timed Mode: 5, 10, 15, 30, and 60s + +Word Mode: 10, 25, 50, and 100 Words + +Focuses on User's Typing Style and Provides Insights +Similar to my Typing-Teacher project, however this is more focused on analyzing user data, rather than UI. + +Objectives: +* Clean Code +* Memory Management +* Learning C \ No newline at end of file diff --git a/a.out b/a.out new file mode 100755 index 0000000..33ff985 Binary files /dev/null and b/a.out differ diff --git a/run b/run new file mode 100755 index 0000000..69378a8 --- /dev/null +++ b/run @@ -0,0 +1,2 @@ +gcc typing_test.c +./a.out diff --git a/typing_test.c b/typing_test.c new file mode 100644 index 0000000..789e491 --- /dev/null +++ b/typing_test.c @@ -0,0 +1,30 @@ +#include +#include +#include +#include +#include + +struct winsize w; + +int draw_ui() { + system("clear"); + printf ("lines %d\n", w.ws_row); + printf ("columns %d\n", w.ws_col); +} + +int print_center_text(char str[], int width) { + int i, x = strlen(str); + + width - x; + width /= 2; /* Padding Area */ + + for (i = 0; i < width; i++) { + + } +} + +int main (int argc, char **argv) { + ioctl(STDOUT_FILENO, TIOCGWINSZ, &w); + draw_ui(); + return 0; +} \ No newline at end of file diff --git a/typing_test.h b/typing_test.h new file mode 100644 index 0000000..9c55062 --- /dev/null +++ b/typing_test.h @@ -0,0 +1 @@ +#define NAME "Typing Test" \ No newline at end of file