Reset the game state.
()
| 40 | |
| 41 | /** Reset the game state. */ |
| 42 | async function reset() { |
| 43 | if (game == null) { |
| 44 | return; |
| 45 | } |
| 46 | game.reset(); |
| 47 | await calcQValuesAndBestAction(); |
| 48 | renderSnakeGame(gameCanvas, game, |
| 49 | showQValuesCheckbox.checked ? currentQValues : null); |
| 50 | gameStatusSpan.textContent = 'Game started.'; |
| 51 | stepButton.disabled = false; |
| 52 | autoPlayStopButton.disabled = false; |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Play a game for one step. |
no test coverage detected