diff --git a/src/index.ts b/src/index.ts index 7b3ed0d..6696fb6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -112,6 +112,9 @@ const deleteGame = (game: MancalaGame) => { function createMancalaGame(userKey1: string, userKey2: string) { const game = new CommonMancalaGame(generateKey(), userKey1, userKey2); + const random = Math.random(); + game.turnPlayerId = random > 0.5 ? userKey1 : userKey2; + gameStore.set(userKey1, game); gameStore.set(userKey2, game); return game;