Skip to content

MacKLess/sphinx_riddles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sphinx Riddles

Epicodus Project in Ruby, 9/12/17

By Kelsey Langlois and L. Devin MacKrell

Description

A Ruby Script

Setup/Installation Requirements

Specifications

Riddle

  • 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

Sphinx

  • 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

Support and contact details

Please contact kels.langlois@gmail.com or ldmackrell@gmail.com with questions, comments, or issues.

Technologies Used

  • Ruby

License

Copyright (c) 2017 Kelsey Langlois & L. Devin MacKrell

This software is licensed under the MIT license.

About

Epicodus week 2 project using Ruby

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published