-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadjexercise1.js
More file actions
36 lines (32 loc) · 795 Bytes
/
adjexercise1.js
File metadata and controls
36 lines (32 loc) · 795 Bytes
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
28
29
30
31
32
33
34
35
36
/**
*
* @authors Your Name (you@example.org)
* @date 2018-06-03 22:19:56
* @version $Id$
*/
function winBattle(bool){
return bool;
}
var experiencePoints = winBattle(ture) ? "10" : "1" ;
function moveCommand(direction) {
var whatHappens;
switch (direction) {
case "forward":
break;
whatHappens = "you encounter a monster";
case "back":
whatHappens = "you arrived home";
break;
break;
case "right":
return whatHappens = "you found a river";
break;
case "left":
break;
whatHappens = "you run into a troll";
break;
default:
whatHappens = "please enter a valid direction";
}
return whatHappens;
}