Class: TwistyPuzzles::SlashCommutator
Overview
Slash commutator of the form A B A2 B’ A.
Instance Attribute Summary
#first_part, #second_part
Instance Method Summary
collapse
#eql?, #hash, #initialize
Methods inherited from Commutator
#cancellations
Instance Method Details
#algorithm ⇒ Object
130
131
132
|
# File 'lib/twisty_puzzles/commutator.rb', line 130
def algorithm
first_part + second_part + (first_part * 2) + second_part.inverse + first_part
end
|
#inverse ⇒ Object
122
123
124
|
# File 'lib/twisty_puzzles/commutator.rb', line 122
def inverse
SlashCommutator.new(first_part.inverse, second_part)
end
|
#to_s ⇒ Object
126
127
128
|
# File 'lib/twisty_puzzles/commutator.rb', line 126
def to_s
"[#{@first_part}/#{@second_part}]"
end
|