-
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathboardGameLogic
More file actions
27 lines (22 loc) · 594 Bytes
/
boardGameLogic
File metadata and controls
27 lines (22 loc) · 594 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
/*
You are creating a text-based terminal version of your favorite board game. In the board game, each turn has six steps that must happen in this order: roll the dice, move, combat, get coins, buy more health, and print status.
You are using a library that already has the functions below. Create a function named main that calls the functions in the proper order.
- combat
- buyHealth
- getCoins
- printStatus
- rollDice
- move
*/
//Answer//
var health = 100
var position = 0
var coins = 0
function main () {
rollDice()
move()
combat()
getCoins()
buyHealth()
printStatus()
}