Skip to content

Instantly share code, notes, and snippets.

@monicao
Created March 13, 2013 18:28
Show Gist options
  • Save monicao/5154800 to your computer and use it in GitHub Desktop.
Save monicao/5154800 to your computer and use it in GitHub Desktop.
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