1NightRaid1 commited on
Commit
3084fc2
1 Parent(s): a3e4e7a

Upload 5 files

Browse files
Files changed (5) hide show
  1. breakfast.jpg +3 -0
  2. bridge.jpg +3 -0
  3. bunny.jpg +3 -0
  4. castle.jpg +3 -0
  5. js-game/index.js +41 -0
breakfast.jpg ADDED

Git LFS Details

  • SHA256: 5773813c41c6116b72e36a355fcb8fd8b5c24d97b7d37dca5f43d4cc223a60a4
  • Pointer size: 131 Bytes
  • Size of remote file: 494 kB
bridge.jpg ADDED

Git LFS Details

  • SHA256: 175e7f287f5ea10488b1ee69a284308b7a776f1f9ba0dd865ea1f8deb1247ee0
  • Pointer size: 132 Bytes
  • Size of remote file: 2.26 MB
bunny.jpg ADDED

Git LFS Details

  • SHA256: 7acab2e6f2d66b842d03602ddf2fa9831620efbc1282019e6753ff1f60fb46a9
  • Pointer size: 131 Bytes
  • Size of remote file: 373 kB
castle.jpg ADDED

Git LFS Details

  • SHA256: 0ba0015d878e6e75f0193b2c76d8c2d50909ad553a668aeeae0cd8178f241da8
  • Pointer size: 132 Bytes
  • Size of remote file: 1.75 MB
js-game/index.js ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ const readline = require("readline").createInterface({
4
+ input: process.stdin,
5
+ output: process.stdout,
6
+ });
7
+
8
+ const arr = ["rock", "paper", "sicssor"];
9
+ const ai = arr[Math.floor(Math.random() * arr.length)];
10
+
11
+ readline.question(
12
+ "rock, paper, sicssor, which one you choose? ",
13
+ (yourChoice) => {
14
+ if (yourChoice === "rock") {
15
+ if (ai === "paper") {
16
+ console.log("You lose");
17
+ } else if (ai === "sicssor") {
18
+ console.log("You win");
19
+ } else {
20
+ console.log("It's tie");
21
+ }
22
+ } else if (yourChoice === "paper") {
23
+ if (ai === "paper") {
24
+ console.log("It's tie");
25
+ } else if (ai === "sicssor") {
26
+ console.log("You lose");
27
+ } else {
28
+ console.log("You win");
29
+ }
30
+ } else if (yourChoice === "sicssor") {
31
+ if (ai === "paper") {
32
+ console.log("You win");
33
+ } else if (ai === "sicssor") {
34
+ console.log("It's tie");
35
+ } else {
36
+ console.log("You lose");
37
+ }
38
+ }
39
+ readline.close();
40
+ }
41
+ );