Project

scrambler

0.0
No commit activity in last 3 years
No release in over 3 years
Scrambler for cubes and other puzzles
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.8.0
 Project Readme

Scrambler

Scrambler is a simple gem which provides your ground-breaking cube application with random turn scrambles for all WCA puzzles.

Installation

Install it as a gem

gem install scrambler

or if you use Bundler to handle your dependencies, add this to your Gemfile and run bundle.

gem "scrambler"

Supported Puzzles

Here's a list of all currently supported puzzles and their corresponding class names (note: they're all contained in the Scrambler module):

Puzzle    Class
--------  ------------
2x2x2     TwoByTwo
3x3x3     ThreeByThree
4x4x4     FourByFour
5x5x5     FiveByFive
6x6x6     SixBySix
7x7x7     SevenBySeven
Pyraminx  Pyraminx
Clock     Clock
Square-1  Square1
Megaminx  Megaminx

Usage

Just create an instance of the puzzle class and call scramble on it. scramble usually has one optional argument which specifies the scramble length.

require "rubygems"
require "scrambler"

Scrambler::ThreeByThree.new.scramble # defaults to 25 moves
# => "U F2 L' D R U' R2 U2 F D' R' D' F2 U2 R2 B R2 D F2 R2 F' U' B2 U B'"

Scrambler::ThreeByThree.new.scramble(10)
# => "U2 F2 R2 B L U2 R2 D' L' F2"

Scrambler::Clock.new.scramble # there's no scramble length parameter
# => "UUdd u=2; d=-5 / dUdU u=-3; d=6 / ddUU u=6; d=3 / UdUd u=3; d=2 / dUUU u=5 / UdUU u=-2 / UUUd u=6 / UUdU u=4 / UUUU u=1 / dddd d=0 / UUdd"