From 9ecc8091fc6bebb46833441ccfc6de5cca8cc4dd Mon Sep 17 00:00:00 2001 From: UndeadMaelys Date: Sun, 30 May 2021 10:05:44 +0200 Subject: [PATCH] fixed bug --- kanji_learner.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kanji_learner.lua b/kanji_learner.lua index 6f25459..f78d67d 100644 --- a/kanji_learner.lua +++ b/kanji_learner.lua @@ -15,6 +15,8 @@ end function GetUnrepeatedReadingON(lAvoid) lKanji = KanjiData[math.random(#KanjiData)] + if #lKanji.On == 0 then GetUnrepeatedKanji(lAvoid) end + for j=1, #lKanji.On do for i=1, #lAvoid do if lKanji.On[j] == lAvoid[i] then @@ -29,7 +31,7 @@ end function GetUnrepeatedReadingKUN(lAvoid) lKanji = KanjiData[math.random(#KanjiData)] - if lKanji.Kun == nil then GetUnrepeatedKanji(lAvoid) end + if #lKanji.Kun == 0 then GetUnrepeatedKanji(lAvoid) end for j=1, #lKanji.Kun do for i=1, #lAvoid do @@ -218,7 +220,7 @@ while 1 do os.execute("clear") ShowProgress() - Ask() + Ask(math.random(2)+2) response = io.read() Check(response)