Module: Pangrid::AcrossLiteUtils
- Included in:
- AcrossLiteBinary, AcrossLiteText
- Defined in:
- lib/pangrid/plugins/acrosslite.rb
Instance Method Summary collapse
-
#empty_fill(xw) ⇒ Object
| solution = Cell[] -> String.
-
#pack_solution(xw) ⇒ Object
| solution = Cell[] -> String.
-
#unpack_solution(xw, s) ⇒ Object
String -> Cell[].
Instance Method Details
#empty_fill(xw) ⇒ Object
| solution = Cell[] -> String
63 64 65 66 67 68 |
# File 'lib/pangrid/plugins/acrosslite.rb', line 63 def empty_fill(xw) # when converting from another format -> binary we won't typically have fill # information, since that is an internal property of the acrosslite player grid = xw.to_array(FILL_CHARS) {|c| '-'} grid.map(&:join).join end |
#pack_solution(xw) ⇒ Object
| solution = Cell[] -> String
56 57 58 59 60 |
# File 'lib/pangrid/plugins/acrosslite.rb', line 56 def pack_solution(xw) # acrosslite doesn't support non-rectangular grids, so map null squares to # black too xw.to_array(GRID_CHARS).map(&:join).join end |