Module: TwistyPuzzles

Defined in:
lib/twisty_puzzles.rb,
lib/twisty_puzzles/cube.rb,
lib/twisty_puzzles/parser.rb,
lib/twisty_puzzles/puzzle.rb,
lib/twisty_puzzles/version.rb,
lib/twisty_puzzles/rotation.rb,
lib/twisty_puzzles/algorithm.rb,
lib/twisty_puzzles/cube_move.rb,
lib/twisty_puzzles/commutator.rb,
lib/twisty_puzzles/coordinate.rb,
lib/twisty_puzzles/cube_state.rb,
lib/twisty_puzzles/part_cycle.rb,
lib/twisty_puzzles/skewb_move.rb,
lib/twisty_puzzles/skewb_state.rb,
lib/twisty_puzzles/color_scheme.rb,
lib/twisty_puzzles/abstract_move.rb,
lib/twisty_puzzles/letter_scheme.rb,
lib/twisty_puzzles/sticker_cycle.rb,
lib/twisty_puzzles/cube_constants.rb,
lib/twisty_puzzles/cube_direction.rb,
lib/twisty_puzzles/skewb_notation.rb,
lib/twisty_puzzles/skewb_direction.rb,
lib/twisty_puzzles/cube_move_parser.rb,
lib/twisty_puzzles/cube_print_helper.rb,
lib/twisty_puzzles/move_type_creator.rb,
lib/twisty_puzzles/skewb_move_parser.rb,
lib/twisty_puzzles/abstract_direction.rb,
lib/twisty_puzzles/compiled_algorithm.rb,
lib/twisty_puzzles/utils/array_helper.rb,
lib/twisty_puzzles/cancellation_helper.rb,
lib/twisty_puzzles/utils/string_helper.rb,
lib/twisty_puzzles/abstract_move_parser.rb,
lib/twisty_puzzles/reversible_applyable.rb,
lib/twisty_puzzles/twisty_puzzles_error.rb,
lib/twisty_puzzles/sticker_cycle_factory.rb,
lib/twisty_puzzles/compiled_cube_algorithm.rb,
lib/twisty_puzzles/algorithm_transformation.rb,
lib/twisty_puzzles/compiled_skewb_algorithm.rb,
lib/twisty_puzzles/axis_face_and_direction_move.rb,
ext/twisty_puzzles/native/native.c

Overview

rubocop:disable Style/Documentation

Defined Under Namespace

Modules: CancellationHelper, CubeConstants, CubePrintHelper, EdgeLike, MSlicePrintHelper, Native, ReversibleApplyable, Utils Classes: AbstractDirection, AbstractMove, AbstractMoveParser, Algorithm, AlgorithmTransformation, AxisFaceAndDirectionMove, BernhardLetterScheme, ColorScheme, Commutator, CommutatorParseError, CommutatorSequence, CompiledAlgorithm, CompiledCubeAlgorithm, CompiledSkewbAlgorithm, Coordinate, Corner, CubeDirection, CubeMove, CubeMoveParser, CubeState, Edge, Face, FakeCommutator, FatMSliceMove, FatMove, InnerMSliceMove, LetterScheme, MaybeFatMSliceMaybeInnerMSliceMove, MaybeFatMaybeSliceMove, Midge, MoveTypeCreator, MoveableCenter, Parser, Part, PartCycle, PureCommutator, Puzzle, Rotation, SetupCommutator, SkewbCoordinate, SkewbDirection, SkewbMove, SkewbMoveParser, SkewbNotation, SkewbState, SlashCommutator, SliceMove, StickerCycle, StickerCycleFactory, StickerCycles, TCenter, TwistyPuzzlesError, Wing, XCenter

Constant Summary collapse

PART_TYPES =

TODO: Add obliques

[Corner, Edge, XCenter, TCenter, Face, Midge, Wing].freeze
VERSION =
'0.0.44'

Instance Method Summary collapse

Instance Method Details

#parse_commutator(alg_string, complete_parse: true) ⇒ Object



265
266
267
268
269
270
# File 'lib/twisty_puzzles/parser.rb', line 265

def parse_commutator(alg_string, complete_parse: true)
  parser = Parser.new(alg_string, CubeMoveParser::INSTANCE)
  commutator = parser.parse_commutator
  parser.check_eos('commutator') if complete_parse
  commutator
end

#parse_cube_algorithm(alg_string, complete_parse: true) ⇒ Object Also known as: parse_algorithm



272
273
274
275
276
277
# File 'lib/twisty_puzzles/parser.rb', line 272

def parse_cube_algorithm(alg_string, complete_parse: true)
  parser = Parser.new(alg_string, CubeMoveParser::INSTANCE)
  algorithm = parser.parse_algorithm
  parser.check_eos('algorithm') if complete_parse
  algorithm
end

#parse_cube_move(move_string) ⇒ Object Also known as: parse_move



279
280
281
# File 'lib/twisty_puzzles/parser.rb', line 279

def parse_cube_move(move_string)
  CubeMoveParser::INSTANCE.parse_move(move_string)
end

#parse_skewb_algorithm(alg_string, notation, complete_parse: true) ⇒ Object



286
287
288
289
290
291
# File 'lib/twisty_puzzles/parser.rb', line 286

def parse_skewb_algorithm(alg_string, notation, complete_parse: true)
  parser = Parser.new(alg_string, SkewbMoveParser.new(notation))
  algorithm = parser.parse_algorithm
  parser.check_eos('algorithm') if complete_parse
  algorithm
end

#parse_skewb_move(move_string, notation) ⇒ Object



293
294
295
# File 'lib/twisty_puzzles/parser.rb', line 293

def parse_skewb_move(move_string, notation)
  SkewbMoveParser.new(notation).parse_move(move_string)
end