added ai!

This commit is contained in:
RezHackXYZ 2025-05-25 12:28:14 +05:30
parent ad959266a5
commit d1c8ae269b
No known key found for this signature in database
15 changed files with 311 additions and 146 deletions

View file

@ -1,9 +1,7 @@
import { createGame } from "./InsertGameInDB.js";
import { questions } from "./GameCreateData.svelte.js";
import { questions,Wait } from "./GameCreateData.svelte.js";
export async function startGame() {
if (questions.v.some((q) => q.name === "")) return alert("Please fill all questions");
if (questions.v.some((q) => q.answers.some((a) => a === ""))) return alert("Fill all options");
if (questions.v.some((q) => q.correctAnswer === undefined))
@ -13,7 +11,6 @@ export async function startGame() {
.toString()
.padStart(6, "0");
await createGame(questions.v, gamePin);
Wait.v = true;
window.location.href = "/host/" + gamePin;
}
await createGame(questions.v, gamePin);}