Commit one
This commit is contained in:
parent
68718da5e1
commit
a62192e5f4
5
.vscode/settings.json
vendored
Normal file
5
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"files.associations": {
|
||||||
|
"unistd.h": "c"
|
||||||
|
}
|
||||||
|
}
|
16
README.md
16
README.md
@ -1 +1,17 @@
|
|||||||
# Typing-Test-C
|
# 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
|
30
typing_test.c
Normal file
30
typing_test.c
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
1
typing_test.h
Normal file
1
typing_test.h
Normal file
@ -0,0 +1 @@
|
|||||||
|
#define NAME "Typing Test"
|
Loading…
x
Reference in New Issue
Block a user