=C2=A0
=20=20
=20=20=20=20
=20=20=20=20=20=20
=20=20=20=20=20=20
Dear cubists,
Has it really been a year and a half since we touched the code? It=20
appears so. This version simply implements David Smith's near little=20
Goldilocks function for calculating a good number of scrambling twists=20
for all puzzles. You will find the new featured version here:
http://magiccube4d.googlecode.com/files/mc4d-4.0.181.jar
Please try it out with your favorite puzzles and let us know if you see=20
any problems. If it looks good in a few days, I'll make the "Download"=20
button point to it. The only problem you would even see would be if=20
there were too few scrambles, but you can look at the resulting log=20
files to see the number used, or simply run it from a command window=20
where it will print out the value used for each full scramble.
For the record, here is my Java implementation as some of you might like=20
to adapt and test with other puzzles:
public int goldilocks(int nPieces, int nFaces, int nStickers, int=20
n1CPieces, int d) {
double dpieces =3D nPieces, dfaces =3D nFaces, dstickers =3D nStickers=
,=20
d1cpieces =3D n1CPieces;
double aveNumTwists =3D (dpieces * dfaces / ((double)dstickers -=20
d1cpieces)) * (0.577 + Math.log(dpieces));
return (int)Math.round(aveNumTwists * (d - 1 + log4(dfaces / (2.0 *=20
d))));
}
private double log4(double x) {
return Math.log(x) / Math.log(4);
}
It may be too much to expect for one function to handle every possible=20
twisty puzzle, and David has already described some of its limitations,=20
but this is a noble goal to aspire to, so maybe over time will have a=20
fully general, well tested and reasonably simple solution. Regardless of=20
how far David's first shipping version takes us towards that goal, it is=20
definitely light years ahead of my original hack.
Thank you David!!
-Melinda
=20=20=20=20
=20=20=20=20=20
=20=20=20=20
=20=20=20=20
=20
=20=20
--0-873749669-1305550050=:25046
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
top" style=3D"font: inherit;">Thanks for releasing this Melinda! And = I appreciate the compliments! I'm glad to be of help anytime. <= br>I should note to everyone that the base-4 logarithm can be changed to a = base-2, or possibly base-3. The lower the base, the more a particu= lar puzzle is scrambled, but all with reasonable ranges. And if Ro= ice desires it, I could hopefully come up with something similar for Mag= icTile. I'm not certain at this point how I could improve the functi= on, but with feedback hopefully it will eventually be refined to be acce= ptable for all puzzles. Of course, whether Andrey or Roice want to= modify their code is entirely up to them, regardless of how well my fun= ction works. I did some 6 and 7-dimensional cube calculations, and= the results appeared accurate; not far too high or far too low, from my intuitive point of view. Thanks Melinda, and if you need further= assistance you know where to find me! :) It might be a couple of weeks = before I get back to the wiki, but I'm still planning to complete that p= roject. All the best, David --- On Thu, 5/12/11, Melind= a Green <melinda@superliminal.com> wrote: tyle=3D"border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-= |