Module: Stones::Program
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Direction
all, east, north, south, west
Methods included from Color
all, black, blue, green, red
Instance Attribute Details
#board ⇒ Object
Returns the value of attribute board.
3
4
5
|
# File 'lib/stones/program.rb', line 3
def board
@board
end
|
Instance Method Details
#can_move?(direction) ⇒ Boolean
16
17
18
|
# File 'lib/stones/program.rb', line 16
def can_move?(direction)
board.can_move?(direction)
end
|
#clear! ⇒ Object
28
29
30
|
# File 'lib/stones/program.rb', line 28
def clear!
board.clear!
end
|
#colors ⇒ Object
40
41
42
|
# File 'lib/stones/program.rb', line 40
def colors
Color.all
end
|
#count(color) ⇒ Object
32
33
34
|
# File 'lib/stones/program.rb', line 32
def count(color)
board.count(color)
end
|
#directions ⇒ Object
44
45
46
|
# File 'lib/stones/program.rb', line 44
def directions
Direction.all
end
|
#exist?(color) ⇒ Boolean
36
37
38
|
# File 'lib/stones/program.rb', line 36
def exist?(color)
board.exists?(color)
end
|
#move!(direction) ⇒ Object
8
9
10
|
# File 'lib/stones/program.rb', line 8
def move!(direction)
board.move!(direction)
end
|
#move_to_edge!(direction) ⇒ Object
12
13
14
|
# File 'lib/stones/program.rb', line 12
def move_to_edge!(direction)
board.move_to_edge!(direction)
end
|
#pop!(color) ⇒ Object
24
25
26
|
# File 'lib/stones/program.rb', line 24
def pop!(color)
board.pop!(color)
end
|
#push!(color) ⇒ Object
20
21
22
|
# File 'lib/stones/program.rb', line 20
def push!(color)
board.push!(color)
end
|