👨💻 Learn How to Code with Private Classes - www.dorscodingschool.com/coachingplans ❓Having a hard time with CS50, FreeCodeCamp or Odin Project? Practice with our exclusive free coding platform: www.codingdors.com/ 🎯 Are You A Coding Expert? Take Our Free Quiz and Find Out - www.dorscodingschool.com/quiz
@541kyАй бұрын
the out of order steps confused me lol
@guchierrez2 жыл бұрын
thanks for this guide. TOPs javascript introduction was $hit, literally impossible to solve this without external help. there was literally almost no coding practice before this, only a bunch of useless text walls
@DorsCodingSchool2 жыл бұрын
Glad it helped!
@Spiriitu Жыл бұрын
im glad im not the only one that thought this
@BarcaFan12 Жыл бұрын
@@DorsCodingSchool please have you done a video on "Revisiting Rock, Paper and Scissors"?
@Electric-Do-Stuff Жыл бұрын
I know rIght! Luckily I had some JS knowledge going in, but for someone completely new to JS it's a ridiculous task. You're being asked to create arrays and use loops before they have even taught anything about arrays or loops. Not to mention asking you to create a case-insensitive input when they haven't covered string methods in any shape or form. Seems very backward to me.
@Jaimelapoesie Жыл бұрын
I thought I was just shit as coding until I read this comment... what a crazy first task. I'm probably going back to FreeCodeCamp or CodeAcademy at this point.
@Iloveprogrammiiing10 ай бұрын
Thank you so Much Giovanna, this is the most simplest breakdown I've seen from all the other solutions I was working with before
@jenniferguneratne22102 жыл бұрын
Thank you!! I was struggling with announcing the score at the end and this helped me clean up my code to make it work. One thing I noticed: the score had a tendency to increment one point for the player on a tied round, resulting in an inaccurate end result. I added a line to prevent the code from incrementing for either player if the round was drawn. I really appreciate the time you took to make this video!
@DorsCodingSchool2 жыл бұрын
We are glad to hear that! Thank you for your feedback, we will fix it :)
@gavincain9837 Жыл бұрын
I have that same problem, how did you do that? The new line I mean
@Iloveprogrammiiing10 ай бұрын
@@gavincain9837this is how I did it: else if(checkWinner(playerSelection, computerSelection) == "Tie") { scorePlayer++;scoreComputer++; }
@Iloveprogrammiiing10 ай бұрын
And then I added a line of code console logging the scorePlayer and the scoreComputer to double check if it was working properly
@girlintheworld84336 ай бұрын
Absolutely brilliant walkthrough
@unitedvoice10736 ай бұрын
Amazing and so simplified, thank you!!
@kauaiguy Жыл бұрын
Thank you so much for this easy to follow along video! I was stuck on this assignment on TOP and I was easily able to follow and understand what you were doing. Thank you!
@mattweatherbean4prez4 ай бұрын
This is an excellent walkthrough, thank you very much
@traezeeofor2 жыл бұрын
Thanks for this. Great guide to complete my 1st The Odin "Project".
@DorsCodingSchool2 жыл бұрын
Glad to hear that! We will be posting more videos about The Odin Project :) By the way, we have a Telegram Group to help people learn how to code and where you can connect with learners from all over the world. Over there you can ask any question about programming and you can easily get your questions answered within 24 hours. Besides that, you will have access to our membership with more than 400 problems made by us to ease your learning curve and 1 hour of group coaching every month! Check www.dorscodingschool.com/products
@girlintheworld84336 ай бұрын
@@DorsCodingSchool oh wow! What a great resource!
@patitatitatitatitona Жыл бұрын
OBRIGADA! i've been doing pretty well on the odin project but i would've never been able to do this by myself lol
@Thestorbob Жыл бұрын
Perfect, thank you! exactly what I needed
@doctorsocolinsky31169 ай бұрын
Hello, thanks for the video, but in the function getPlayerChoice, I do exactly the same as you did there, but the promp never shows, instead the game is played automatically 5 times, with all loses, any help with that?
@beingold7 ай бұрын
she is the legend
@MacacoVictor Жыл бұрын
Giovanna, eu estava com dúvida nesse código e após assistir o seu vídeo eu consegui finalizar o meu. Porém, ao inserir a função game e o loop, meu console mostra que o playerSelection não foi definido, mas se eu tiro a função, o jogo funciona, você poderia me ajudar?? const pick = ["rock", "paper", "scissors"] function getComputerChoice(){ const choice = pick[Math.floor(Math.random() * pick.length)]; return choice; } function checkWinner(){ if(playerSelection == computerSelection){ return "Tie"; }else if (playerSelection == "rock" && computerSelection == "scissors" || playerSelection == "paper" && computerSelection == "rock" || playerSelection == "scissors" && computerSelection == "paper"){ return "Player"; } else{ return "Computer"; } } function playRound(playerSelection, computerSelection){ const result = checkWinner(playerSelection, computerSelection); if (result == "Tie"){ return "It's a Tie!" } else if(result == "Player"){ return `You Win! ${playerSelection} beats ${computerSelection}` } else if (result == "Computer"){ return `You Lose! ${computerSelection} beats ${playerSelection}` } } function getPlayerChoice(){ let validatedInput = false; while(validatedInput == false){ const choice = prompt ("Rock Paper Scissors"); if(choice == null){ continue; } const choiceInLower = choice.toLowerCase(); if(pick.includes(choiceInLower)){ validatedInput = true; return choiceInLower; } } } function game(){ let scorePlayer = 0 let scoreComputer = 0 for(let i = 0; i < 5; i++){ const playerSelection = getPlayerChoice(); const computerSelection = getComputerChoice(); console.log(playRound(playerSelection, computerSelection)) console.log("-----") if (checkWinner(playerSelection, computerSelection) == "Player"){ scorePlayer++; } else if (checkWinner(playerSelection, computerSelection) == "Computer"){ scoreComputer++; } if(scorePlayer>scoreComputer){ console.log("Player wins!") } else if(scoreComputer>scorePlayer){ console.log("PC wins") } else { console.log("Tie again") } } } game()
@whiskers08spot092 жыл бұрын
18:09 I'm a little confused here. Aren't you supposed to first put 'else'? or is that optional?
@DorsCodingSchool2 жыл бұрын
You can write else or not. It’s optional in this case ;)
@danielsantana55262 ай бұрын
Você é brasileira?
@whiskers08spot092 жыл бұрын
Is there a part 2 for the revisiting rock paper scissors?
@sallycar3114 Жыл бұрын
did you get the revisiting video?? did you do it pls??
@whiskers08spot09 Жыл бұрын
@@sallycar3114 i did not, I ended up switching to doing the Codecademy front end course, way better. Had to pay $150 tho
@gavincain9837 Жыл бұрын
It all works fine except that the prompt doesn't allow anything to show in the console. I have to comment out the function then open the page with live server , then go Back and uncomment the function. Is there a way around this? I tried settimeout but it didn't work either
@Deatomized Жыл бұрын
Hi! I have to thank you for this guide. As somebody said here before me, as total beginner it was really frustrating to get this thing going from scratch without ever trying to write code in JS. html and css at the beginning was quite fast to learn, only flex box took me couple of days to get a grasp on. (gamify helped a lot - flexfrog! :) ) but I'd like to ask about one thing. PlayRound function is called how, in the for loop? by the console? It's the only thing that's bugging my head. I thought, that I have to call the function inside the for loop to make it run. Can you, or somebody please explain? thanks a lot!
@DorsCodingSchool Жыл бұрын
We call playRound function inside the game function. If you see we are calling this function to display in the console.log :)
@Deatomized Жыл бұрын
@@DorsCodingSchool thanks for reply. I didnt know, thats enough. :)
@BarcaFan122 жыл бұрын
@6:50, my console keeps saying "Maths Not defined" And My code is exactly like yours; Function getComputerChoice() { Const choice = options [math.floor(math.random() * options.length)]; Console.log(choice); } getcomputerchoice () ; But my console keeps saying "Uncaught ReferenceError: math is not defined".
@DorsCodingSchool2 жыл бұрын
You probably should use Math with capital M. If you want, you can join our Free Discord Community: www.dorscodingschool.com/discord
@BarcaFan122 жыл бұрын
@@DorsCodingSchool Thanks!
@asiamahkorehglobal77822 жыл бұрын
Thank you very much
@ashalouis8667 Жыл бұрын
Thanks. God bless!!!
@DorsCodingSchool Жыл бұрын
You're welcome!
@stefaniagrigore8162 Жыл бұрын
what is the app she uses at the end to push all her work?
@DorsCodingSchool Жыл бұрын
Sublime merge
@stefaniagrigore8162 Жыл бұрын
@@DorsCodingSchool thank you
@Stephen_Muiru26 Жыл бұрын
hello! awesome video. But how do i push to my github. Im having a difficult time doing so. Thank you
@anitahemmings8785 Жыл бұрын
after trying to put prompt and doing rpm install prompt-sync I get the error : prompt is not defined what do I do?
@doctorsocolinsky31169 ай бұрын
I have the same issue, I know your comment is from long ago but did you find any solution?
@user-bm8uu5eg5y2 жыл бұрын
thank you for video.I've got question can you sing?
@DorsCodingSchool2 жыл бұрын
You're welcome!
@kecac44082 жыл бұрын
I have a problem where the game function is asking for twice as much input and only the second input is taken in as input. function game() { for ( let i = 0; i < 5; i++) { const playerSelection = getPlayerChoice(); const computerSelection = getComputerChoice(); console.log(playRound(playerSelection, computerSelection)); } } Same as yours. I tried commenting out the const`s and resulted in error, once i commented out the console.log it just asked 5 times for input. The problem is visible but why is the code running like this?
@DorsCodingSchool2 жыл бұрын
We’d love to help you more. Did you know you can join our Free Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord
@541kyАй бұрын
the out of order steps confused me lol
@nickrowe9431 Жыл бұрын
The way she says winner tho 😂
@sallycar3114 Жыл бұрын
Anyone has the same video but the revisiting one, please?
@Ohall558 Жыл бұрын
I wrote the code exactly as you did in the video for getPlayerChoice function, but when the page loads the prompt and you enter a choice, the console doesn't log anything and it just restarts the loop? Am I writing something wrong here? function getPlayerChoice(){ let validatedInput = false; while(validatedInput == false){ const choice = prompt("Rock Paper Scissors"); if (choice == null){ continue; } const choiceLowerCase = choice.toLowerCase(); if (options.includes(choiceLowerCase)){ validatedInput = true; return choiceLowerCase; } } }
@DorsCodingSchool Жыл бұрын
Did you hard reload your page? You should do ctrl + shift + r. This part should be working, you can check our solution on www.dorscodingschool.com/ebook
@Ohall558 Жыл бұрын
@@DorsCodingSchool I just figured out the issue this morning. I had capitalized the array items so the options.included was never going to work. But thank you, this video saved me a ton of frustration!
@oisterzenitzer97482 жыл бұрын
Hi. When i play the game, it's throwing a logic error. If i chose rock and computer chose paper, it should console log that you lose! paper beats rock! But it is doing the opposite of that. why is that? My code is almost the same as yours. Here is it: const options = ["rock", "paper", "scissor"]; function getComputerChoice() { const choice = options[Math.floor(Math.random() * options.length)]; return choice; } function checkWinner(playerSelection, computerSelection) { if (playerSelection == computerSelection) { return "It's a tie"; } else if ( (playerSelection == "rock" && computerSelection == "scissor") || (playerSelection == "scissor" && computerSelection == "paper") || (playerSelection == "paper" && computerSelection == "rock") ) { return "Player"; } else { return "Computer"; } } function playRound(playerSelection, computerSelection) { const result = checkWinner(playerSelection, computerSelection); if (result == "It's a tie") { return "It's a tie!"; } else if (result == "Player") { return `You win! ${playerSelection} beats ${computerSelection}` } else { return `You lose! ${computerSelection} beats ${playerSelection}` } } function getPlayerChoice() { let validInput = false; while(validInput == false) { const choice = prompt("Rock Paper Scissor"); if (choice == null) { continue; } const choiceInLower = choice.toLowerCase(); if(choice.includes(choiceInLower)) { validInput = true; return choiceInLower; } } } function game() { let playerScore = 0; let computerScore = 0; for( let i = 0; i < 5; i++) { const playerSelection = getPlayerChoice(); const computerSelection = getComputerChoice(); console.log(playRound(computerSelection, playerSelection)); if (checkWinner(playerSelection, computerSelection) == "Player") { playerScore++; } else if (checkWinner(playerSelection, computerSelection) == "Computer") { computerScore++; } } console.log("Game over!") if (playerScore > computerScore) { console.log("Player was the winner!"); } else if (playerScore < computerScore) { console.log("Computer was the winner!"); } else { console.log("We have a tie!"); } } game() Thanks in advance to anyone who is willing to help 😁
@DorsCodingSchool2 жыл бұрын
You should check all the cases when you win or when the computer wins ;)
@oisterzenitzer97482 жыл бұрын
@@DorsCodingSchool Haven't thought of that. Thanks.