Help on part 1, don´t understand


#1

This is what I have

var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random(); {
console.log(math.random);
}
computerChoice(0-1);

What is wrong with it?


#2

There is no associated block with Math.random(). It is a built in function, so we would never write it with a block.

var computerChoice = Math.random();
console.log(computerChoice);

This will gererate number between 0, (inclusive) and 1 (exclusive), in other words, a float.

The next lesson explores how we can determine three intervals in this number, from lowest to highest.


#3

Thanks for the help, but now it tells me that my code looks wrong.

Here´s my code:

var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
console.log(computerChoice);
computerChoice(0-1);

#4

Nevermind, I found out what I did wrong


#5

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