Build "Rock,Paper,Scissors"


#1

Could someone translate this to me in English?
I want to understand whats going on.

Thank you! :slight_smile:

if (computerChoice >= 0 && computerChoice <= 0.34);
computerChoice = Paper;

#2

Both lines contain errors. The proper structure for an if statement is as follows:

if ( condition ) {

}

There is no semi-colon after the condtional argument. and the code block is wrapped in braces.

As for the conditional, it is one that yields true if the value is between the two endpoints. However, for this exercise such complex logic is not needed if we use an order from lowest to highest.

if ( x < 1/3 ) {

}
else if ( x < 2/3) {

} else {

}

Paper looks like a variable since it is not in quotes (a string).

computerChoice = "paper";

#3

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