-
Notifications
You must be signed in to change notification settings - Fork 5
daniel-j/node-two-phase-algorithm
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
node-two-phase-algorithm This is a Node.js module ported from a Java package. Original: Two-Phase-Algorithm by Herbert Kociemba, http://kociemba.org/cube.htm Example code/usage: #!/usr/bin/env node var twophase = require('twophase'); console.log("Initiating algorithm..."); twophase.initialize(function () { console.log("Ready"); // This just tests the solve, solution is F twophase.solve("UUUUUURRRDRRDRRDRRFFFFFFFFFLLLDDDDDDLLULLULLUBBBBBBBBB", 30, 60, false, function (err, solution) { if (err) console.error(err); twophase.randomCube(function (err, randomCube) { if (err) console.error(err); var cube = randomCube; //cube = "DUDLUDLFDRBRFRBLUUBUBLFRLDFFFUDDBRDRBFUBLUULDFRLRBLBRF"; console.log(cube); twophase.solve(cube, 30, 60, false, function (err, solution) { if (err) console.error(err); console.log("Solution:", solution); twophase.close(); }); }); }); }); Other (unused in the example) methods: twophase.verify(cube, callback); callback contains the parameters (err, code)
About
A port of Herbert Kociemba's Two-Phase-Algorithm for solving Rubik's cube.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published