ruby · level 1 check
a three-question quiz.
Time to build a real game! Your quiz asks three questions, one after another. It checks each answer, keeps score, and tells the player how they did at the end.
The questions and answers live in two arrays, side by side. The method `ask` shows one question, waits for an answer with `gets`, and hands back `true` if it is right. A `times` loop uses `i` as an index to grab each question and its matching answer.
Be kind to your player: `PARIS`, `paris` and `Paris` with extra spaces should all count as right. Fill in each `____`, run it, then play your own quiz.
Fill in every ____ then run the checks.
- 1 It asks every questionuses: loops
- 2 It accepts any capitalsuses: text tricks
- 3 It ignores extra spacesuses: text tricks
- 4 It counts the score correctly when some answers are wronguses: variables
- 5 It shows the right answer after a missuses: interpolation
- 6 It cheers a perfect scoreuses: decisions
Take as long as you like and try as many times as you want.
ruby · level 1 · easy
level up.
You passed every check. Your face is now :D, and Level 2 gets you B).
- 28 lessons in this level
- 6 of 6 checks passed
This pass isn’t saved. A free account keeps your new face.