module RubiksCube::Algorithms

Permutation and Orientation algorithms for two-cycle solution

Public Class Methods

reverse(algorithm) click to toggle source
# File lib/rubiks_cube/algorithms.rb, line 4
def self.reverse(algorithm)
  algorithm.split.map do |move|
    case modifier = move[-1]
    when "'"
      move[0]
    when "2"
      move
    else
      "#{move}'"
    end
  end.reverse.join ' '
end