This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Costa “Rica” G
over 8 years

Why is this not working?

var userChoice = prompt(“Do you choose rock, paper or scissors?”); var computerChoice = Math.random(); console.log(computerChoice)

.

Anything I am doing wrong? It gives me error message:

Oops, try again. Your code doesn’t look quite right. Check the Hint if you need help!

Answer 55bda9a0e39efe899f00039c

1 vote

Permalink

This might work….!!!

userChoice = prompt(“Do you choose rock, paper or scissors?”); var computerChoice = Math.random() console.log(computerChoice);

points
Submitted by Sharad Kumar
over 8 years

2 comments

schamanu over 8 years

That’s exactly the same code the OP already posted. The only difference is that you forgot a semicolon in line 2 and the OP forgot one in line 3.

creta27 over 8 years

it still worked =/

Answer 55ba37d79113cb0fa500048a

0 votes

Permalink

Looks fine to me. Apart from a missing semicolon at the end of the code I can’t see any major errors. Try to reload the website (F5) or try another browser.

points
Submitted by schamanu
over 8 years

1 comments

Costa “Rica” G over 8 years

Ya, I closed everything then I reloaded everything and it worked.

Answer 55c1998ed3292fffd100003b

0 votes

Permalink

Refreshing the browser worked for me after 10 minutes of trying to figure out what was wrong. Frustrating.

points
Submitted by Nick
over 8 years

Answer 55c86ed09376765a9e0001f8

0 votes

Permalink

This code either with or without semicolon (on the 2nd or 3rd row) pass me on. I think they should be there.

points
Submitted by Boris Atanasov
over 8 years

Answer 55e845d586f5521c1b0005ce

0 votes

Permalink

Insert new code outside function, it works :)

points
Submitted by parashuraminbetween
over 8 years