diff --git a/src/utils/gamecode.ts b/src/utils/gamecode.ts new file mode 100644 index 0000000..5dd1a48 --- /dev/null +++ b/src/utils/gamecode.ts @@ -0,0 +1,10 @@ +export const generate_game_code = (): string => { + let game_code = ``; + + // Generate the game code using the length given + do { + game_code += Math.floor(Math.random() * 9); + } while (game_code.length < 6); + + return game_code +} \ No newline at end of file