Help for "Rock, Paper, Scissors"


#1

Can someone please help me how to figure out how to start this project I have no idea how to start, i just began programming 3 days ago.
Please heeeelp! :blush:


#2

Have you completed all the Java Script exercises before this current one?


#3

yeah, i´ve done all the steps and everything is just that in this exercise it just says to do it and I don know how to.
How did you started it, will?


#4

Well, to help you then I first need to know how far have you gotten into this project? And have you followed the instructions exactly?


#5

thats the problem :frowning:
look i´ll copy paste the "instruction"
Instruction:
With your newly acquired knowledge of functions, let's go build a rock, paper, scissors game next. Click "Save & Submit Code" to get started!

And thats it.


#6

So hit save and submit at the bottom. Follow the instructions and you should be fine :slight_smile: If you run into any serious trouble where you don't understand what the instructions are saying then let me know :slight_smile:

The next exercise says to declare a variable called userChoice and it is basically saying to set that variable equal to a prompt that asks the user to say if they choose rock, paper, or scissors. Make sure to write down the exact sentence in your prompt that the exercise asks you to.


#7

Ooooooooh my goooood JAJAJAJAJAJA
i´m mexican so i talk spanish but also english and i didnt read the instrction well!!!
JAJAJA I feel so duuuumb!!!!
Thanks will, if i have a problem doing it later i´ll make know.


#8

LOL :slight_smile: ok then, I'm always happy to help you should you need it so just ask.


#9

var compare = function(choice1, choice2)
if (choice1===choice2) {
return "The result is a tie!"
}

can you help me with this, i dont know why does it tell me that if is an unexpected token i think i wrote it well


#10

It looks like you forgot a semicolon there.

You also forgot to close your function with a curly bracket like this };
don't forget the semicolon at the end of the curly bracket.


#11

tanks i passed but i´m struggling in the next step.
I think that you have already passed this exercise right?


#12

var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0.34) {
computerChoice = "rock";
} else if(computerChoice <= 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
} console.log("Computer: " + computerChoice);
var compare = function(choice1, choice2){
if (choice1===choice2){
return "The result is a tie!";}
}
else if(choice1==="paper"){
if(choice2==="rock"){
return "paper wins";}
else{
return "scissors wins";}
}

// that is all my progress, but in what i amstrugglin too much is in this check//
var compare = function(choice1, choice2){
if (choice1===choice2){
return "The result is a tie!";}
}
else if(choice1==="paper"){
if(choice2==="rock"){
return "paper wins";}
else{
return "scissors wins";}
}


#13

could you give me a link to the exercise?


#14

of course
https://www.codecademy.com/en/courses/javascript-beginner-en-Bthev-mskY8/1/3?curriculum_id=506324b3a7dffd00020bf661


#15

It looks like the problem is that your closing curly brace for your compare function isn't going around all of your code like it should.


#16

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.