Coding Challenge

  Рет қаралды 147,910

The Coding Train

The Coding Train

Күн бұрын

Can I build an interactive 3D Rubik's cube in Processing? Yes! Someday I hope to return to this project and add an AI solver! Code: thecodingtrain.com/challenges...
🕹️ p5.js Web Editor Sketch: editor.p5js.org/codingtrain/s...
Other Parts of this Challenge:
📺 Rubik's Cube - Part 1: • Coding Challenge #142:...
📺 Rubik's Cube - Part 3: • Coding Challenge #142:...
🎥 Previous video: • Coding Challenge #141:...
🎥 Next video: • Coding Challenge #143:...
🎥 All videos: • Coding Challenges
References:
📹 peasycam: mrfeinberg.com/peasycam/
🟥 I am the cube: iamthecu.be
🔗 Rotation matrix on Wikipedia: en.wikipedia.org/wiki/Rotatio...
Videos:
🎥 Code Bullet: • A.I. Solves a 55 x 55 ...
🎥 Matrix Transformations: • How to Rotate Shapes i...
🎥 Matrix Multiplication for 3D Rendering: • Matrix Multiplication ...
🔴 Coding Train Live 174: • Coding Train Live 174:...
Related Coding Challenges:
🚂 #112 3D Rendering with Rotation and Projection: • Coding Challenge #112:...
Timestamps:
0:00:00 Introduction
0:01:30 Continuing From Part 1
0:02:57 Representing Each Cubie In a Matrix
0:09:43 Finding Each Cubie
0:11:01 Applying Rotation
0:25:30 Coloring The Faces
0:33:59 Updating The Positions
0:40:33 Adding Directions For Each Turn
0:44:03 Testing If Everything Works
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
🚂 Website: thecodingtrain.com/
👾 Share Your Creation! thecodingtrain.com/guides/pas...
🚩 Suggest Topics: github.com/CodingTrain/Sugges...
💡 GitHub: github.com/CodingTrain
💬 Discord: thecodingtrain.com/discord
💖 Membership: kzbin.infojoin
🛒 Store: standard.tv/codingtrain
🖋️ Twitter: / thecodingtrain
📸 Instagram: / the.coding.train
🎥 Coding Challenges: • Coding Challenges
🎥 Intro to Programming: • Start learning here!
🔗 p5.js: p5js.org
🔗 p5.js Web Editor: editor.p5js.org/
🔗 Processing: processing.org
📄 Code of Conduct: github.com/CodingTrain/Code-o...
This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecod...
#rubikscube #rotationmatrix #peasycam #simulation #processing

Пікірлер: 159
@zl25drexel
@zl25drexel 5 жыл бұрын
offset = (3 - 1) * len * 1/2 ... that's a long way of expressing len, LOL
@albinwarme6109
@albinwarme6109 4 жыл бұрын
Well we all make misstakes don't we. A prime example
@ffggddss
@ffggddss 4 жыл бұрын
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
@ffggddss
@ffggddss 4 жыл бұрын
@@albinwarme6109 *missteaks And no; some of us are perphict... Fred
@d0nnyr0n
@d0nnyr0n 5 жыл бұрын
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!
@germancubesolveryolo4524
@germancubesolveryolo4524 5 жыл бұрын
Idea for a coding challenge: A Sudoku solver. Its probably not that hard, but I still want to see your approach. Greetings from Germany!
@rstewa35
@rstewa35 5 жыл бұрын
GermanCubeSolver YOLO good idea. Using recursion it's a fun one
@dankwarmouse6248
@dankwarmouse6248 5 жыл бұрын
Causally droppin those NP-Complete bombs
@oofusmcdoofus
@oofusmcdoofus 5 жыл бұрын
Sodoku isnt NP-Complete
@kevnar
@kevnar 5 жыл бұрын
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.
@Sirvierl0ffel
@Sirvierl0ffel 4 жыл бұрын
DEUTSCHLAND!!!!!!!
@RaysOfPivot
@RaysOfPivot 5 жыл бұрын
I usually have absolutely no idea what's going on, but here I am sat watching for an hour. Cause he makes it interesting!
@jackmead7292
@jackmead7292 4 жыл бұрын
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).
@puppergump4117
@puppergump4117 2 жыл бұрын
@@jackmead7292 Doesn't he livestream it
@Kirkster
@Kirkster 5 жыл бұрын
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 :)
@ErikWouters
@ErikWouters 5 жыл бұрын
This code is so much cleaner than what I saw in the live stream. Very nice!
@garm0nb0z1a
@garm0nb0z1a 5 жыл бұрын
The best one yet. Can't wait to see the animation.
@fotiskapotos
@fotiskapotos 5 жыл бұрын
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
@ffggddss
@ffggddss 4 жыл бұрын
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
@xheptc9612
@xheptc9612 3 жыл бұрын
Started watching your videos, and they are amazing, I learned some things about coding, amazing challenges you do!
@Nervosa80
@Nervosa80 3 жыл бұрын
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. 🤜🤛
@richlai3378
@richlai3378 5 жыл бұрын
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 :)
@kesleta7697
@kesleta7697 4 жыл бұрын
The other middles are E for equator and S for standing. But there rarely used.
@kesleta7697
@kesleta7697 4 жыл бұрын
Although it's technically the same as a R and an L' or vice versa
@richlai3378
@richlai3378 4 жыл бұрын
@@kesleta7697 yes!! :)
@ffggddss
@ffggddss 4 жыл бұрын
These are also collectively called, "slice" moves. Fred
@jansalomon5749
@jansalomon5749 4 жыл бұрын
His comment ¨it's not really a thing¨ shocked me. I'm using the Roux method :)
@Dhakshith1189
@Dhakshith1189 4 жыл бұрын
This was the day I was waiting for where cubing and coding combine; Thanks!
@sinpi314
@sinpi314 3 жыл бұрын
Same!
@fuzzy-02
@fuzzy-02 4 жыл бұрын
I learned a lot from you Like how you do small steps and test them And how you keep your mood high
@iradnuriel9087
@iradnuriel9087 5 жыл бұрын
The best one hour video I have ever watched!!!!
@rohan1002
@rohan1002 4 жыл бұрын
"Guess what i can turn it...uh..wait" - Programming in one line.
@le_plankton
@le_plankton 3 жыл бұрын
Rohan Gupta yes
@noahnolte7288
@noahnolte7288 3 жыл бұрын
Here's programming in one line: SyntaxError: "Bro why are up its 3 am Error: No closing quotes.
@RicoGalassi
@RicoGalassi 5 жыл бұрын
so much for getting my course work done tonight..haha
@ttrouble1711
@ttrouble1711 5 жыл бұрын
I love you!! You inspire me everyday and i wish i could have your energy and positivity
@luismiguelgallegogomez8000
@luismiguelgallegogomez8000 5 жыл бұрын
5:10 Changing the i, j, k to x, y, z... That was awesome :)
@alksri
@alksri 3 жыл бұрын
this video helped so much in my school project. thank you so much!!
@ajreukgjdi94
@ajreukgjdi94 Жыл бұрын
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
@djsyntic
@djsyntic 2 жыл бұрын
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
@roshan_singh5709
@roshan_singh5709 5 жыл бұрын
Hats off 2 u..I just loved the codes u wrote..
@geoffwagner4935
@geoffwagner4935 5 ай бұрын
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
@ninjahyper5079
@ninjahyper5079 3 жыл бұрын
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!
@ninjahyper5079
@ninjahyper5079 3 жыл бұрын
I have done it and it works amazingly I can share the code also
@ninjahyper5079
@ninjahyper5079 3 жыл бұрын
just i couldn't do it in the animation thing that you had done in the 3rd video
@taba1950
@taba1950 5 жыл бұрын
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
@JackFlashTech
@JackFlashTech 3 жыл бұрын
Same
@airxperimentboom
@airxperimentboom 5 жыл бұрын
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!
@JarppaGuru
@JarppaGuru 2 жыл бұрын
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
@raymartgorosin7932
@raymartgorosin7932 4 жыл бұрын
You’re a genius..!!! Goodness!!
@paulbeck264
@paulbeck264 2 жыл бұрын
Missed opportunity lol. Could have been, Cubie qb = cube[e] ;)
@vanshtanwani8049
@vanshtanwani8049 5 жыл бұрын
Try making classic Tetris in p5.js
@ruler255
@ruler255 5 жыл бұрын
I want to see that too!
@xnick_uy
@xnick_uy 5 жыл бұрын
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.
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
Oh, cross product! Not sure why i forgot about that!
@toadfrommariokart64
@toadfrommariokart64 4 жыл бұрын
an easy way to give the correct number of faces: for each cubie the number of faces is abs(x) + abs(y) + abs(z)
@toasty7408
@toasty7408 5 жыл бұрын
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.
@lengors1674
@lengors1674 2 жыл бұрын
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?
@electricengine8407
@electricengine8407 5 жыл бұрын
Make it so you can drag the faces using your mouse, If it isnt to advanced :)
@gosnooky
@gosnooky 4 жыл бұрын
Us Java people pronounce char as it's spelled, not like 'car'
@davutsauze8319
@davutsauze8319 4 жыл бұрын
but "character" is not pronounced as it's spelled
@ffggddss
@ffggddss 4 жыл бұрын
@@davutsauze8319 Then under that rule, "char" should be pronounced, "care." Fred
@bastibob660
@bastibob660 4 жыл бұрын
Isosceles Kramer but „car move“ sounds funny😂
@jeeaile5835
@jeeaile5835 5 жыл бұрын
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
@zinsy23
@zinsy23 5 жыл бұрын
At 33:33, you saw me already nodding in agreement, didn't you?
@chachouamohamed8557
@chachouamohamed8557 4 жыл бұрын
Good job thanks !!! What did not make him move like the real! Cube and colors?
@kfossa344
@kfossa344 5 жыл бұрын
You should do Tetris!
@arturkarlov3000
@arturkarlov3000 5 жыл бұрын
duRUDFuBLL - the title of my new metal album.
@VY_Canis_Majoris
@VY_Canis_Majoris 5 жыл бұрын
Why not LrLrdFbDru
@oussamamahrouch
@oussamamahrouch 5 жыл бұрын
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 !!!!!!!!
@abdur1996
@abdur1996 5 жыл бұрын
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
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
This is a great idea!
@JohnPaulBuce
@JohnPaulBuce Жыл бұрын
so good
@catapillie
@catapillie 5 жыл бұрын
RIP Notre-Dame. :( Nice video, a good way to relax ^^
@d0nnyr0n
@d0nnyr0n 5 жыл бұрын
rip...
@spaghettiking653
@spaghettiking653 5 жыл бұрын
RIP
@jmp1906
@jmp1906 3 жыл бұрын
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
@maltee69
@maltee69 3 жыл бұрын
I Love the fact, that He named the Class cubie
@SondreSrbye
@SondreSrbye 5 жыл бұрын
Are you planning to use neural networks or just hardcode some rules to solve the rubics cube?
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
Still trying to figure out what will work but I would like the system to learn rather than use a specific hard-coded algorithm.
@vympel2732
@vympel2732 5 жыл бұрын
You're a freaking genius
@noclowns5356
@noclowns5356 5 жыл бұрын
Wow
@SpeckyYT
@SpeckyYT 5 жыл бұрын
Nice
@hasnainfareed8555
@hasnainfareed8555 3 жыл бұрын
Wonderful, Wonderful, Wonderful.
@bensmart2829
@bensmart2829 3 жыл бұрын
you probably get it a lot but I would LOVE to see you make tetris
@bmj14772
@bmj14772 2 жыл бұрын
Is there a Part 3? EDIT: Found it.
@landonkryger
@landonkryger 5 жыл бұрын
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.
@keineangabe8993
@keineangabe8993 5 жыл бұрын
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.
@sweetberries4611
@sweetberries4611 5 жыл бұрын
was on the stream
@francislydz4234
@francislydz4234 3 жыл бұрын
yeah proud pinoy HAHAHHA
@gramps717
@gramps717 2 жыл бұрын
is there no "tracking" in the library maybe someone should write it
@YellowBunny
@YellowBunny 5 жыл бұрын
Why do you use "(abs(normal.z) > 0)" and not just "(normal.z != 0)"? :)
@rhysperry111
@rhysperry111 5 жыл бұрын
Agghhh I got really bugged when U used all those else if statements instead of a switch.
@harjitsingh7308
@harjitsingh7308 5 жыл бұрын
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)
@rhysperry111
@rhysperry111 5 жыл бұрын
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.
@Bunny99s
@Bunny99s 5 жыл бұрын
@@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.
@k1rgizia
@k1rgizia 5 жыл бұрын
2nd image of blackhole XDDDD
@mr-backend2710
@mr-backend2710 3 жыл бұрын
Should started with random colors :)
@TheRainHarvester
@TheRainHarvester 5 жыл бұрын
0x3f800000th post!
@TheRainHarvester
@TheRainHarvester 5 жыл бұрын
Ryan Paul in my haste, I missed the 3! I fixed it. Thanks!
@d0nnyr0n
@d0nnyr0n 5 жыл бұрын
@@TheRainHarvester 17045651456? I still don;t get it.
@Tokyo_Pessi
@Tokyo_Pessi 5 жыл бұрын
17104371712th post?
@nassiandrea5802
@nassiandrea5802 4 жыл бұрын
You can do also a solver
@leguminosa9
@leguminosa9 5 жыл бұрын
part 3 is not transformed yet?
@salehismail1896
@salehismail1896 3 жыл бұрын
which program language you are using i like it and i want try it too
@obadaalzidi6452
@obadaalzidi6452 4 жыл бұрын
i get null pointer exception in cube[i].show(); why is this???
@JeffAporta
@JeffAporta 3 жыл бұрын
how to make PMatix in Javascript (p5.js)??
@vladig2835
@vladig2835 2 жыл бұрын
Dan, are you going to finish this challenge?
@krccmsitp2884
@krccmsitp2884 Жыл бұрын
Pt 3: kzbin.info/www/bejne/boaVmKaYg8pki9E
@josgielen8524
@josgielen8524 5 жыл бұрын
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?
@ErikWouters
@ErikWouters 5 жыл бұрын
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.
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
Thanks for this thread! I haven't tried yet but this is super useful info.
@georgechristoforou991
@georgechristoforou991 5 жыл бұрын
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.
@ffggddss
@ffggddss 4 жыл бұрын
​@@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
@ffggddss
@ffggddss 4 жыл бұрын
@@ErikWouters 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
@mr.norris3840
@mr.norris3840 5 жыл бұрын
Add neural net
@geeknrd962
@geeknrd962 3 жыл бұрын
can you make it playable with mouse? id like to be able to use it.
@sloppyvic6971
@sloppyvic6971 3 жыл бұрын
Im not a programmer.... and I understand none.... but Im interested because of the fact that Im a cuber
@georgechristoforou991
@georgechristoforou991 5 жыл бұрын
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.
@geeknrd962
@geeknrd962 3 жыл бұрын
you could probably learn to solve a rubiks cube and make an algorithm for this. im thinking of making a robot that does this.
@WildAnimalChannel
@WildAnimalChannel 5 жыл бұрын
The stickers on the cube should have round corners. Just saying.
@Kitulous
@Kitulous 5 жыл бұрын
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?
@MarsUltorPlays
@MarsUltorPlays 5 жыл бұрын
@@Kitulous with a physical cube the rounded corners allow for faster solving through corner cutting, in a program it doesn't matter at all.
@kesleta7697
@kesleta7697 4 жыл бұрын
@@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.
@daviamsilva
@daviamsilva 5 жыл бұрын
What program do you use to program?
@y_kazz3263
@y_kazz3263 5 жыл бұрын
Processing
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
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 kzbin.info/www/bejne/d57PcpyBqM6sZtE.
@jackshih6084
@jackshih6084 3 жыл бұрын
lol, I thought it C, but when string come out i confused haha
@allimahic4457
@allimahic4457 4 жыл бұрын
i need a code for algoritem in pc for arduino then i would make it phisycal
@elirannissani914
@elirannissani914 4 жыл бұрын
What is the languege that you are programming?
@keppycs
@keppycs 4 жыл бұрын
Javascript
@andrewbalzer6263
@andrewbalzer6263 4 жыл бұрын
Close, it's Java not javascript
@keppycs
@keppycs 4 жыл бұрын
@@andrewbalzer6263Why'd it be Java? Pretty sure it's JavaScript like every other video of his
@andrewbalzer6263
@andrewbalzer6263 4 жыл бұрын
@@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.
@andrewbalzer6263
@andrewbalzer6263 4 жыл бұрын
@@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)
@JarppaGuru
@JarppaGuru 2 жыл бұрын
42:32 you have not move index 0 mean center
@codeforest9027
@codeforest9027 5 жыл бұрын
9:11 I am having a NullPointerException here. What do I do? P.S.- Look at the timestamp it's 911 lol
@codeforest9027
@codeforest9027 5 жыл бұрын
Oops, it was some other error. I accidentally dialed 911 :P
@0Arman0
@0Arman0 5 жыл бұрын
@@codeforest9027 same, what did you do?
@codeforest9027
@codeforest9027 5 жыл бұрын
@@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
@0Arman0
@0Arman0 5 жыл бұрын
@@codeforest9027 thanks it turned out to be the equality comparison I didn't add the = sign
@JarppaGuru
@JarppaGuru 2 жыл бұрын
24:12 why your code did not work mine did lol If statements lol lol
@aidanlawrence554
@aidanlawrence554 5 жыл бұрын
Huh
@JarppaGuru
@JarppaGuru 2 жыл бұрын
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
@RIQUOLF
@RIQUOLF 5 жыл бұрын
Nice pic dear
@Endeavr_
@Endeavr_ 5 жыл бұрын
Raqib Imam Yes, nice pic... idiot
@d0nnyr0n
@d0nnyr0n 5 жыл бұрын
@@Endeavr_ ???
@TVPlush
@TVPlush 5 жыл бұрын
No views ?
@galihtanu
@galihtanu 3 жыл бұрын
Cnc/gcode visualiser. X y z
@voguemist9171
@voguemist9171 3 жыл бұрын
The guiltless minute utrastructurally ruin because italy alarmingly drop sans a thick whiskey. spotted, three test
Coding Challenge #142: Rubik's Cube Part 3
24:34
The Coding Train
Рет қаралды 91 М.
Coding Challenge #142: Rubik's Cube Part 1
23:48
The Coding Train
Рет қаралды 397 М.
He sees meat everywhere 😄🥩
00:11
AngLova
Рет қаралды 8 МЛН
터키아이스크림🇹🇷🍦Turkish ice cream #funny #shorts
00:26
Byungari 병아리언니
Рет қаралды 26 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:19
CRAZY GREAPA
Рет қаралды 23 МЛН
The Code That Makes Mario Move
9:53
NesHacker
Рет қаралды 518 М.
Coding Challenge #113: 4D Hypercube (aka "Tesseract")
43:53
The Coding Train
Рет қаралды 250 М.
The trick that solves Rubik’s Cubes and breaks ciphers
14:17
polylog
Рет қаралды 2,6 МЛН
Coding Challenge 144: 2D Black Hole Visualization
42:30
The Coding Train
Рет қаралды 230 М.
I Built a Rubik's Cube Solver
9:14
Aaed Musa
Рет қаралды 41 М.
Coding Challenge: 3D on Apple II
45:40
The Coding Train
Рет қаралды 321 М.
I Made a Neural Network with just Redstone!
17:23
mattbatwings
Рет қаралды 656 М.
Arduino Rubik Robot solver with 8 servo motors
2:19
Eman
Рет қаралды 25 М.
43,252,003,274,489,856,000 Rubik's Cube Combinations - Numberphile
10:14
Coding Challenge 167: Ulam Spiral of Prime Numbers
24:13
The Coding Train
Рет қаралды 750 М.
He sees meat everywhere 😄🥩
00:11
AngLova
Рет қаралды 8 МЛН