Class: Xudoku::Formatter::Array

Inherits:
Base
  • Object
show all
Defined in:
lib/xudoku/formatter/array.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Base

#board

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Xudoku::Formatter::Base

Instance Method Details

#formatObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/xudoku/formatter/array.rb', line 7

def format
  result = []
  9.times do |row|
    row_ = []
    9.times do |col|
      value = board.value_at(row, col, Axis::ROW)
      row_ << (value.nil? ? "_" : value.to_i + 1)
    end
    result << row_
  end
end