--- id: 5d80c3c021b11cdaa3f6b165 title: Part 114 challengeType: 0 --- ## Description
At the end of the code, create a `restart` function. Inside the function, set `xp` to 0, set `health` to 100, set `gold` to 50, set `currentWeapon` to 0, and set `inventory` to `["stick"]`. Also, update the `innerText` properties of `goldText`, `healthText`, and `xpText` to their current values. Finally, call the `goTown()` function. After this step is a good time to test the game so far.
## Instructions
## Tests
```yml tests: - text: See description above for instructions. testString: currentWeapon = 1, inventory = ['stick', 'dagger'], fightSlime(), attack(), defeatMonster(), restart(), assert(xp === 0 && gold === 50 && currentWeapon === 0 && inventory[0] === 'stick' && inventory.length === 1 && goldText.innerText === '50' && healthText.innerText === '100' && xpText.innerText === '0' && text.innerText === 'You are in the town square. You see a sign that says "Store."'); ```
## Challenge Seed
```html ```
### Before Test
```html RPG - Dragon Repeller
XP: 0 Health: 100 Gold: 50
Monster Name: Health:
Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.
```
### After Test
```html ```
## Solution
```html ```