Skip to content

Commit 26d723f

Browse files
author
Arthur Melton
committed
Rock Paper Scissors
1 parent 38595ad commit 26d723f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

examples/Rock Paper Scissors.nys

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
log("This is rock paper scissors pick one (R/P/S)");
2+
dec int picked: round(math(random*2));
3+
dec str picked_player: input();
4+
if (picked == "0") {
5+
log("it was a draw");
6+
}
7+
if (picked == "1") {
8+
log("you lost");
9+
}
10+
if (picked == "2") {
11+
log("you won");
12+
}

0 commit comments

Comments
 (0)