Class: RubyTerminalGames::Hangman::Board

Inherits:
Board
  • Object
show all
Defined in:
lib/ruby_terminal_games/hangman/board.rb

Instance Attribute Summary

Attributes inherited from Board

#cols, #height, #rows, #width

Instance Method Summary collapse

Methods inherited from Board

#clear!, #draw_border!, #move_cursor, #write

Constructor Details

#initialize(width: nil, height: nil) ⇒ Board

Returns a new instance of Board.



4
5
6
7
# File 'lib/ruby_terminal_games/hangman/board.rb', line 4

def initialize(width: nil, height: nil)
  super
  @height = 10
end

Instance Method Details



9
10
11
12
13
# File 'lib/ruby_terminal_games/hangman/board.rb', line 9

def print_world!(game)
  print_placeholders(game.word)
  print_wrong_guesses(game.wrong_guesses)
  print_exit_instruction
end