@tech4teachers/

samgame22

Nodejs

No description

fork
loading
Files
  • index.js
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

function room1(){
  while (location== "room1"){
  console.log("you awaken in the basement");
  var room1c=prompt("go upstaris or explore")};
  if (room1c=="upstairs"){
    var location="room2";
    console.log("you are in the burned out house");
    room2c=prompt("you can go outside or explore");
  }
else if (room1c=="explore"){
  location="room1";
  console.log("you found a whiffle bat and a cheese sandwhich");
  room1()
  
}}

console.log("welcome to the game");
choice1=prompt("play or quit");
//gameOn="";
if (choice1=="play"){room1()}
else{
console.log("sorry you don't want to play")
}
var location="room1";
var choice="";
node v10.16.0