Kian3210 Posted December 3, 2016 Share Posted December 3, 2016 (edited) Code Submitted: var userChoice = prompt("Do you choose rock, paper, or scissors"); var computerChoice = Math.random(); console.log(computerChoice); if ( 0 <= computerChoice <= 0.33 ) { computerChoice = "rock"; } else if ( 0.34 <= computerChoice <= 0.66) { computerChoice = "paper"; } else ( 0.67 <= computerChoice <= 1) { computerChoice = "scissors"; } Any help is appreciated. Regard Lamm Peterson Edited December 3, 2016 by requinix removing email, links, and stray [/size]s Quote Link to comment https://forums.phpfreaks.com/topic/302675-rock-paper-scissors/ Share on other sites More sharing options...
Barand Posted December 3, 2016 Share Posted December 3, 2016 @kian3210 Three things Don't highjack someone else's post That is not PHP code - this is a PHP code help forum (moving to javascript forum) Use code tags for code Quote Link to comment https://forums.phpfreaks.com/topic/302675-rock-paper-scissors/#findComment-1539990 Share on other sites More sharing options...
requinix Posted December 3, 2016 Share Posted December 3, 2016 And a fourth: What's your question? Quote Link to comment https://forums.phpfreaks.com/topic/302675-rock-paper-scissors/#findComment-1540007 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.