Skip to content

Instantly share code, notes, and snippets.

View chirag-shinde's full-sized avatar
💾
learning, unlearning & relearning!

Chirag Shinde chirag-shinde

💾
learning, unlearning & relearning!
View GitHub Profile
@chirag-shinde
chirag-shinde / rock_paper_scissor_rope.js
Last active August 29, 2015 14:26
CodeAcademy's JavaScript Rock,Paper,Scissors, Rope. This does all the 3, check the user's input, added choice of rope, in case of a tie it asks users or new input.
var choice = function()
{
var userChoice = prompt("Select rock, paper, scissors,rope");
if(userChoice!=="rock" && userChoice!=="paper" && userChoice!=="scissors" && userChoice!=="rope")
{
alert("You have entered wrong choice, enter rock, paper, scissors or rope");
choice();
}
else{
var computerChoice = Math.random();