<!DOCTYPE html>
<html>
<head>
	<link rel='stylesheet' href='style.css'/>
</head>
<body>
<p></p>testing values from Q&A <a href="http://www.codecademy.com/forum_questions/521d2027f10c6051bb001e07#response-54b59d3ce39efe9362003db8">http://www.codecademy.com/forum_questions/521d2027f10c6051bb001e07#response-54b59d3ce39efe9362003db8</a></p>
<p>From <a href="http://www.codecademy.com/devearl">http://www.codecademy.com/devearl</a></p><br/><br/>
	<script src='script.js'></script>

</body>
</html>
// try various numbers here to see what your result is
var computerChoice = 0.6;

document.write(computerChoice);

// what we started with
// if (0 < computerChoice < 0.33) {
//     computerChoice = "rock";
// } else if ( 0.34 <= computerChoice <= 0.66) {
//     computerChoice = "paper";
// } else {
//     computerChoice = "scissors";
// };

// improved code
if (computerChoice < 0.33) {
    computerChoice = "rock";
} else if ( 0.34 <= computerChoice <= 0.66) {
    computerChoice = "paper";
} else {
    computerChoice = "scissors";
};
    
document.write(" gives us ", computerChoice, "<br>")
Created from scratch
1 fork
11 views

Browse more Codebits