-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patha.js
24 lines (23 loc) · 783 Bytes
/
a.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var user =require("readline-sync").question("enter the action:")
var computer =require("readline-sync").question("enter the action:")
if (user==computer){
console.log("both players are selected:'its a tie");
}
else if (user=="paper"){
if(computer=="rock")
console.log("paper cover the rock'user(paper) win'")
else
console.log("scssior cuts the paper 'user(paper) lose'")
}
else if (user=="scissor"){
if(computer=="paper")
console.log(" scissor cut the paper 'user(scissor) wins'")
else
console.log("rock beats the scssior'user(scissor) lose")
}
else if (user=="rock"){
if(computer=="scissor")
console.log("rock beats scissor 'user(rock) wins'")
else
console.log("paper cover the rock'user(rock) lose")
}