Nimbin[12]?Web & Tools / typing_10_fingers / commits / a4ee86e

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

Fix: make use of whole char length instead of fixed

Christian Immanuel · 2024-03-16 08:54 · a4ee86e2d29a45d059485a4efd724af4d2b9f152

 inout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/inout.c b/inout.c
index c2c0b03..c7d71b5 100644
--- a/inout.c
+++ b/inout.c
@@ -27,7 +27,7 @@ void getLine(wchar_t* line, wchar_t* chars, int length, int wc){
             word_length = rand() % 6 + 4;
             continue;
         }
-        int ran = rand() % 4 + 0;
+        int ran = rand() % (wcslen(chars));
         line[i] = chars[ran];
     }
     line[i] = L'\0';