Created
March 13, 2013 18:28
-
-
Save monicao/5154800 to your computer and use it in GitHub Desktop.
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
class Hangman | |
# This class will be used to run an instance of a hangman game | |
# It is only concerned with one run through of the game | |
# It is not responsible for human interaction | |
attr_accessor :word | |
attr_accessor :chances | |
attr_accessor :board | |
def initialize(word) | |
@word = word | |
@chances = 8 | |
end | |
def guess!(letter) | |
end | |
def board | |
board = '_ ' * @word.length | |
board.strip | |
end | |
def won? | |
# true or false | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment