This commit is contained in:
RezHackXYZ 2025-06-16 00:05:15 +05:30 committed by GitHub
parent ff726f6ba3
commit d448517fb3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,6 +6,7 @@
import { createGame } from "./createGame.js"; import { createGame } from "./createGame.js";
let userInput = ""; let userInput = "";
let numberOfQuestions;
let AIPrompt = ` let AIPrompt = `
You are the AI of a quiz game. You are the AI of a quiz game.
@ -70,7 +71,7 @@ The User wants [number of questions] questions.
return; return;
} }
const numberOfQuestions = prompt("How many questions? (e.g. 5, not 'five')", "5"); numberOfQuestions = prompt("How many questions? (e.g. 5, not 'five')", "5");
if (isNaN(parseInt(numberOfQuestions)) || numberOfQuestions <= 0) { if (isNaN(parseInt(numberOfQuestions)) || numberOfQuestions <= 0) {
toast.error("Please enter a valid number of questions."); toast.error("Please enter a valid number of questions.");