(10/10)
Pro Access Required
This is a premium lesson. Upgrade to Pro to unlock this interactive exercise and continue your learning journey.
πJavaScript
Intermediate Project
0 WPM
0% Accuracy
0:00 Time elapsed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function start_game() {β΅
let room = 'start';β΅
while (room != 'end') {β΅
if (room == 'start') {β΅
console.log('you are in a dark room. there is a door to the north.');β΅
let choice = prompt('> ');β΅
if (choice == 'north') {β΅
room = 'treasure';β΅
}β΅
} else if (room == 'treasure') {β΅
console.log('you found the treasure room. you win');β΅
room = 'end';β΅
}β΅
}β΅
}β΅
β΅
start_game();
0 / 478
Press This!
π
`~
1!
2@
3#
4$
5%
6^
7&
8*
9(
0)
-_
=+
β«
β₯
Q
W
E
R
T
Y
U
I
O
P
[{
]}
\|
βͺ
A
S
D
G
H
J
K
L
;:
'"
β΅
β§
Z
X
C
V
B
N
M
,<
.>
/?
β§
Thumb
Index
Middle
Ring
Pinky