class Kudosu::Printer
Attributes
board[RW]
Public Class Methods
new(board)
click to toggle source
# File lib/kudosu/printer.rb, line 5 def initialize(board) self.board = board end
Public Instance Methods
print()
click to toggle source
# File lib/kudosu/printer.rb, line 9 def print board.rows.each do |row| print_separation puts '| ' + row.map{ |cell| cell.value || " " }.join(' | ') + ' |' end print_separation end
Private Instance Methods
print_separation()
click to toggle source
# File lib/kudosu/printer.rb, line 20 def print_separation puts '+' + '---+' * 9 end