clementgallet / fivestage444 Goto Github PK
View Code? Open in Web Editor NEWFive-Stage 4x4x4 solver / scrambler based on code by Bruce Norskog.
Five-Stage 4x4x4 solver / scrambler based on code by Bruce Norskog.
It looks like it's doing 1000 random turns to a solved cube instead.
Instead of always applying the whole sequences to the cube, we could store one cube per move and start from the last position where the sequences are identical. This needs some storing and a lot of array copying though.
((cube2.get_dist_edgcen() - (distEdgCen%3) + 4) % 3 ) + distEdgCen - 1; // TODO: Could make a better formula...
return (prune_table_edgcen[idx>>2] >> ((idx & 0x3) << 1)) & 0x3;
As lookup table is always faster than "%" operations,
the first line can be replaced by:
int[][] GetPrun = new int[MAXDEPTH][3]
GetPrun[currentdist][get_dist()];
the second line can be replaced by:
return UPack[prune_table_edgecen[idx>>2]][idx&0x3];
int[][] UPack = new int[256][4], whilch UPack[i][j] = i >> ((j & 0x3) << 1)) & 0x3 // for 4 entrance in one byte, and it can contains 5 entrance in one byte as 3^5 < 2^8, as Kociemba's Cube Explorer and my 4x4x4 solver(edge12.java) did.
In particular, if I hack Tools.randomCube
to set int scramble_len = 0;
, cg.fivestage.Main
just hangs.
Stage 2 is currently slow because the center coordinate is too big (51,482,970) to use one move table. So it is split into two numbers representing F and B centers respectively, both using the same move table. However, splitting and merging take a lot of computation.
One solution would be to keep two numbers all the way, but this storing is redundant (10,626_10,626 = 112,911,876), so the total number of coordinates with this system is 10,626_10,626*420 = 47,422,987,920 for 21,622,847,400 real positions. With symmetry reduction (8), the pruning table would have a size of at least 1,186 MB !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.