Workshop › Battleship › Step 7 of 35
The game has two fleets: the enemy's and yours. reset() places both at random, and it runs once at the start.
```js
let enemyFleet // ships: { cells: [[r, c], ...] }
let myFleet
function reset() {
enemyFleet = placeFleet()
myFleet = placeFleet()
}
reset()
```enemyFleet and myFleet are two separate random fleets.reset() is called once, just before the loop starts.const grid, write the two let lines, followed by an empty line.function drawSea(, write reset, followed by an empty line.reset() just above the last requestAnimationFrame(loop).Skills: Game states
← A random fleet Which ship is here? →