Created
May 18, 2022 02:10
-
-
Save corlaez/51d3a067730134a44f02f18a41b06e42 to your computer and use it in GitHub Desktop.
Self Study Flashcard CLI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val chapter1 = mapOf( | |
"2 + 2" to "4", | |
"0 + 2" to "2", | |
) | |
val chapters = chapter1// + chapter2 + chapter3 | |
fun main() { | |
while (true) { | |
val shuffledQuestions = chapters.keys.shuffled() | |
shuffledQuestions.forEach { question -> | |
println("Question: $question") | |
readln() | |
val answer = chapters[question] | |
println("Answer: $answer") | |
} | |
println("Congrats, you answered all questions. Shuffling questions again!") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment