Skip to content

Instantly share code, notes, and snippets.

View cs0x7f's full-sized avatar

Chen Shuang cs0x7f

  • Ant Group
  • Shanghai
View GitHub Profile
@cs0x7f
cs0x7f / scramble_333_addition.js
Created April 7, 2012 16:38
generate random state subset scramble
/*
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.)
@cs0x7f
cs0x7f / skewb.py
Created May 1, 2012 07:45
Skewb Random State Scrambler
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;
@cs0x7f
cs0x7f / sq1solver.js
Created May 15, 2012 14:22
sq1-twophase-algorithm solver, javascript generated by GWT
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;
@cs0x7f
cs0x7f / scramble_333.js
Created June 24, 2012 08:35
new javascript 3x3 random state scrambler used in cstimer
/*
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:
@cs0x7f
cs0x7f / gearcube.js
Created August 16, 2012 13:57
Gear Cube Random State Scramble
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];
@cs0x7f
cs0x7f / SkewbSolver.java
Created January 4, 2014 05:38
Verify whether all states of the skewb can be solved at exactly 11 moves.
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];
@cs0x7f
cs0x7f / scramble_fto_standalone.mjs
Created July 3, 2024 03:12
FTO random-state scrambler
"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.