it is very true. I came here after chat gpt @@AdamKhoury
@WyMustIGo7 ай бұрын
ChatGPT is garbage, it isn't AI. I refer to ChatGPT as a smart filter because all it does is "filter" data that was scraped from the internet, it cannot make sense of anything that it did not get from the internet. There is a HUGE issue with this because most of the stuff on the internet is either factually incorrect, incomplete, biased, or injected to push an agenda. And, well, garbage in means garbage out. I have shown some blatant examples of how bad it is in various videos.
@MikeEarleyfivestarАй бұрын
OK I know it's been 11 years since you posted this video, but I deeply appreciate how well you explained this, starting with the physical manipulatives and moving to the code. This gave me a very good understanding of the functionality, thank you.
@gabsfrmarqs3 жыл бұрын
I'm not studying JavaScript right now but i really liked your explanation about how the Fisher-Yates algorithm works, thanks :)
@TraceguyRune6 жыл бұрын
The paper visualization was awesome. I was reading a documentation on this and was confused.
@nugaskliping Жыл бұрын
Something like this is what make me praise people of the past that invents like everything that can't be loaded by my slow brain
@milanbudha33814 жыл бұрын
Nobody was able to make understand this topic but you did it so simply..Thank you so much
@sabitbayar92562 жыл бұрын
I understood its logic in first 1.30 mins. thank u so much
@Rhua_Raj6 ай бұрын
great job it's been 10 years but still life saving tutotial
@ShidehNaderi11 жыл бұрын
Your explanation is very very very clear. Thank you.
@heavydirtysoul14913 жыл бұрын
Author has done some great work. Thank you for creating this excellent tutorial. Even in 2021 it is actual same as it was in 2013
@heavydirtysoul14913 жыл бұрын
I have some second thoughts about this algorithm. Isn't the start of the array shuffled more actively than the end?
@samuelobimakinde33054 жыл бұрын
The video was instructive. Thanks, Khoury
@AdamKhoury4 жыл бұрын
No sweat Samuel.
@76ers11 жыл бұрын
The visual explanation is awesome! Please incorporate it whenever you can in future videos.
@stacyjean-philippe24776 жыл бұрын
Thank you so much for explaining this so well! I've been trying to wrap my head around this for the longest time.
@AdamKhoury6 жыл бұрын
No problem Stacy. Thanks for the kind feedback.
@hassan-rakib2 жыл бұрын
Oh my gosh! Finally I know how the Fisher-Yates method works. 🙂
@sayedpritom4 жыл бұрын
Really Really Great Video. Your 2013 Video Tutorial Helped Me In 2020! & It Totally Felt Like A Tutorial of 2020. Many Thanks For Such Detailed & Consistent Explanation. The Concept Is Very Clear To Me Now. Alhamdulillah
@kennethf62668 жыл бұрын
This guy's a great teacher! Very useful stuff.
@AllyNyan7 жыл бұрын
Very instructive video I didn't understand the wikipedia page but now I do
@richardramos72676 жыл бұрын
Thank you very much, the first time I've watch this I only watch the visual representation, and then I program it my own, I made it by looping the array from the end to 1, then inside that I made another loop, so it is nested loop, every time I loop it the end array will be replace inside the nested array with the random place of the array... But this method is more efficient and less code, It is really hard for me to understand, It takes me almost 2 days, dreaming about this problem, T_T but now I get it..
@victorsuarez3 Жыл бұрын
Thank you so much for this. Amazing and simple explanation.
@AdamKhoury Жыл бұрын
Glad you enjoyed it!
@Revelatus5 жыл бұрын
Great explanation of the algorithm, thank you
@H0b0Gamers11 жыл бұрын
Awsome, more stuff like this please! Just the explanation alone was awsome. I saw the first part then wrote it in php before watching your code!
@dougreiserrelief6946 жыл бұрын
Thank you for the code and good examples and an explanation that I understood.
@seemsas11 жыл бұрын
I really like your tutorials, I've learned so much by them. Thanks!
@ezekielthemack11 жыл бұрын
Excellent tutorial as always. Thanks.
@PaulSebastianM5 жыл бұрын
Dis array is everywhere!
@YannisStarwalker11 жыл бұрын
Thanks for another awesome tutorial, Adam!!
@RagePeanut8 жыл бұрын
Thanks for this tutorial, been trying to do that today without any success. Thanks to you I've managed to do it, really well explained !
@GeorgeHarrisonJr6 жыл бұрын
Thank you for this! By far one of the best explanations. Excellent !
@hwangi04049 жыл бұрын
As a beginner, my mind is fucking blown. Wow, holy crap!!!
@asahifactory5 жыл бұрын
Thank you so so much! Finally I understand what is going on there!
@dr.sleaseball4413 жыл бұрын
i try to learn JS. this was helpful, very well explained!
@reromsp Жыл бұрын
Thats a great explaination!! Thankyou
@AdamKhoury Жыл бұрын
Glad it was helpful!
@kristenkumagai17918 жыл бұрын
Really appreciate you posting this tutorial. Thank you!
@usenli2 жыл бұрын
Thanks friend, very usufull visual explication
@TkJarok6 жыл бұрын
Excelente! perfecto para aplicarlo en mi tarea de Polibios!
@Thikondrius Жыл бұрын
At 00:28 the letters swaped (probably a wrong cut), be carefull ^^. Thanks for the video it's super clear.
@Sumdottycoy9 жыл бұрын
Awesome explanation. Implemented into my C game. :)
@ARandomPerson--2 жыл бұрын
What game did you make?
@vadimmalagurski57317 жыл бұрын
Thanks for sharing your knowledge very clear explanation !
@chrismaki54562 жыл бұрын
I understand the explanation of what is happening when the code is executed (physically how it reshuffles within itself) but I'm still lost on the variables and their values and how they make it happen.
@riiad4 жыл бұрын
I wish I could give this vid more than one thumbs-up
@jaredroberge99574 жыл бұрын
Solid video still. Been playing around with this particular shuffling method in c# for a unity project
@dianaloredanasebo72157 жыл бұрын
Great explanation. Thank you so much, sir! :)
@expukpuk6 жыл бұрын
Thanks, mate. Nice piece of code.
@m.sr.30882 жыл бұрын
well done best example ever ....bwosss!!!
@JM-jc1vz6 жыл бұрын
Good clear explanation, thank you.
@glendonphilippbaculio18118 жыл бұрын
your tutorials are great! thanks
@souravsuman26334 жыл бұрын
Thank you so much .....really good explanation
@dankomilutinovic67928 жыл бұрын
Thanks for this awesome tutorial!
@HarshDoes Жыл бұрын
Thank you so much for this 🙌
@antoniocardenasfuentes16277 жыл бұрын
Thank you so much! Great explanation.
@christophervistal60366 жыл бұрын
Thank you for this wonderful explanation :D
@AdamKhoury6 жыл бұрын
No problem buddy.
@sumangeorge74 жыл бұрын
perfect.. thanks for the upload.
@WinLoveCry9 жыл бұрын
Great stuff! Very informative.
@hengamehoseini26669 жыл бұрын
Great explanation! thank you!
@Ginfio2 жыл бұрын
great explanation
@limasntoinf6 жыл бұрын
Awesome. Thank you.
@iLLestTv6 жыл бұрын
Help my black ass out alot. Needed this code for a game Im programming my g.
@WanderSoulLife6 жыл бұрын
Hi thanks for this beautifully explained video. Can we use this algorithm for shuffling data sets for data analysis?
@ARandomPerson--2 жыл бұрын
If you put all the data sets into an array I don't see why not
@eledorusso8 ай бұрын
incredible thank u
@boricua129036 жыл бұрын
OMG thank you for this video.
@WanderSoulLife5 жыл бұрын
Thanks for this video. Can we use this method for shuffling a dataset?
@maracamo10 жыл бұрын
Great, really good!!!!
@frankwang116510 жыл бұрын
very instructive even for a beginner, what I'm interested is how to make a subtitle for the video in different languages? it would very helpful for those non-english speakers to understand the conversation in a video with captions of both original and translated Frank Wang
@jhogerguerrero20328 жыл бұрын
Excellent!!!
@43i3adam46 жыл бұрын
Thanks a lot; very clear
@AdamKhoury6 жыл бұрын
no sweat partner
@AdamKhoury11 жыл бұрын
Fisher-Yates Shuffle Modern Algorithm JavaScript Programming Tutorial
@grmmhp7 жыл бұрын
I'm not flawless, but you know, I got a diamond heart.
@VDeshm11 жыл бұрын
Awesome tutorial....
@vladankd6 жыл бұрын
This is great thanks
@daisoreanulaurentiu394310 жыл бұрын
such a shame that you have such a few views on such great tutorials
@teebee57398 жыл бұрын
Awesome video
@LadyVibora696 жыл бұрын
Thank you I understand all ^^ Thanks a lot really :D
11 жыл бұрын
as random() is used how can i mke this a encrypt / decrypt algo? or can you make a tut for this i want a custom style algo for enc and dec.
@Phoebes83914 жыл бұрын
good explanation
@abbi17508 жыл бұрын
Great explanation... tnx
@dan339dan11 жыл бұрын
so visual, unlike some random speech explanation
@Alacrity4209 жыл бұрын
awesome
@thepvporg7 жыл бұрын
The prototype method is a good idea but for some people, they may get confused by it as I know from experience of tying to demonstrate to people in a web developer forum I frequent. I have used a different method of shuffling and one that uses a random number that is 0 to 'nth' where the random selects the array element, in my routine I remove the element and put it in to a results array, the routine runs for as many elements in the array, the result is very compact code and like most forums, people go on about performance, which would have been relevant 20 years ago but pose no issues with todays computers. ---------------------------------------------------------------------------- Array.prototype.shuffle = function(){ var s = []; while( this.length ) s.push( this.splice( -(~~(Math.random()*this.length)|0),1) ); return s; } testarray = ["some","data","is","here","so","we","can","shuffle","items","randomly"].shuffle(); ---------------------------------------------------------------------------- IMHO it is much faster to pull a set of elements out of an array by a random method than swapping, in the method I posted, your using a new array to store the results sequentially and the original array is reducing and the range of randoms gets lower as it would in the moving a pointer, the efficiency arguments and claims by some people are IMHO unfounded and when you examine the different methods, they are essentially doing the same thing. I have even weighted the random function to output a negative integer to pull from the end of the array like in the Fisher Yates demo you just gave. The output will produce something like [randomly, items, so, shuffle, we, some, can, here, is, data] and [we, so, randomly, can, here, data, some, shuffle, is, items] as an output. If your really paranoid that the sort is not random enough, you can run the shuffle twice or more times if you like...
@TheRojo3872 жыл бұрын
This is good for implementing card games.
@JNET_Reloaded4 жыл бұрын
Can you make a tut on how to make anagrams from words using a dictonary file and shuffle etc?
@bmnbl11 жыл бұрын
Nice one.
@dakota73693 ай бұрын
Does everything have the same odds of being chosen?
@talentacquisition17468 жыл бұрын
How can you add breaks to the results? Or can I call the results some how and style them?
@fragrantbloom2 жыл бұрын
Shouldn"t i be arr.length-1 ? Thank you for the great explanation!
@chiggywiggy524 Жыл бұрын
Maybe it has to do with the fact that he's use prefix --i instead of postfix i-- to decrement the value
@titaniumwolf29 жыл бұрын
thank you very much.
@machan25247 жыл бұрын
I wonder why A and G were swapped for the 3rd random number 5. Index position should be moved to E without moving G. That is, the last 3 alphabets of shuffled array are GBD.
@gosinP4 жыл бұрын
Thank you.
@davidjames16846 жыл бұрын
If the random number is a 2 or a 1, we go to index position 1? I dont think so!
@moideenferoke595511 жыл бұрын
very nice
@softwareengineering1012 жыл бұрын
Awesome
@priyamvashi21872 жыл бұрын
Thank you
@guillemvila59604 жыл бұрын
In case that the "Math.random" number is 1 in the first pass of the loop using the formula j = Math.floor (Math.random() * (i+1)); the result number would be 8. Wouldn't, then, return undefined? what about j = Math.floor (Math.random() * (max - min)) + min; ? The max value will always be 7. I'm learning to code and maybe I'm just talking nonsense.
@kevnar4 жыл бұрын
Why decrement the range of the random number as you step down the loop? Why not just swap anywhere within the array? Wouldn't that give more randomness? It's not like it's saving time or memory to reduce the range.
@samuelobimakinde33054 жыл бұрын
I'm just learning programming, Kevnar. Your point is plausible. Can you please send me a code on how to do what you suggested?
@kongminjeong13558 жыл бұрын
thank you :)!!!!!
@davidjames16846 жыл бұрын
It took 2 guys to come up with this simple algorithm? Was it too much work for just 1 person?
@adambach57214 жыл бұрын
in the first loop of the "while" i=7 the maximum value may be 8 because we add 1 to the i and the random can also be 1, the j must be 0-7 and it looks like it can be 8 when we use (i+1), am I right or wrong?
@adambach57214 жыл бұрын
I found out, the Math.random () is from 0 (inclusive) to 1(EXCLUSIVE), to be able to use j=0-7 we must have floor of 0-7.9999
@stefantataru87 жыл бұрын
TNAKS YOUUUUUUUUUUUUUUUUU
@Rhua_Raj6 ай бұрын
i'm learing Fisher - Yates Algorithm for game dev in unity c#
@fatmanur5409 Жыл бұрын
What if all the random index values are equal to the original index and all the variables stay in the same indices?
@Oliveira529 Жыл бұрын
Depending on the number of elements, it is extremely unlikely
@AdamKhoury Жыл бұрын
One can record the original array into a temporary variable. Once the shuffle ends, one can compare the two arrays to see if they exactly match. If there is an exact match, run it through shuffle again. Oliveira529 is correct, extremely unlikely, but the above approach can double check it.