CarlBrannen
Veteran
Petro Leum, wontolla, it's easy to make Prisma read in those codes.
To make Prisma read in {y,y',y2} I think you change one line in "parsers.RubiksCubeScrambleParser.java":
String face = parser.anyChar("BDFLRU"); =>
String face = parser.anyChar("BDFLRUy");
To add other strings, do accordingly.
I made another change to the parser, I arranged for it to skip over integers. This is so that I can read in a scramble list without having to trim the numbers off of it. That is, the effect in the parser is to read "3. U2 R' L" but to only keep "U2 R' L". With this change, my Rubiks parser is:
if (face != null) {
move += face;
} else {
// Get rid of leading integer numbers like 231. :
String Junk = parser.anyChar("0123456789.");
if (Junk == null) break;
}
// Only add to move list if the face isn't null.
if (face != null) {
String suffix = parser.anyChar("2\'");
if (suffix != null) {
move += suffix;
if (suffix.equals("2")) {
// ignore prime
parser.string("\'");
}
}
moves.add(move);
}
Okay that will read in the scramble, presumably you'd also like it to show the effects (with the ability to click on a button so you can see how the scramble progresses (which I use often enough because I get lost in scrambles regularly)). That's a change in "puzzles.RubiksCube.java". My change was easy because I only added one more transformation, the "y". It's defined as follows:
add the following lines (it will be pretty clear where they go, of course, just look for similar lines):
Plane planey = new Plane(new Vector3(0, -1.0, 0), new Vector3(0, 1, 0)); // This defines a plane that will rotate the whole cube
twists.put("y", new Twist(planey, Math.PI /2)); // And these define how much to rotate by.
twists.put("y2", new Twist(planey, Math.PI));
twists.put("y'", new Twist(planey, -Math.PI /2));
To get "M" to work is going to be a bit harder, my instinct is to generalize the definition of "Twist" so as to include slices. This would mean you'd have to make "graphics.Mesh.java"'s "rotateHalfspace(..)" be able to accept slices as well as rotations. I think this would be a worthy thing to do, it would make the graphics package more natural to how we use twisty puzzles.
To get Prisma to generate "y"s I messed around with "solvers.RubiksCubeSolver.java" and that was most of the effort.
By the way, I just updated the java to make the PLL timing easier to read. The " ` " marks are there to prevent the speedsolving forum from removing white space needed to keep the columns vertical.
When I'm practicing PLL, I keep this screen under the "mainFrame" screen. It shows me what the latest scramble was (i.e. "Gc"), how I did compared to previous Gc solves, and how I did compared to Gc solves with the same U rotation and cube orientation. And it keeps track of my average over all 1152 orientations. I like this because it makes practicing into a "fair competition" with myself. That is, instead of trying to get a new PB for PLL, I'm trying to beat my previous solve time for that exact situation:
To make Prisma read in {y,y',y2} I think you change one line in "parsers.RubiksCubeScrambleParser.java":
String face = parser.anyChar("BDFLRU"); =>
String face = parser.anyChar("BDFLRUy");
To add other strings, do accordingly.
I made another change to the parser, I arranged for it to skip over integers. This is so that I can read in a scramble list without having to trim the numbers off of it. That is, the effect in the parser is to read "3. U2 R' L" but to only keep "U2 R' L". With this change, my Rubiks parser is:
if (face != null) {
move += face;
} else {
// Get rid of leading integer numbers like 231. :
String Junk = parser.anyChar("0123456789.");
if (Junk == null) break;
}
// Only add to move list if the face isn't null.
if (face != null) {
String suffix = parser.anyChar("2\'");
if (suffix != null) {
move += suffix;
if (suffix.equals("2")) {
// ignore prime
parser.string("\'");
}
}
moves.add(move);
}
Okay that will read in the scramble, presumably you'd also like it to show the effects (with the ability to click on a button so you can see how the scramble progresses (which I use often enough because I get lost in scrambles regularly)). That's a change in "puzzles.RubiksCube.java". My change was easy because I only added one more transformation, the "y". It's defined as follows:
add the following lines (it will be pretty clear where they go, of course, just look for similar lines):
Plane planey = new Plane(new Vector3(0, -1.0, 0), new Vector3(0, 1, 0)); // This defines a plane that will rotate the whole cube
twists.put("y", new Twist(planey, Math.PI /2)); // And these define how much to rotate by.
twists.put("y2", new Twist(planey, Math.PI));
twists.put("y'", new Twist(planey, -Math.PI /2));
To get "M" to work is going to be a bit harder, my instinct is to generalize the definition of "Twist" so as to include slices. This would mean you'd have to make "graphics.Mesh.java"'s "rotateHalfspace(..)" be able to accept slices as well as rotations. I think this would be a worthy thing to do, it would make the graphics package more natural to how we use twisty puzzles.
To get Prisma to generate "y"s I messed around with "solvers.RubiksCubeSolver.java" and that was most of the effort.
By the way, I just updated the java to make the PLL timing easier to read. The " ` " marks are there to prevent the speedsolving forum from removing white space needed to keep the columns vertical.
When I'm practicing PLL, I keep this screen under the "mainFrame" screen. It shows me what the latest scramble was (i.e. "Gc"), how I did compared to previous Gc solves, and how I did compared to Gc solves with the same U rotation and cube orientation. And it keeps track of my average over all 1152 orientations. I like this because it makes practicing into a "fair competition" with myself. That is, instead of trying to get a new PB for PLL, I'm trying to beat my previous solve time for that exact situation:
N = 1470 ` 1152_Mean ` 1152_Best ` 1152_Worst ` mean_cost ` `Mean ` `Best ` Worst `
OverAll: ` `8.42351 ` ` ` 5.75 ` ` ` `18.86 ` ` ` `100% ` ` `8.41 ` `5.63 ` 20.59 `
` skip ` ` ` `0.72 ` ` ` `0.24 ` ` ` `1.43 ` ` ` ` 0.09 ` ` `0.76 ` `0.24 ` `1.43 `
` `H ` ` ` ` `6.46 ` ` ` `4.92 ` ` ` `7.76 ` ` ` ` 0.77 ` ` `6.49 ` `4.92 ` `7.81 `
` `Ua ` ` ` ` 4.56 ` ` ` `2.43 ` ` ` `9.69 ` ` ` ` 2.17 ` ` `4.55 ` `2.43 ` `9.69 `
` `Ub ` ` ` ` 4.70 ` ` ` `2.85 ` ` ` `11.20 ` ` ` `2.23 ` ` `4.77 ` `2.77 ` 11.20 `
` `Z ` ` ` ` `8.89 ` ` ` `6.44 ` ` ` `24.21 ` ` ` `2.11 ` ` `8.58 ` `5.19 ` 24.21 `
` `Aa ` ` ` ` 4.37 ` ` ` `3.05 ` ` ` `7.05 ` ` ` ` 2.07 ` ` `4.30 ` `3.05 ` `7.05 `
` `Ab ` ` ` `10.73 ` ` ` `3.97 ` ` ` `21.46 ` ` ` `5.09 ` ` 10.84 ` `3.97 ` 21.46 `
` `E ` ` ` ` 10.35 ` ` ` `5.60 ` ` ` `26.62 ` ` ` `2.46 ` ` `9.60 ` `4.96 ` 26.62 `
` `F ` ` ` ` 11.53 ` ` ` `8.39 ` ` ` `23.51 ` ` ` `5.48 ` ` 11.39 ` `8.39 ` 23.51 `
` `Ga ` ` ` ` 7.90 ` ` ` `5.99 ` ` ` `11.88 ` ` ` `3.75 ` ` `7.87 ` `5.99 ` 11.88 `
` `Gb ` ` ` ` 8.85 ` ` ` `5.86 ` ` ` `44.08 ` ` ` `4.20 ` ` `9.46 ` `5.63 ` 67.78 `
` `Gc ` ` ` ` 7.82 ` ` ` `5.03 ` ` ` `18.37 ` ` ` `3.71 ` ` `7.74 ` `5.03 ` 18.37 `
` `Gd ` ` ` ` 7.01 ` ` ` `5.39 ` ` ` `9.36 ` ` ` ` 3.33 ` ` `7.02 ` `5.39 ` `9.36 `
` `Ja ` ` ` ` 7.86 ` ` ` `4.60 ` ` ` `19.50 ` ` ` `3.73 ` ` `8.01 ` `4.60 ` 22.33 `
` `Jb ` ` ` ` 8.06 ` ` ` `5.92 ` ` ` `22.38 ` ` ` `3.83 ` ` `7.94 ` `5.92 ` 22.38 `
` `Na ` ` ` `14.55 ` ` ` 11.73 ` ` ` `19.68 ` ` ` `1.73 ` ` 14.41 ` 11.73 ` 19.68 `
` `Nb ` ` ` `14.48 ` ` ` 12.09 ` ` ` `27.64 ` ` ` `1.72 ` ` 14.14 ` 11.59 ` 27.64 `
` `Ra ` ` ` ` 8.67 ` ` ` `5.75 ` ` ` `15.78 ` ` ` `4.12 ` ` `8.62 ` `5.75 ` 15.78 `
` `Rb ` ` ` ` 7.65 ` ` ` `6.03 ` ` ` `11.63 ` ` ` `3.63 ` ` `7.61 ` `5.66 ` 11.63 `
` `T ` ` ` ` 12.13 ` ` ` `8.43 ` ` ` `37.89 ` ` ` `5.76 ` ` 12.02 ` `8.43 ` 37.89 `
` `V ` ` ` ` 10.04 ` ` ` `7.95 ` ` ` `13.16 ` ` ` `4.77 ` ` 10.19 ` `7.84 ` 17.89 `
` `Y ` ` ` ` 11.10 ` ` ` `8.62 ` ` ` `22.91 ` ` ` `5.27 ` ` 10.94 ` `8.22 ` 22.91 `
` ` ` `Gd `7.76 ` Best,Mean,Worst (this PLL): `5.39 `7.02 ` 9.36 ` `Last 6 exact: `7.36, 7.76,
` ` ` `Y ` 8.89 ` Best,Mean,Worst (this PLL): `8.22 `10.94 ` 22.91 ` `Last 6 exact: `9.85, 8.89,
` ` ` `F ` 9.76 ` Best,Mean,Worst (this PLL): `8.39 `11.39 ` 23.51 ` `Last 6 exact: `13.96, 9.76,
` ` ` `Rb `6.72 ` Best,Mean,Worst (this PLL): `5.66 `7.61 ` 11.63 ` `Last 6 exact: `7.71, 6.72,
` ` ` `Gb `9.96 ` Best,Mean,Worst (this PLL): `5.63 `9.46 ` 67.78 ` `Last 6 exact: `9.61, 9.96,
Latest: F ` 8.93 ` Best,Mean,Worst (this PLL): `8.39 `11.39 ` 23.51 ` `Last 6 exact: `11.18, 8.93,
OverAll: ` `8.42351 ` ` ` 5.75 ` ` ` `18.86 ` ` ` `100% ` ` `8.41 ` `5.63 ` 20.59 `
` skip ` ` ` `0.72 ` ` ` `0.24 ` ` ` `1.43 ` ` ` ` 0.09 ` ` `0.76 ` `0.24 ` `1.43 `
` `H ` ` ` ` `6.46 ` ` ` `4.92 ` ` ` `7.76 ` ` ` ` 0.77 ` ` `6.49 ` `4.92 ` `7.81 `
` `Ua ` ` ` ` 4.56 ` ` ` `2.43 ` ` ` `9.69 ` ` ` ` 2.17 ` ` `4.55 ` `2.43 ` `9.69 `
` `Ub ` ` ` ` 4.70 ` ` ` `2.85 ` ` ` `11.20 ` ` ` `2.23 ` ` `4.77 ` `2.77 ` 11.20 `
` `Z ` ` ` ` `8.89 ` ` ` `6.44 ` ` ` `24.21 ` ` ` `2.11 ` ` `8.58 ` `5.19 ` 24.21 `
` `Aa ` ` ` ` 4.37 ` ` ` `3.05 ` ` ` `7.05 ` ` ` ` 2.07 ` ` `4.30 ` `3.05 ` `7.05 `
` `Ab ` ` ` `10.73 ` ` ` `3.97 ` ` ` `21.46 ` ` ` `5.09 ` ` 10.84 ` `3.97 ` 21.46 `
` `E ` ` ` ` 10.35 ` ` ` `5.60 ` ` ` `26.62 ` ` ` `2.46 ` ` `9.60 ` `4.96 ` 26.62 `
` `F ` ` ` ` 11.53 ` ` ` `8.39 ` ` ` `23.51 ` ` ` `5.48 ` ` 11.39 ` `8.39 ` 23.51 `
` `Ga ` ` ` ` 7.90 ` ` ` `5.99 ` ` ` `11.88 ` ` ` `3.75 ` ` `7.87 ` `5.99 ` 11.88 `
` `Gb ` ` ` ` 8.85 ` ` ` `5.86 ` ` ` `44.08 ` ` ` `4.20 ` ` `9.46 ` `5.63 ` 67.78 `
` `Gc ` ` ` ` 7.82 ` ` ` `5.03 ` ` ` `18.37 ` ` ` `3.71 ` ` `7.74 ` `5.03 ` 18.37 `
` `Gd ` ` ` ` 7.01 ` ` ` `5.39 ` ` ` `9.36 ` ` ` ` 3.33 ` ` `7.02 ` `5.39 ` `9.36 `
` `Ja ` ` ` ` 7.86 ` ` ` `4.60 ` ` ` `19.50 ` ` ` `3.73 ` ` `8.01 ` `4.60 ` 22.33 `
` `Jb ` ` ` ` 8.06 ` ` ` `5.92 ` ` ` `22.38 ` ` ` `3.83 ` ` `7.94 ` `5.92 ` 22.38 `
` `Na ` ` ` `14.55 ` ` ` 11.73 ` ` ` `19.68 ` ` ` `1.73 ` ` 14.41 ` 11.73 ` 19.68 `
` `Nb ` ` ` `14.48 ` ` ` 12.09 ` ` ` `27.64 ` ` ` `1.72 ` ` 14.14 ` 11.59 ` 27.64 `
` `Ra ` ` ` ` 8.67 ` ` ` `5.75 ` ` ` `15.78 ` ` ` `4.12 ` ` `8.62 ` `5.75 ` 15.78 `
` `Rb ` ` ` ` 7.65 ` ` ` `6.03 ` ` ` `11.63 ` ` ` `3.63 ` ` `7.61 ` `5.66 ` 11.63 `
` `T ` ` ` ` 12.13 ` ` ` `8.43 ` ` ` `37.89 ` ` ` `5.76 ` ` 12.02 ` `8.43 ` 37.89 `
` `V ` ` ` ` 10.04 ` ` ` `7.95 ` ` ` `13.16 ` ` ` `4.77 ` ` 10.19 ` `7.84 ` 17.89 `
` `Y ` ` ` ` 11.10 ` ` ` `8.62 ` ` ` `22.91 ` ` ` `5.27 ` ` 10.94 ` `8.22 ` 22.91 `
` ` ` `Gd `7.76 ` Best,Mean,Worst (this PLL): `5.39 `7.02 ` 9.36 ` `Last 6 exact: `7.36, 7.76,
` ` ` `Y ` 8.89 ` Best,Mean,Worst (this PLL): `8.22 `10.94 ` 22.91 ` `Last 6 exact: `9.85, 8.89,
` ` ` `F ` 9.76 ` Best,Mean,Worst (this PLL): `8.39 `11.39 ` 23.51 ` `Last 6 exact: `13.96, 9.76,
` ` ` `Rb `6.72 ` Best,Mean,Worst (this PLL): `5.66 `7.61 ` 11.63 ` `Last 6 exact: `7.71, 6.72,
` ` ` `Gb `9.96 ` Best,Mean,Worst (this PLL): `5.63 `9.46 ` 67.78 ` `Last 6 exact: `9.61, 9.96,
Latest: F ` 8.93 ` Best,Mean,Worst (this PLL): `8.39 `11.39 ` 23.51 ` `Last 6 exact: `11.18, 8.93,
