Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (23 sloc) 632 Bytes

Model of a 3x3 Rubik's cube written in CoffeeScript


Require Cuber: Cuber = require './'

Initialize a cube: cube = new Cube "Patrick\'s Rubik\'s Cube""

Display cube: cube.display()

Scramble cube: cube.scramble(100) (100 random turns)

Check if a cube is solver: cube.check()

Cheat cube.cheat() reverses all previous moves to return to starting (solved) state

Turn a face or cube.turn('white', 'cw) or cube.turn('w') lowercase means clockwise, uppercase means counter-clockwise

Solver solver = new Solver cube

Something went wrong with that request. Please try again.