.55 in rock paper scissor


#1

I was doing Rock paper and Scissor, and it worked perfectly but i decided to randomly do it again.Then when .55 appears, result is shown as .55, not 'paper'.THOUGH I CAN MOVE TO NEXT CHAPTER.I WON'T.So i made some changes to it so that i know its .55 enerytime..pls.help me.
CODE

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

var computerChoice = .55;
console.log(computerChoice);
if (computerChoice < 0.33 ) {
computerChoice = "rock";
}
else if(computerChoice <= 0.66) {
computerchoice = "paper";
}
else {
computerChoice = "scissor";
}
console.log(computerChoice);


#2

First of all you should use Math.random() instead of guessing a random number :smile:
Or did you choose one to see if it is working?
For the actual problem I'd guess it's that you use both computer c hoice and computer C hoice and therefore you ask for the value of different variables.


#3

You are assigning "paper" to a different name


#4

Yup.I was checking.And thanks bro.C was the anti hero. :smile:


#5

yes.Thanks bro. C is the reason