Created
July 17, 2015 21:12
-
-
Save 1UnboundedSentience/9a2b697babd323f1a19d to your computer and use it in GitHub Desktop.
MVC logic
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
each card has attribute | |
controller.launch | |
input: | |
output: calls greeting | |
view.display_greeting | |
input: a greeting as a string | |
output: printing greeting to screen as a string | |
controller.get_cards | |
input: nothing | |
output: an array of Card objects [<#Card>, <#Card>] | |
model.parse_text_file | |
input: text file | |
output: array of cards | |
model.send_cards | |
input: an array of cards | |
output: an array of cards | |
card.initialize | |
input: two rows (definition and term) | |
output: irrelevant | |
controller.send_definition | |
input: card | |
it does: call display_definition | |
view.display_definition | |
input:card | |
output: str | |
controller.guess | |
input: ARGV | |
case statements | |
output: feedback depending on if guess is correct | |
view.feedback | |
input: correct/incorrect | |
output: feedback (either correct or incorrect) | |
controller.has_won? | |
input: the array of cards (nothing left if true) | |
ouput: true/false if user has won | |
controller.has_lost? | |
input: guess count | |
output: true/false true if guesses > 5 | |
view.display_message | |
display win/loss message | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment