Nimbin[12]?Web & Tools / typing_10_fingers / commits / 3ebebd5

typing_10_fingers git · main

10 finger typing trainer (CMake)

typing terminal c cmake · first commit 2024-02-26 · last commit 2024-03-16 (2 years ago) · synced 3 days ago · upstream: git.ide3.de/chfis005/typing_10_fingers

C 97.4% Markdown 2.6%
git clone https://git.christianimmanuel.de/web-tools/typing_10_fingers.gitwget https://git.christianimmanuel.de/web-tools/typing_10_fingers/archive/typing_10_fingers.tar.gz

some comments

Clostosus · 2024-02-27 13:43 · 3ebebd595023029b3688c0576d2261f0e43f5d39

 inout.c | 2 +-
 inout.h | 2 ++
 main.c  | 6 +++---
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/inout.c b/inout.c
index 50d0ee3..c2c0b03 100644
--- a/inout.c
+++ b/inout.c
@@ -2,7 +2,7 @@
 
 void printAt(int x, int y, wchar_t c, int color){
     //printf("%c\033[0m", c);
-    if (color == RED) {
+    if (color == RED){
         wprintf(L"\033[%d;%dH\033[48;5;124m%lc\033[0m", y, x, c);
     } else {
         wprintf(L"\033[%d;%dH\033[48;5;28m%lc\033[0m", y, x, c);
diff --git a/inout.h b/inout.h
index c17f12b..22768a4 100644
--- a/inout.h
+++ b/inout.h
@@ -8,6 +8,7 @@
 #include <time.h>
 #include <locale.h>
 
+//detect Windows OS
 #ifdef WIN64
 #define WINDOWS
 #else
@@ -16,6 +17,7 @@
 #endif
 #endif
 
+//OS specific library
 #ifdef WINDOWS
 #include <windows.h>
 #else
diff --git a/main.c b/main.c
index d08d05e..0f3af21 100644
--- a/main.c
+++ b/main.c
@@ -1,6 +1,6 @@
 #include "inout.h"//other libraries are there and depend on OS
 
-void sysClear() {
+void sysClear() {//clear the console screen
 #ifdef WINDOWS
     system("cls");
 #else
@@ -74,8 +74,8 @@ int main(){
 
         getLine(lines, lvl_arr, chars_max, w.ws_col);
 
-        wprintf(L"\033[1;1H%ls", lines);
-        wprintf(L"\033[1;1H");
+        wprintf(L"\033[1;1H%ls", lines);//move cursor and print new line
+        wprintf(L"\033[1;1H");//move cursor to top left
 
         mistakes = runLevel(lines, chars_max, position);
         if (mistakes == 0)