Man, I don't even know if you ever read this, but your channel is like an amazing one. Perfect tutorials with relaxing atmoshere. thousand thanks!
@WebDevSimplified3 жыл бұрын
Thank you so much. That means a lot to me.
@crowlsyong Жыл бұрын
I agree. I feel like this is the gold standard for coding tutorials. Good pacing, no nonsense, huge help for me.
@vishalcelestine86543 жыл бұрын
Started with your video on node +mongo+express blog tutorial yesterday. Loved the way you keep things concise ,clear and especially your calm voice. Subscribed :)
suits are also alt numpad (3,4,5,6) in the order of ♥♦♣♠ to write them hold down alt, type the 1 or more digit number from numoad, release alt
@billyzman6663 жыл бұрын
Its impressive how easily you get around and create your code, thank you for this video!
@ridl273 жыл бұрын
A little nostalgic tutorial. It's a game of my childhood :) Ty Kyle
@javascriptdev22733 жыл бұрын
you always add something unique to your videos
@azsamsiizbrah3 жыл бұрын
This game is currently endless since the draw simply returns the cards to their owner's decks. With this rule no one can take an opponent Ace card. There was a rule for the draw situation- when it occurs, both players flip 3 additional cards and compare the last flipped. This way you could take the opponents Ace cards and win.
@Gaff.2 жыл бұрын
Never coded in js before, but I've done a lot of scripting in GECK for Fallout mods, and at least for me, I found it to be a really informative introduction to js to follow this video and then solve the problem you've mentioned. I have just a couple of aesthetic things to take care of and I need to do something about when the war itself is a draw.
@jabbadar2 жыл бұрын
Another, probably easier method would be, to just remove both cards from the game on a draw.
@Gaff.2 жыл бұрын
@@jabbadar I had that implemented inadvertently on my way to implementing the part that''s missing (the 'War' part), and it leads to endless games as well.
@dsackinger2 жыл бұрын
Love watching your videos! Note: your shuffle function will never have the last card remain in the last slot.
@JamieGillett2 жыл бұрын
He could've articulated the algorithm a bit more clearly but the code is fine. The random index "before" the current card includes the current card so it can "swap" with itself.
@lardosian3 жыл бұрын
Never seen defer before! Must follow this and make a Texas Holdem game, so is flatMap a spread under the hood, thanks Kyle!
@superdaveygravy2 жыл бұрын
Your videos are great...succinct and informative.
@danielgrafen86473 жыл бұрын
Awesome tutorial! I'm playing already a 23 hours match and can't beat that computer beast... but I never give up! If the computer and the player have at least one Ace... the game will take forever... Try with... const SUITS = ["♣","♦","♥","♠"] const VALUES = ["A"] ...but as the tutorial is not about Gameplay ;-) Structuring of classes with getHTML() and injecting the elements into the DOM depended on the game state, helped me understanding how very simple VanillaJS game could be structured. Thanks for sharing! Love it!
@palilomut47283 жыл бұрын
keep up the superb work, I've learnt so much from this tutorial(as well), thank you Kyle
@avi123 жыл бұрын
When I need to use "document.querySelector()", I use a variable that begins with "el", to signify an element Also, for booleans, I use a variable that begins with "is", even if the boolean signifies a plural
@ladislavzima83823 жыл бұрын
Why not to use "are" instead of "is" for plural variables? :-)
@avi123 жыл бұрын
@@ladislavzima8382 To be consistent, so when briefly reading the code, whenever you encounter a variable prefixed with "is", you know to expect it to contain a boolean
@DoctorMandible2 жыл бұрын
I do the same thing. And I frequently find myself wondering why I don't just learn typescript.
@LeoPacheco873 жыл бұрын
Amazing and simple to understand as always. Thanks for the content.
@tjcoledrumming5903 Жыл бұрын
Love your tutorials. I think I bit off more than I could chew because I chose to code Solitaire as my first coding project for bootcamp. This will help me out a lot because all I'm trying to do now is get some dang cards on the screen 😂.
@boblebeau13637 ай бұрын
Boss man im coding solitaire and im lost
@WebDevSimplified3 жыл бұрын
The first 1000 people to use the link will get a free trial of Skillshare Premium Membership: skl.sh/webdevsimplified11201
@bunnybloods7683 жыл бұрын
Diwali is a festival of lights. By watching your videos one day my life will be bright.❤️❤️❤️❤️
@piyushmahapatra54023 жыл бұрын
Happy Diwali Bhai ❤️
@vijaychauhan24503 жыл бұрын
Happy diwali bhai
@AdityaSharan8113 жыл бұрын
Happy diwali bhaii 🎊🔥
@themaninblack50223 жыл бұрын
BEWARE there are loud clipping sounds that will RIP your ears. 8:53 12:30 possibly more. RIP RIP RIP but damn this is great content
@jaidchen3 жыл бұрын
Too late, I already died.
@bloblop83972 жыл бұрын
@@jaidchen rip
@itsmanojb3 жыл бұрын
PDF annotation tools are mostly paid. JS tutorial explaining basics of PDF annotation layer / editing pdf would be very helpful.
@meruzhansargsyan14763 жыл бұрын
I have a question. The only way I can get modules to work is to have a server on through node. Do you just always have the server on in your videos?
@vasantbajantri30743 жыл бұрын
Awesome video. Can you please write test cases for this project. It will be very helpful.
@dineshkinibailoor3403 жыл бұрын
Is that fisher-yates shuffle algorithm at 11.45
@ifillup3 жыл бұрын
Great video, note a player with any Ace in the deck can never lose :P
@andreystruk93913 жыл бұрын
Because "2" should beat "Ace"...i just added two if statements before the rest of them: if (isRoundWinner(computerCard, playerCard) && playerCard.value == 2 && computerCard.value == 'A') to be win and swap "player" and "computer" in the second one to be lose
@ginbarato11783 жыл бұрын
Therefore it never ends XD
@eddyelamin90152 жыл бұрын
how do add a picture after the even of winning or losing happens?
@majedulislam49823 жыл бұрын
Thanks for such an amazing tutorial. If you publish a product rating system using with node or mongoose that would helpful.
@rubenuribe3 жыл бұрын
9:45 I don’t quite get why using random with the sort function causes the shuffle to not be totally random. Can anyone help explain? :)
@crowlsyong Жыл бұрын
Dude you are a legend
@capcodes3 жыл бұрын
Hey Kyle love the video just wanted to ask you if the design pattern you implemented in this video was factory right ? Dope content non the less! The design pattern videos have helped me beyond belief
@aubreydigital3 жыл бұрын
cool thanks for showing a use for the get statements in classes! funny that numberOfCards is actually 1 character longer than cards.length tho
@lusti1592 жыл бұрын
Thank you for this contet!
@LokeshKumar-vo2xc3 жыл бұрын
Happy Diwali bhai
@mohammedkhaja3 жыл бұрын
Please make a video on creating a full featured code editor using javascript.
@mattmaloney59883 жыл бұрын
Thank amigo. Question about game logic. If ties always go back to the bottom of each player's deck, then any play with an ace can never lose, because every round will be either a win or a tie for that card.
@Gaff.2 жыл бұрын
A 'war' should occur at that point, with each player putting up additional cards (usually 3 I think), and the winner of the last comparison takes all those cards. In this way, aces can be taken as part of the pile. I added this to my file and found it a helpful problem to work through.
@eugeniogonzato3 жыл бұрын
Thanks for your videos, you are the best
@jarrayamehdi65662 жыл бұрын
Wonderful tutorial, thx a lot =)
@SEGACD32XMODEL12 жыл бұрын
Github Copilot knows a bunch of this code already
@leeyahav47543 жыл бұрын
amazing tutorial thnx a lot Kyle
@baatar3 жыл бұрын
When I download the Skillshare iOS app, it offers a month-long trial which is longer than your two-week trial code, are you getting stiffed by Skillshare?
@CareerProgramming3 жыл бұрын
Great tutorial Kyle!
@Roknok3 жыл бұрын
Happy diwali
@yasir2690503 жыл бұрын
Very well made. Awesome
@nicholaswhite73513 жыл бұрын
Ты крут, чувак!
@crvpted3 жыл бұрын
This is epic pog.
@whoman79303 жыл бұрын
Instead of doing Math.floor() I always do, 5.76 | 0 Which return the number 5. Is it good to do that?
@sethhendricks3483 жыл бұрын
This guy has a good video explaining what | is and what it's can be used for. Personally I would use Math .floor & .celi for rounding. kzbin.info/www/bejne/o5bWpmprhbl3eZo
@herbertk92663 жыл бұрын
Thank you
@gerson-v-w5b Жыл бұрын
I didn't quite understood how the const newIndex works. I got lost in the (math.random() * (i + 1)). Im not sure hoe the * works in this case. What are you multiplying? And why are you adding 1? You explained that this would essentially swap our current card with a random card that we havent looped through yet but Im just confused as to why we use multiplication and addition to achive this.
@daveisdead3 жыл бұрын
How would you deal with the logic of a blackjack card game? Especially with the Ace card where it can be 1 or 11 depending on what the player has before
@laysdong3 жыл бұрын
If totalValue > 21 { check to see if there are aces, if so reduce value of ace to 1 and check again, if not then go to BUST} something like that
@DevsLikeUs3 жыл бұрын
Great info, thank you.
@liLi-lg8xv2 жыл бұрын
Your hair looks awesome 👌
@rajureddy75123 жыл бұрын
Good job man
@techwithshudarsan5593 жыл бұрын
!(I understood all your code)
@TheRegalboss3 жыл бұрын
You are the best! 👌🏻
@muzafferckay26093 жыл бұрын
Hi Kyle why dont you use factory function instead of class?
@percyisiah3 жыл бұрын
I feel stupid asking this but...how do I run this program? I did the entire tutorial, but don't know how to actually run the program. Do I need to find the server/host and run it from the terminal?
@stianmartinsen-stormyr17373 жыл бұрын
If you use Visual Studio Code you can install the "Live Server" Extension...when it`s installed you simply click the "Go Live"-button and it will open a browser window with your current code and it updates automatically while you code.
@sakshigosain238 Жыл бұрын
if playerDeck and computerDeck are an object made from the class Deck then how is it able to access the getHTML property from class Card?
@ransom.522 жыл бұрын
...if there was a war between... 2-4 players maybe 4 additional in lobby, how would you code that deal?...
@robiparvez3 жыл бұрын
awesome, bro
@simaopacheco45293 жыл бұрын
If that is all in client side it means all card values can be manipulated?
@LuisVallejo213 жыл бұрын
Hi Kyle, what programming paradigm do you mostly use?
@baatar3 жыл бұрын
Do you offer a discounted bundle for the JavaScript and React course?
@johnniegilkerson47243 жыл бұрын
I like your Javascript lessons, on this one I keep getting error in console: Uncaught TypeError: Failed to resolve module specifier "color-name". Relative references must start with either "/", "./", or "../". the code is word for word from your GitHub..
@juguetestoys11372 жыл бұрын
hi master ! Can you build a simple flashcard app ?
@gaurishagrawal94043 жыл бұрын
How make it multiplayer?
@Gaff.2 жыл бұрын
Wouldn't you just change the strings to reflect Player 1 and Player 2? War isn't really a 'game' in that neither player has any agency and the outcome is predetermined once the decks are given to each player.
@brimmedHat2 жыл бұрын
Bravo!
@mdsamir84953 жыл бұрын
Nice video sir, I want one video on voice recognition using google API for react native App. Please help me.
@biigsmokee3 жыл бұрын
is using flatMap the same as mapping the spread of ...suit @ 8:45?
@turing49913 жыл бұрын
Happy Diwali
@haythemsaidi913 жыл бұрын
Beautiful
@tomimontaana503 жыл бұрын
hi when i write console.log(deck.cards) i get this message Cross Origin Request Blocked error is comming what i must do to look the array of cards
@barrydlight173 жыл бұрын
how are you opening the index.html file?
@tomimontaana503 жыл бұрын
@@barrydlight17 hi i open the index with chrome
@barrydlight173 жыл бұрын
@@tomimontaana50 Try using a local server, if you check Kyle bar direction shows localhost, a simple way of doing it is to install live-server with npm and running it on the folder you're developing in.
@tomimontaana503 жыл бұрын
@@barrydlight17 thanks in live server is running
@barrydlight173 жыл бұрын
@UCRxvbXNAyPLJ-6UU6jRMpUw you need node.js installed on your machine, after that, run "npm i -g live-server" this will install live-server as a global dependency, once is finished just open your project folder in a terminal and run "live-server", it will look for an index.html file to serve it or you can run "live-server file.html" to specify the exact file you want to serve.
@dafrenchie593 жыл бұрын
Unless all aces are served to one player, isn't it an endless game ?
@rodwinpieterse19503 жыл бұрын
So bummed I cannot afford your JS course.
@leepowell29222 жыл бұрын
I'm having trouble at kzbin.info/www/bejne/hKm1qHyQjM9_qqc (32:51) after taking out the hard coded 26 I end up with no numbers in the deckElements. I looked at my code and it seems to be the same even copy and pasted the code from the github to triple check typing errors. The error that I'm getting is "Uncaught TypeError: Cannot set properties of null (setting 'innerHTML')" for the cleanBeforeRound(). any ideas?
@michelebarreto82893 жыл бұрын
Does anyone know how to make the array return 5 cards? Please
@kuyabobss3 жыл бұрын
Hi is your react course [Learn React Today] up to date?
@WebDevSimplified3 жыл бұрын
It is. It uses hooks and function components for everything.
@abhilekhgautam59633 жыл бұрын
Great!!!
@deansprivatearchive3 жыл бұрын
suit, rank*
@mikaelfarro2 жыл бұрын
Hey what about a chess clone?
@avi123 жыл бұрын
8:53 What the hell is that sound?
@WebDevSimplified3 жыл бұрын
Lol. I have no idea. Sounds like my computer was yelling at me
@Roknok3 жыл бұрын
@@WebDevSimplified happy diwali
@tyrusearls55532 жыл бұрын
I would love for your help to develop an app! This is amazing!
@elijahantony43002 жыл бұрын
How did you make that horizontal array (value and suit) vertical?
@MikeAgge2 жыл бұрын
i also wonder this let me know if u found it
@elijahantony43002 жыл бұрын
@@MikeAgge He is using an extension called prettier, when he presses ctrl+s or ctrl+shift+i it formats automatically.
@MistyDGreat12 жыл бұрын
Build a Poker Game pls (Hold' em Texas) lol
@joshuadarby58202 жыл бұрын
@8:53 thought i was having a stroke
@rupeshgarhwal11113 жыл бұрын
Cross Origin Request Blocked error is comming
@Gsudi2 жыл бұрын
What would be your suggestion for an easy clean solve?
@alwinvillero44043 жыл бұрын
if i get the money im going to register in skillshare :)
@Roknok3 жыл бұрын
Happy children's day!
@alwinvillero44043 жыл бұрын
ah yes, the children the future
@thedduck3 жыл бұрын
Whaaattt, the script is vanilla JS right? Why there's no *";"* to terminate a statement? Is it considered best practices nowadays to not explicitly do that, or am I missing something? Is it the new standard?
@webosm64943 жыл бұрын
Works with and without. I choose to use a ';' because i also program in C,C# where you have to use it. Simplifies live for me. :)
@godsepicgamer3825 Жыл бұрын
I cant even figure out how spread out cards on the x axis 😭
@wiljagerhardt12192 жыл бұрын
13:50 No Pattern completely random, ME sees J, J, J, 10,10,10
@swoorp3 жыл бұрын
can you share your pc config??
@abe103 жыл бұрын
Lol why
@swoorp3 жыл бұрын
@@abe10 because I want to build a new one... Just to get an idea
@wenchongwang16853 жыл бұрын
There is a bug here: Once player has an Ace in his deck , he will never lose.
@twinkiefrost66683 жыл бұрын
Why?
@stianmartinsen-stormyr17373 жыл бұрын
Yeah, I`m thinking the same.
@stianmartinsen-stormyr17373 жыл бұрын
@@twinkiefrost6668 Because each ace got the value of 14, and when there is a draw both cards is put back in the same players deck, so there is no way to lose an ace.
@jklmnop3 жыл бұрын
@@stianmartinsen-stormyr1737 that's because the "war" part of the game wasn't implemented or even mentioned. but maybe that could be a fun challenge for viewers to implement. i'd also say splitting the deck in half is not a proper deal, but it probably doesn't matter since the cards have been pseudo-randomly shuffled. it's trivial to implement a deal for odd/even cards out of the original deck into the computer/player decks instead of splitting on the midpoint. but all of that is irrelevant to the point of the video, which is how to set up a deck and cards to make whatever game you want.
@anilsaraf44502 жыл бұрын
I need you help sir
@user-ri9cn2rs5i3 жыл бұрын
watched the tutorial basically twice and made sure all the characters were correct and the game is still not rendering correctly...
@cristiandorultan Жыл бұрын
Min 5:56 😅
@jerrykokkat1762 жыл бұрын
Please explain in java
@ArvindKumar-sm6uh2 жыл бұрын
Rxce app mod bana do
@AP-ds9bb2 жыл бұрын
how do I contact you?
@demanitnt3 жыл бұрын
i dont understand a word. i just this video is only for english speakers. Try to speak slowly and explain every function or built in function.. Thnks
@stoinks68403 жыл бұрын
broo just tell us what we need to put in fucking first instead of going back n changing shit
@digital-artefakt2 жыл бұрын
i have made a blackjack with python and it is way easier than this:D