The cubies are called Corners, Edges, and Centers. Corners have 3 faces, Edges have 2, and Centers have 1. Another great video and I hope I can do something like this one day!
I attempted this once on my own. I tried to make a program that creates completed sudoku grids I got an algorithm together and let it run, but apparently it would have taken about six weeks to finish a single puzzle. Even doing it by hand with a pencil and paper is incredibly difficult. That would definitely put the challenge in Coding Challenge.
It's obvious that he takes quite a while before he makes the video to figure it out beforehand... Which is great! Nobody is that brilliant of a programmer (maybe a small few).
offset = (dim - 1) * len / 2 is needed for the general case, where dim isn't necessarily = 3. For the 2x2x2, 4x4x4, 5x5x5, etc. versions of the cube. Fred
Every capital letter shares 7 bits with it's opposite case counterpart. If you can grab the binary ASCII data directly then FlipCase(char) should return char XOR 0x00100000
You, good Sir, are a coding beast. My head did a full pi matrix transformation the entirety of this series. But I learned what I came here to learn which was coding the math and fundamental application of the three dimensional arrays for this project. Thank you so very much. I love your teaching style. Watching you make the same mistakes that we all make and your grace and humility in debugging on the fly is truly inspired my friend. You are the man. 🤜🤛
I have got an amazing idea for getting to solve itself........ we can just add the key pressed values in a list and then when space is pressed we can just reverse that and it resolves itself Greetings from India!
Near the end of the video, you set up Sequence with a random set of 10 moves in a loop with Sequence += blah. Then you set up a second loop that takes Sequence and reverses it into NextMove. But this seems silly to me to have two loops. You could do this all in the first loop with these lines: if (random) // rotate clockwise Sequence += blah NextMove = blah.UCase + NextMove else // rotate counterclockwise Sequence += blah.UCase Nextmove = blah + NextMove
I feel like using a shape for each cubie like you had initially would've made it much simpler, rather than having the cubie made of individual faces, no?
Here's a suggestion. There are actually infinitely many possible quads for any given normal, but we want those that "look right" for the problem at hand. We can think in terms of a spherical coordinate system to help us here. function DrawCubieFace( PVector n) { // Let's compute a few vectors using the cross product function for PVectors. // assuming that PVector n stores the normal vector. PVector axis = new PVector( 0, 0, 1); // unit vector along z-axis, also the spherical coordinates polar axis PVector lat = n.cross(axis).normalize(); // we compute a unit vector that is tangent to a "fixed latitude" circle, and perpendicular to n PVector lon = n.cross(lat).normalize(); // ...and a unit vector that is tangent to a "fixed longitude" circle. // The corners of our quad can be found by using the lat and lon PVectors // TODO: translate the result let s = 1; // length of the sides fill(255); // TODO: pick the right color here beginShape(); // Start from the center. PVector v = new PVector(0, 0, 0); // First corner v.add(PVector.mult( lat, s*0.5)).add(PVector.mult( lon, s*0.5)); vertex( v.x, v.y, v.z); // Second corner v.add(PVector.mult( lat, -s)); vertex( v.x, v.y, v.z); // Third corner v.add(PVector.mult( lon -s)); vertex( v.x, v.y, v.z); // Last corner v.add(lat); vertex( v.x, v.y, v.z); endShape(); } Disclaimer: I wasn't able to test this one. Debugging might be required.
Another thing that you could use to perform 3d rotations is quaternions. They are 4d numbers designed specifically with the idea of performing rotations in 3d space and are relatively easy to pick up. 3B1B had an awesome video about them and I think it would be very interesting to see quaternions in action
Yes. SO(3), the rotation group in 3-space, has 3 dimensions; quaternions have 4. So the quaternions used for this are those that are unit length; i.e., the sum of squares of the components = 1. That constraint takes away 1 degree of freedom, leaving 3, to match SO(3). And the correspondence is 2-to-1, where any given quaternion and its negative both give the same 3-space rotation. Fred
Oh man some of the coding challenges are too hard to follow while others are just complex enough that I can solve them. I wish I could easily go over "beginner-friendly" ones as a playlist or something
You are such a fun interesting person, I would love to be friends with you lol. Also I am taking a intro to processing course and my instructor is using your purple rain and 3D terrain generator coding challenges as examples lol.
Hey nice video! Why next don't you try to code a tetris game? I've already done one in python and it's not so complicated. To know all of the rules, you can search the tetris guidelines
J'adore ! I watched the whole rubiks one video and I thought: Oh damn how he'll achieve to code through this? When I started vidéo 2 I laughed so hard :D I'll refactor this!
I don't think you got all the CW and CCW turning correct. If you to 39:00, you are turning opposite faces in the same direction which means that one is CW and the other is CCW. And it looks like you carried this minor bug through to the refactored switch code. Shouldn't be too hard to fix though. Just need to flip the direction on half the turns.
1:32 he explains that and why he doesn't care about cube notation here but rather in mathematical notation. He can switch to cube notation once the other implementation is done.
Solving a Rubik's cube with a standard genetic algorithm seems pretty hopeless. I tried several variations but it just cant solve any scramble that needs more than 6 rotations. A few observations: It was proven some years ago that every scramble of a 3X3X3 cube can be solved with maximum 26 quarter turn rotations. A 'DNA' with a fixed number of rotations (e.g. 26) does not work. For example: if the DNA length is 15 then the cube could be solved after 10 rotations and the next 5 just scramble it again. I calculated the fitness of each individual after each rotation and used the part of the DNA that resulted in the highest fitness. But Crossover of this best DNA or of the entire DNA does not seem to work very well here. A complete random DNA in each generation actually got better results in my tests. Anyone got any ideas what could work better here?
To make the problem simpler I would not allow the algorithm to do any move (at least not before you have working proof of concept), but rather make it pick from four options: - Rotate 3 corners - Rotate 3 edges - Flip 2 corners - Flip 2 edges There are easy algorithms to do these basic moves. You also need to pick the side you do this algorithm on (1 of 6) and the side of the cube you keep as the top when you do this algorithm (1 of 4). This is quite similar to how most blindfolded cubers solve their cubes. As a fitness function I would take whether the cubie is oriented correctly and how many spots it is from where it needs to be. I'm not very familiar with genetic algorithms, but the 'DNA' would need to store the ability to do multiple moves before a re-evaluation of the fitness of the cube (unless you use setup moves) because some configurations require to move a cubie to the other side of the cube. All four suggested moves are completely independent, so the 'DNA' can does not need to do everything right before learning something.
DNA of cube matches + cube moves would improve a GA . So you have a string of partial matches of the cube and a string of rotations. mutate the rotations list only. Also do it as a set of goals such as bottom then middle then top of cube.
@@TheCodingTrain If you're going this deep, you may want to check out David Singmaster's booklet, _Notes on Rubik's Magic Cube,_ 1981. Singmaster was a lecturer in mathematical sciences & computing at the Polytechnic of the South Bank in London (now the London South Bank University). During the time Singmaster was accumulating these Notes, his office-mate, Morwen B. Thistlethwaite (no kidding!), was using his computer to search for "processes" (sequences of cube moves) that would efficiently solve the cube; and ones that would solve certain configurations of the cube. None of MBT's computer algorithms were detailed, or even described in the Notes, but it's possible that a net search might turn up something useful. Some of the processes he discovered this way, are given in the Notes. One of the most interesting features of the MBTC (MBT's Computer) solution processes was that, contrary to the vast majority of (human) cubers' solution methods, his would not appear to be making any progress until the last few moves, when everything would suddenly fall into place. It seems likely that the "ideal" solution would work this way. Main point is, this is a longtime, well-trodden problem, and there are bound to be lots of interesting ideas out there for how to do this (which, BTW, I'm not at all plugged into). OTOH, if your purpose is to work out your own method, independent of prior work in this area, I completely understand and support that. It'll be good to see what you might come up with. Fred
@@Erik31415 Those four processes are, of course, essential to solving the "top layer," once the other two layers are done (which is relatively easier). I trust that by "rotate," you mean cyclically permute, without changing the "orientation" (the facelet within the top layer) of the pieces. Also note that, while edges are said to "flip" (between 2 possible states), corners "twist" (having 3 possible states). When a pair of corners twist, they must do so in opposite directions. A fifth possible top layer process is a tri-twist, where 3 corner pieces all twist in the same direction. These two moves have been nicknamed, "meson" and "baryon" moves, respectively; with a single corner twist (impossible in isolation) being analogous to a "quark." Fred
This is 100 times more complicated than it should be. 444000555 444000555 444000555 111 111 111 222 222 222 333 333 333 This is your basic cube represented as 6 faces with 9 squares in each face.
Technically does the same thing. I don't see that much of a problem in doing so (then again i don't know too much about time/space complexity maybe there is a downfall there between both methods)
Harjit Singh the main reason a switch statement is better is because it is easier to read. I’m not sure about this but it is probably also better optimised.
@@rhysperry111 Actually I don't agree on the readability statement. Switch statements are usually not really that easier to read. They are quite nice for two reasons: You can actually have a complex calculation inside the switch() which will be calculated once and then compared. Of course this can also be achieved with a local variable so not really a strong argument. The second reason which is the most important one is that depending on the language and implementation you usually get a performance gain if you have many switch cases. I'm not really using Java (or processing) but I know exactly how C# implements switch cases. If the actual case values can be arranged in a certain order and don't have too large gaps, the compiler simply makes a jump table and uses the switch argument as index. If there's just one huge gap it might split it into two jump tables. If all values are a fix amount apart it might use some preprocessing math (like dividing the value by 4). If nothing helps and the number of cases is rather small, it just creates an if else chain. If the case count is high enough it actually uses a hashtable lookup to convert the values into an integer and use that in the jump table. C# doesn't allow fall through except a case is empty. So it's essentially just two case values merged into one. As far as i know Java does allow fall through just like C / C++. However this doesn't really help the readability and might enforce some strange ordering of the cases. Also it's a mess regarding scope since the whole switch body is one scope so you easily get issues with local variables. Adding curly braces to each case does not only make it even longer, but also terrible to format in a nice way. For "relatively" small if else chains they are usually shorter and easier to read. For example having only one statement in each if body allows you to write one elseif in one line. The different conditions nicely align and the actual executed statements align nicely. For example have a look at the input processing for my Rubik's Cube in the Update method. This btw is a complete Rubik's cube done in 300 lines in Unity3d: www.dropbox.com/s/gyif5k3y0w4n68d/RubikCube.cs?dl=0 I've done this somewhere in march 2018 for fun^^. Usually I love to create things procedurally but in this case i just used 27 of Unity's default cubes. Just make sure you use a shader that uses vertex colors.
@@Kitulous On the stickers no, the curvature doesn't matter. But on the pieces curvature stops the cube from catching and helps corner-cutting, which is the layers aligning themselves as you turn.
@@keppycs two reasons: 1. The syntax is Java not javascript. Notice the "void" in the functions and strong typing used for variables (int/string not const/var). 2. He specifically said that Processing uses Java at 1:49 of the pt 1 video and in a reply to one of the other comments on this video.
@@keppycs also, he's using javascript in his other videos because they're usually web dev related and javascript is most oft used for web dev. Java is less used for web dev and more used for standalone applications like this. (those aren't hard rules but are decent rules of thumb)
This video uses Processing (which is built on top of the Java programming language). For more info, visit processing.org and also this video might help ua-cam.com/video/AmlAiKsiy0o/v-deo.html.
9:21 everything should be correct unless skipped some lines errors that not mean anything. why cant say what is error lol. do i need import PMAtrix3D or class? install something?use prosessing 3? *java.lang.RuntimeException: java.lang.ClassNotFoundException: Rubik2 at processing.core.PApplet.runSketch(PApplet.java:10275) at processing.core.PApplet.main(PApplet.java:10083) Caused by: java.lang.ClassNotFoundException: Rubik2 at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at processing.core.PApplet.runSketch(PApplet.java:10268) ... 1 more OMG like 2 hour pulling hair. C drive FULL!. error not read anything bout it pff
@@0Arman0 There was a SLIGHT change a few lines above it. If you look at it VERY closely, you can find it. I can't exactly remember, something with the numbers
The cubies are called Corners, Edges, and Centers. Corners have 3 faces, Edges have 2, and Centers have 1. Another great video and I hope I can do something like this one day!
Idea for a coding challenge: A Sudoku solver. Its probably not that hard, but I still want to see your approach. Greetings from Germany!
GermanCubeSolver YOLO good idea. Using recursion it's a fun one
Causally droppin those NP-Complete bombs
Sodoku isnt NP-Complete
I attempted this once on my own. I tried to make a program that creates completed sudoku grids I got an algorithm together and let it run, but apparently it would have taken about six weeks to finish a single puzzle. Even doing it by hand with a pencil and paper is incredibly difficult.
That would definitely put the challenge in Coding Challenge.
DEUTSCHLAND!!!!!!!
I usually have absolutely no idea what's going on, but here I am sat watching for an hour. Cause he makes it interesting!
It's obvious that he takes quite a while before he makes the video to figure it out beforehand... Which is great! Nobody is that brilliant of a programmer (maybe a small few).
@@jackmead7292 Doesn't he livestream it
offset = (3 - 1) * len * 1/2 ... that's a long way of expressing len, LOL
Well we all make misstakes don't we. A prime example
offset = (dim - 1) * len / 2
is needed for the general case, where dim isn't necessarily = 3.
For the 2x2x2, 4x4x4, 5x5x5, etc. versions of the cube.
Fred
@@albinwarme6109 *missteaks
And no; some of us are perphict...
Fred
Every capital letter shares 7 bits with it's opposite case counterpart. If you can grab the binary ASCII data directly then FlipCase(char) should return char XOR 0x00100000
You, good Sir, are a coding beast. My head did a full pi matrix transformation the entirety of this series. But I learned what I came here to learn which was coding the math and fundamental application of the three dimensional arrays for this project. Thank you so very much. I love your teaching style. Watching you make the same mistakes that we all make and your grace and humility in debugging on the fly is truly inspired my friend. You are the man. 🤜🤛
I love the way you explain your code as you write it. It makes it so much easier to learn and understand. Thanks! Awesome work :)
20:53 Actually the middle layer is a move its called M :) You can do U perms, H perms, Z perms, or OLLs with M moves :)
The other middles are E for equator and S for standing. But there rarely used.
Although it's technically the same as a R and an L' or vice versa
@@kesleta7697 yes!! :)
These are also collectively called, "slice" moves.
Fred
His comment ¨it's not really a thing¨ shocked me. I'm using the Roux method :)
I have got an amazing idea for getting to solve itself........ we can just add the key pressed values in a list and then when space is pressed we can just reverse that and it resolves itself
Greetings from India!
I have done it and it works amazingly
I can share the code also
just i couldn't do it in the animation thing that you had done in the 3rd video
This code is so much cleaner than what I saw in the live stream. Very nice!
Near the end of the video, you set up Sequence with a random set of 10 moves in a loop with Sequence += blah. Then you set up a second loop that takes Sequence and reverses it into NextMove. But this seems silly to me to have two loops. You could do this all in the first loop with these lines:
if (random) // rotate clockwise
Sequence += blah
NextMove = blah.UCase + NextMove
else // rotate counterclockwise
Sequence += blah.UCase
Nextmove = blah + NextMove
The best one yet. Can't wait to see the animation.
an easy way to give the correct number of faces:
for each cubie the number of faces is abs(x) + abs(y) + abs(z)
This was the day I was waiting for where cubing and coding combine;
Thanks!
Same!
5:10 Changing the i, j, k to x, y, z... That was awesome :)
Try making classic Tetris in p5.js
I want to see that too!
I learned a lot from you
Like how you do small steps and test them
And how you keep your mood high
I feel like using a shape for each cubie like you had initially would've made it much simpler, rather than having the cubie made of individual faces, no?
Here's a suggestion. There are actually infinitely many possible quads for any given normal, but we want those that "look right" for the problem at hand. We can think in terms of a spherical coordinate system to help us here.
function DrawCubieFace( PVector n) {
// Let's compute a few vectors using the cross product function for PVectors.
// assuming that PVector n stores the normal vector.
PVector axis = new PVector( 0, 0, 1); // unit vector along z-axis, also the spherical coordinates polar axis
PVector lat = n.cross(axis).normalize(); // we compute a unit vector that is tangent to a "fixed latitude" circle, and perpendicular to n
PVector lon = n.cross(lat).normalize(); // ...and a unit vector that is tangent to a "fixed longitude" circle.
// The corners of our quad can be found by using the lat and lon PVectors
// TODO: translate the result
let s = 1; // length of the sides
fill(255); // TODO: pick the right color here
beginShape();
// Start from the center.
PVector v = new PVector(0, 0, 0);
// First corner
v.add(PVector.mult( lat, s*0.5)).add(PVector.mult( lon, s*0.5));
vertex( v.x, v.y, v.z);
// Second corner
v.add(PVector.mult( lat, -s));
vertex( v.x, v.y, v.z);
// Third corner
v.add(PVector.mult( lon -s));
vertex( v.x, v.y, v.z);
// Last corner
v.add(lat);
vertex( v.x, v.y, v.z);
endShape();
}
Disclaimer: I wasn't able to test this one. Debugging might be required.
Oh, cross product! Not sure why i forgot about that!
Another thing that you could use to perform 3d rotations is quaternions. They are 4d numbers designed specifically with the idea of performing rotations in 3d space and are relatively easy to pick up. 3B1B had an awesome video about them and I think it would be very interesting to see quaternions in action
Yes. SO(3), the rotation group in 3-space, has 3 dimensions; quaternions have 4. So the quaternions used for this are those that are unit length; i.e., the sum of squares of the components = 1. That constraint takes away 1 degree of freedom, leaving 3, to match SO(3).
And the correspondence is 2-to-1, where any given quaternion and its negative both give the same 3-space rotation.
Fred
I love you!! You inspire me everyday and i wish i could have your energy and positivity
"Guess what i can turn it...uh..wait" - Programming in one line.
Rohan Gupta yes
Here's programming in one line:
SyntaxError: "Bro why are up its 3 am
Error: No closing quotes.
50:46 //Bitwise XOR
int changecase = 32: //or char changecase = ' '; // yes its actually space xD
String nextMove = Character.toString(sequence.charAt(i)^changecase);
//other way saying flip BIT 6(decimal 32 binary 00100000 char SPACE) thats uppercase/lowercase in ASCII table
a->A 01100001^00100000=01000001
A->a 01000001^00100000=01100001
Started watching your videos, and they are amazing, I learned some things about coding, amazing challenges you do!
this video helped so much in my school project. thank you so much!!
Wow, nice. :D and this was my first processing project on my raspberry pi 5. Even got my git commits and everything down for this one
After I watched the first video I thought it will be nice to apply the transformation matrix that I learned during my study, sadly I never did it
Same
The best one hour video I have ever watched!!!!
Missed opportunity lol. Could have been, Cubie qb = cube[e] ;)
Oh man some of the coding challenges are too hard to follow while others are just complex enough that I can solve them. I wish I could easily go over "beginner-friendly" ones as a playlist or something
This is a great idea!
RIP
Notre-Dame. :(
Nice video, a good way to relax ^^
rip...
RIP
Us Java people pronounce char as it's spelled, not like 'car'
but "character" is not pronounced as it's spelled
@@davutsauze8319 Then under that rule, "char" should be pronounced, "care."
Fred
Isosceles Kramer but „car move“ sounds funny😂
I Love the fact, that He named the Class cubie
you probably get it a lot but I would LOVE to see you make tetris
Make it so you can drag the faces using your mouse, If it isnt to advanced :)
You are such a fun interesting person, I would love to be friends with you lol. Also I am taking a intro to processing course and my instructor is using your purple rain and 3D terrain generator coding challenges as examples lol.
You're a freaking genius
At 33:33, you saw me already nodding in agreement, didn't you?
You’re a genius..!!! Goodness!!
so much for getting my course work done tonight..haha
Wonderful, Wonderful, Wonderful.
Hey nice video! Why next don't you try to code a tetris game? I've already done one in python and it's not so complicated. To know all of the rules, you can search the tetris guidelines
J'adore !
I watched the whole rubiks one video and I thought: Oh damn how he'll achieve to code through this?
When I started vidéo 2 I laughed so hard :D
I'll refactor this!
so good
You should do Tetris!
duRUDFuBLL - the title of my new metal album.
Why not LrLrdFbDru
Hats off 2 u..I just loved the codes u wrote..
Im not a programmer.... and I understand none.... but Im interested because of the fact that Im a cuber
i fucking love you man, you'r the best, every time i see a notification from your channel i became happy, thank you so much !!!!!!!!
Should started with random colors :)
Are you planning to use neural networks or just hardcode some rules to solve the rubics cube?
Still trying to figure out what will work but I would like the system to learn rather than use a specific hard-coded algorithm.
Good job thanks !!! What did not make him move like the real! Cube and colors?
I don't think you got all the CW and CCW turning correct. If you to 39:00, you are turning opposite faces in the same direction which means that one is CW and the other is CCW. And it looks like you carried this minor bug through to the refactored switch code.
Shouldn't be too hard to fix though. Just need to flip the direction on half the turns.
1:32 he explains that and why he doesn't care about cube notation here but rather in mathematical notation. He can switch to cube notation once the other implementation is done.
Is there a Part 3? EDIT: Found it.
Solving a Rubik's cube with a standard genetic algorithm seems pretty hopeless. I tried several variations but it just cant solve any scramble that needs more than 6 rotations.
A few observations:
It was proven some years ago that every scramble of a 3X3X3 cube can be solved with maximum 26 quarter turn rotations.
A 'DNA' with a fixed number of rotations (e.g. 26) does not work. For example: if the DNA length is 15 then the cube could be solved after 10 rotations and the next 5 just scramble it again.
I calculated the fitness of each individual after each rotation and used the part of the DNA that resulted in the highest fitness. But Crossover of this best DNA or of the entire DNA does not seem to work very well here. A complete random DNA in each generation actually got better results in my tests.
Anyone got any ideas what could work better here?
To make the problem simpler I would not allow the algorithm to do any move (at least not before you have working proof of concept), but rather make it pick from four options:
- Rotate 3 corners
- Rotate 3 edges
- Flip 2 corners
- Flip 2 edges
There are easy algorithms to do these basic moves. You also need to pick the side you do this algorithm on (1 of 6) and the side of the cube you keep as the top when you do this algorithm (1 of 4).
This is quite similar to how most blindfolded cubers solve their cubes.
As a fitness function I would take whether the cubie is oriented correctly and how many spots it is from where it needs to be.
I'm not very familiar with genetic algorithms, but the 'DNA' would need to store the ability to do multiple moves before a re-evaluation of the fitness of the cube (unless you use setup moves) because some configurations require to move a cubie to the other side of the cube.
All four suggested moves are completely independent, so the 'DNA' can does not need to do everything right before learning something.
Thanks for this thread! I haven't tried yet but this is super useful info.
DNA of cube matches + cube moves would improve a GA . So you have a string of partial matches of the cube and a string of rotations. mutate the rotations list only. Also do it as a set of goals such as bottom then middle then top of cube.
@@TheCodingTrain If you're going this deep, you may want to check out David Singmaster's booklet, _Notes on Rubik's Magic Cube,_ 1981.
Singmaster was a lecturer in mathematical sciences & computing at the Polytechnic of the South Bank in London (now the London South Bank University).
During the time Singmaster was accumulating these Notes, his office-mate, Morwen B. Thistlethwaite (no kidding!), was using his computer to search for "processes" (sequences of cube moves) that would efficiently solve the cube; and ones that would solve certain configurations of the cube. None of MBT's computer algorithms were detailed, or even described in the Notes, but it's possible that a net search might turn up something useful. Some of the processes he discovered this way, are given in the Notes.
One of the most interesting features of the MBTC (MBT's Computer) solution processes was that, contrary to the vast majority of (human) cubers' solution methods, his would not appear to be making any progress until the last few moves, when everything would suddenly fall into place. It seems likely that the "ideal" solution would work this way.
Main point is, this is a longtime, well-trodden problem, and there are bound to be lots of interesting ideas out there for how to do this (which, BTW, I'm not at all plugged into). OTOH, if your purpose is to work out your own method, independent of prior work in this area, I completely understand and support that. It'll be good to see what you might come up with.
Fred
@@Erik31415 Those four processes are, of course, essential to solving the "top layer," once the other two layers are done (which is relatively easier).
I trust that by "rotate," you mean cyclically permute, without changing the "orientation" (the facelet within the top layer) of the pieces. Also note that, while edges are said to "flip" (between 2 possible states), corners "twist" (having 3 possible states).
When a pair of corners twist, they must do so in opposite directions. A fifth possible top layer process is a tri-twist, where 3 corner pieces all twist in the same direction.
These two moves have been nicknamed, "meson" and "baryon" moves, respectively; with a single corner twist (impossible in isolation) being analogous to a "quark."
Fred
is there no "tracking" in the library maybe someone should write it
This is 100 times more complicated than it should be.
444000555
444000555
444000555
111
111
111
222
222
222
333
333
333
This is your basic cube represented as 6 faces with 9 squares in each face.
yeah proud pinoy HAHAHHA
was on the stream
Add neural net
part 3 is not transformed yet?
You can do also a solver
Why do you use "(abs(normal.z) > 0)" and not just "(normal.z != 0)"? :)
Very nice video. After some moves how can we get the colors of the faces of a given cubie? Or at least it’s original position? Thanks
Agghhh I got really bugged when U used all those else if statements instead of a switch.
Technically does the same thing. I don't see that much of a problem in doing so (then again i don't know too much about time/space complexity maybe there is a downfall there between both methods)
Harjit Singh the main reason a switch statement is better is because it is easier to read. I’m not sure about this but it is probably also better optimised.
@@rhysperry111 Actually I don't agree on the readability statement. Switch statements are usually not really that easier to read. They are quite nice for two reasons:
You can actually have a complex calculation inside the switch() which will be calculated once and then compared. Of course this can also be achieved with a local variable so not really a strong argument.
The second reason which is the most important one is that depending on the language and implementation you usually get a performance gain if you have many switch cases. I'm not really using Java (or processing) but I know exactly how C# implements switch cases. If the actual case values can be arranged in a certain order and don't have too large gaps, the compiler simply makes a jump table and uses the switch argument as index. If there's just one huge gap it might split it into two jump tables. If all values are a fix amount apart it might use some preprocessing math (like dividing the value by 4). If nothing helps and the number of cases is rather small, it just creates an if else chain. If the case count is high enough it actually uses a hashtable lookup to convert the values into an integer and use that in the jump table.
C# doesn't allow fall through except a case is empty. So it's essentially just two case values merged into one. As far as i know Java does allow fall through just like C / C++. However this doesn't really help the readability and might enforce some strange ordering of the cases. Also it's a mess regarding scope since the whole switch body is one scope so you easily get issues with local variables. Adding curly braces to each case does not only make it even longer, but also terrible to format in a nice way.
For "relatively" small if else chains they are usually shorter and easier to read. For example having only one statement in each if body allows you to write one elseif in one line. The different conditions nicely align and the actual executed statements align nicely. For example have a look at the input processing for my Rubik's Cube in the Update method. This btw is a complete Rubik's cube done in 300 lines in Unity3d:
www.dropbox.com/s/gyif5k3y0w4n68d/RubikCube.cs?dl=0
I've done this somewhere in march 2018 for fun^^. Usually I love to create things procedurally but in this case i just used 27 of Unity's default cubes. Just make sure you use a shader that uses vertex colors.
can you make it playable with mouse? id like to be able to use it.
i get null pointer exception in cube[i].show();
why is this???
you could probably learn to solve a rubiks cube and make an algorithm for this. im thinking of making a robot that does this.
how to make PMatix in Javascript (p5.js)??
which program language you are using i like it and i want try it too
Dan, are you going to finish this challenge?
Pt 3: ua-cam.com/video/8U2gsbNe1Uo/v-deo.html
2nd image of blackhole XDDDD
0x3f800000th post!
Ryan Paul in my haste, I missed the 3! I fixed it. Thanks!
@@TheRainHarvester 17045651456? I still don;t get it.
17104371712th post?
Nice
The stickers on the cube should have round corners. Just saying.
so what's the actual value in this? is it just the fact of a standard or does it serve any purpose in cube solving?
@@Kitulous with a physical cube the rounded corners allow for faster solving through corner cutting, in a program it doesn't matter at all.
@@Kitulous On the stickers no, the curvature doesn't matter. But on the pieces curvature stops the cube from catching and helps corner-cutting, which is the layers aligning themselves as you turn.
Wow
What is the languege that you are programming?
Javascript
Close, it's Java not javascript
@@andrewbalzer6263Why'd it be Java? Pretty sure it's JavaScript like every other video of his
@@keppycs two reasons:
1. The syntax is Java not javascript. Notice the "void" in the functions and strong typing used for variables (int/string not const/var).
2. He specifically said that Processing uses Java at 1:49 of the pt 1 video and in a reply to one of the other comments on this video.
@@keppycs also, he's using javascript in his other videos because they're usually web dev related and javascript is most oft used for web dev. Java is less used for web dev and more used for standalone applications like this. (those aren't hard rules but are decent rules of thumb)
42:32 you have not move index 0 mean center
What program do you use to program?
Processing
This video uses Processing (which is built on top of the Java programming language). For more info, visit processing.org and also this video might help ua-cam.com/video/AmlAiKsiy0o/v-deo.html.
lol, I thought it C, but when string come out i confused haha
i need a code for algoritem in pc for arduino then i would make it phisycal
9:21 everything should be correct unless skipped some lines
errors that not mean anything. why cant say what is error lol. do i need import PMAtrix3D or class?
install something?use prosessing 3?
*java.lang.RuntimeException: java.lang.ClassNotFoundException: Rubik2
at processing.core.PApplet.runSketch(PApplet.java:10275)
at processing.core.PApplet.main(PApplet.java:10083)
Caused by: java.lang.ClassNotFoundException: Rubik2
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at processing.core.PApplet.runSketch(PApplet.java:10268)
... 1 more
OMG like 2 hour pulling hair. C drive FULL!. error not read anything bout it pff
24:12 why your code did not work mine did lol If statements lol lol
9:11 I am having a NullPointerException here. What do I do?
P.S.- Look at the timestamp it's 911 lol
Oops, it was some other error. I accidentally dialed 911 :P
@@codeforest9027 same, what did you do?
@@0Arman0 There was a SLIGHT change a few lines above it. If you look at it VERY closely, you can find it. I can't exactly remember, something with the numbers
@@codeforest9027 thanks it turned out to be the equality comparison I didn't add the = sign
No views ?
Nice pic dear
Raqib Imam Yes, nice pic... idiot
@@Endeavr_ ???
Huh
Cnc/gcode visualiser. X y z
The guiltless minute utrastructurally ruin because italy alarmingly drop sans a thick whiskey. spotted, three test