3. Computer Choice: Part 1


#1

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

var userChoice("Choice1 "paper")
{
("Choice2 scissors")
{
result ("sissors win over paper")
}
else ("rock wins over sisors")

var computerChoice === Math.random(

Does anyone know what I need to put after the "("?


#3

Is it true for this lesson:

  1. Under your previous code, declare a variable called computerChoice and make it equal to Math.random().
  2. Print out computerChoice so you can see how Math.random() works. This step isn't needed for the game - just useful for learning!

Because you don't need this:

var userChoice("Choice1 "paper")
{
("Choice2 scissors")
{
result ("sissors win over paper")
}
else ("rock wins over sisors")

Does anyone know what I need to put after the "("?

For this lesson you just need to call Math.random() and print it to console:

var computerChoice = Math.random();

#4

I know I don't need

var userChoice("Choice1 "paper")
{
("Choice2 scissors")
{
result ("sissors win over paper")
}
else ("rock wins over sisors")

I'm talking about the part I added after it
because the directions said, "under the prievious code"


#5

Your previous code should be:

var userChoice = prompt("Do you choose rock, paper or scissors?");

Then you need to call Math.random() and log it value to console.

Print out computerChoice so you can see how Math.random() works.


#6

i sont need any more comments on this one thanks you for halpeing me. i am now on # 7

building Rock,paper,sissors