Coding Challenge #142: Rubik's Cube Part 2

preview_player
Показать описание


Other Parts of this Challenge:

References:

Videos:

Related Coding Challenges:

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

#rubikscube #rotationmatrix #peasycam #simulation #processing
Рекомендации по теме
Комментарии
Автор

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!

dnnyrn
Автор

I usually have absolutely no idea what's going on, but here I am sat watching for an hour. Cause he makes it interesting!

RaysOfPivot
Автор

Idea for a coding challenge: A Sudoku solver. Its probably not that hard, but I still want to see your approach. Greetings from Germany!

germancubesolveryolo
Автор

offset = (3 - 1) * len * 1/2 ... that's a long way of expressing len, LOL

zldrexel
Автор

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 :)

Kirkster
Автор

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 :)

richlai
Автор

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. 🤜🤛

Nervosa
Автор

The best one yet. Can't wait to see the animation.

garmnbza
Автор

This code is so much cleaner than what I saw in the live stream. Very nice!

Erik
Автор

I have got an amazing idea for getting to solve 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!

ninjahyper
Автор

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

ajreukgjdi
Автор

This was the day I was waiting for where cubing and coding combine;
Thanks!

Dhakshith
Автор

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

djsyntic
Автор

I learned a lot from you
Like how you do small steps and test them
And how you keep your mood high

fuzzy-
Автор

5:10 Changing the i, j, k to x, y, z... That was awesome :)

luismiguelgallegogomez
Автор

"Guess what i can turn it...uh..wait" - Programming in one line.

rohan
Автор

I love you!! You inspire me everyday and i wish i could have your energy and positivity

ttrouble
Автор

Started watching your videos, and they are amazing, I learned some things about coding, amazing challenges you do!

xheptc
Автор

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

fotiskapotos
Автор

an easy way to give the correct number of faces:
for each cubie the number of faces is abs(x) + abs(y) + abs(z)

toadfrommariokart