class Nonogram

Included Modules

Defined in:

nonogram.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(row_hints : Array(Array(Int32)), col_hints : Array(Array(Int32))) #

[View source]

Instance Method Detail

def [](row : Int32, col : Int32) : Cell #

[View source]
def []=(row : Int32, col : Int32, value : Cell) #

[View source]
def clone #

Returns a copy of self with all instance variables cloned.


[View source]
def col_hints : Array(Array(Int32)) #

[View source]
def cols : Array(Array(Cell)) #

[View source]
def each(&) #
Description copied from module Enumerable(Nonogram::Cell)

Must yield this collection's elements to the block.


[View source]
def each_with_index(&) #
Description copied from module Enumerable(Nonogram::Cell)

Iterates over the collection, yielding both the elements and their index.

["Alice", "Bob"].each_with_index do |user, i|
  puts "User ##{i}: #{user}"
end

Prints:

User # 0: Alice
User # 1: Bob

Accepts an optional offset parameter, which tells it to start counting from there. So, a more human friendly version of the previous snippet would be:

["Alice", "Bob"].each_with_index(1) do |user, i|
  puts "User ##{i}: #{user}"
end

Which would print:

User # 1: Alice
User # 2: Bob

[View source]
def height #

[View source]
def placement_with_indices(placement : Array(Int32), hints : Array(Int32), size : Int32, &) #

[View source]
def row_hints : Array(Array(Int32)) #

[View source]
def rows : Array(Array(Cell)) #

[View source]
def solve!(complex = true, &) : State #

[View source]
def solve!(complex = true) : State #

[View source]
def to_s(io) #

[View source]
def width #

[View source]