A Ruby Script
- Clone this repository at: https://github.com/MacKLess/sphinx_riddles.git
- Open app in preferred browser.
- Program stores a riddle question and answer.
- Example input: "What animal walks on 4 legs in the morning, 2 legs during the day, and 3 legs at night", "human"
- Example output: "What animal walks on 4 legs in the morning, 2 legs during the day, and 3 legs at night", "human"
- Program returns false if user's guess does not match the answer.
- Example input: "tadpole"
- Example output: false
- Program returns true if user's guess matches the answer.
- Example input: "human"
- Example output: true
- Program ignores case when checking user's guess.
- Example input: "HUMAN"
- Example output: true
- Program takes an array of riddle objects and stores them in a sphinx's memory.
- Example input: [riddle1, riddle2, riddle3, riddle4, riddle5, riddle6]
- Example output: [riddle1, riddle2, riddle3, riddle4, riddle5, riddle6]
- Program returns correct riddle's question.
- Example input: sphinx.ask_question
- Example output: "What starts with a t, ends with a t, and has t in it."
- Program returns result when match is false.
- Example input: "tyrannosaurus"
- Example output: "You've been strangled by a sphinx!"
- Program resets count when match is false.
- Example input: "tyrannosaurus"
- Example output: @riddle_count = 0
- Program moves on to next question when match is true
- Example input: "teapot"
- Example output: "Correct! Next question...."
- Program lets user enter Thebes after third correct answer
- Example input: "human", "teapot", "teeth"
- Example output: "Welcome! The ancient treasure of Thebes is yours!"
- Program resets count after user enters Thebes
- Example input: "human", "teapot", "teeth"
- Example output: @riddle_count = 0
- Program chooses a random riddle at each turn.
- Example output: "What starts with a t, ends with a t, and has t in it?"
- Program does not select duplicate questions in a single round.
- Example output: riddle1, riddle5, riddle 3
Please contact kels.langlois@gmail.com or ldmackrell@gmail.com with questions, comments, or issues.
- Ruby
Copyright (c) 2017 Kelsey Langlois & L. Devin MacKrell
This software is licensed under the MIT license.