This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
/* | |
MIT Licence | |
Copyright (c) 2024 Chen Shuang | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package puzzle; | |
import java.util.Random; | |
public class SkewbSolver { | |
private static final int[] fact = { 1, 1, 1, 3, 12, 60, 360 };//fact[x] = x!/2 | |
private static char[][] permmv = new char[4320][4]; | |
private static char[][] twstmv = new char[2187][4]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getgearoptscramble=(function() { | |
var cmv = []; | |
var emv = []; | |
var prun = []; | |
function cornerMove(idx, m) { | |
var arr = [], temp; | |
mathlib.setNPerm(arr, idx, 4); | |
temp = arr[0]; | |
arr[0] = arr[m+1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
scramble_333.js | |
3x3x3 Solver / Scramble Generator in Javascript. | |
The core 3x3x3 code is from a min2phase solver by Shuang Chen. | |
Compiled to Javascript using GWT and j2js project. | |
new feature: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function nullMethod(){ | |
} | |
function FullCube_copy(obj, c){ | |
obj.ul = c.ul; | |
obj.ur = c.ur; | |
obj.dl = c.dl; | |
obj.dr = c.dr; | |
obj.ml = c.ml; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
center = [0]*360; | |
corner = [0]*8748; | |
centermv = [[0 for col in range(4)] for row in range(360)]; | |
cornermv = [[0 for col in range(4)] for row in range(8748)]; | |
def cycle3(arr, i1, i2, i3): | |
c = arr[i1]; | |
arr[i1] = arr[i2]; | |
arr[i2] = arr[i3]; | |
arr[i3] = c; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
scramble_333.js | |
3x3x3 Solver / Scramble Generator in Javascript. | |
The core 3x3x3 code is from a min2phase solver by Shuang Chen. | |
Compiled to Javascript using GWT. | |
(There may be a lot of redundant code right now, but it's still really fast.) |