Class: Binary_Puzzle_Solver::Coord

Inherits:
Object
  • Object
show all
Defined in:
lib/binary_puzzle_solver/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Coord

Returns a new instance of Coord.



41
42
43
44
45
46
# File 'lib/binary_puzzle_solver/base.rb', line 41

def initialize (params)
    @x = params[:x]
    @y = params[:y]

    return
end

Instance Attribute Details

#xObject (readonly)

Returns the value of attribute x.



39
40
41
# File 'lib/binary_puzzle_solver/base.rb', line 39

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



39
40
41
# File 'lib/binary_puzzle_solver/base.rb', line 39

def y
  @y
end

Instance Method Details

#rotateObject



48
49
50
# File 'lib/binary_puzzle_solver/base.rb', line 48

def rotate
    return Coord.new(:x=>self.y,:y=>self.x)
end