(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
F
G
H
J
K
L
;:
'"
↡
⇧
Z
X
C
V
B
N
M
,<
.>
/?
⇧
Thumb
Index
Middle
Ring
Pinky