* Collects one random play of the game. Processes the sample to generate * features and labels representation of the play. Calls a UI method to render * the sample and the processed sample. * @param {bool} wantNewGame : If true, a new game is generated.
(wantNewGame)
| 72 | * @param {bool} wantNewGame : If true, a new game is generated. |
| 73 | */ |
| 74 | async function simulateGameHandler(wantNewGame) { |
| 75 | if (wantNewGame) { |
| 76 | SAMPLE_GAME_STATE = game.generateOnePlay(); |
| 77 | } |
| 78 | const featuresAndLabel = gameToFeaturesAndLabel(SAMPLE_GAME_STATE); |
| 79 | ui.displaySimulation(SAMPLE_GAME_STATE, featuresAndLabel); |
| 80 | ui.displayNumSimulationsSoFar(); |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * This is pulled into a separate function to isolate the async code. |
no test coverage detected