diff --git a/frontend/src/components/Checkpoint/checkpoint.ts b/frontend/src/components/Checkpoint/checkpoint.ts index 09d1b47..fc66a11 100644 --- a/frontend/src/components/Checkpoint/checkpoint.ts +++ b/frontend/src/components/Checkpoint/checkpoint.ts @@ -10,7 +10,6 @@ export async function add(id: string) { v = new Set(); } v.add(id); - console.log("updated", {v}); return v; }, store); await callSubscribed(level); @@ -23,7 +22,7 @@ export async function remove(id: string) { v = new Set(); } v.delete(id); - v.delete(`${level}-confetti`); + v.delete(`${level}-completed`); return v; }, store); await callSubscribed(level); diff --git a/frontend/src/components/Feedback/Feedback.ts b/frontend/src/components/Feedback/Feedback.ts index d040111..c92153a 100644 --- a/frontend/src/components/Feedback/Feedback.ts +++ b/frontend/src/components/Feedback/Feedback.ts @@ -18,9 +18,7 @@ export class FeedbackElement extends HTMLElement { form.querySelector("#review") as HTMLTextAreaElement ).value.trim(), }; - - console.log(data); - + await fetch("http://rust-quest.garriga.dev", { method: "POST", headers: { diff --git a/frontend/src/components/LanguageDetector.astro b/frontend/src/components/LanguageDetector.astro index 31f7581..f0166d3 100644 --- a/frontend/src/components/LanguageDetector.astro +++ b/frontend/src/components/LanguageDetector.astro @@ -4,11 +4,6 @@ const preferred = navigator.languages; for (const l of preferred) { if (Object.keys(langs).includes(l)) { - console.log({ - base: import.meta.env.BASE_URL, - location: window.location, - origin: window.location.origin, - }); window.location.href = window.location.origin + import.meta.env.BASE_URL + `${l}`; break; diff --git a/frontend/src/components/Progress.astro b/frontend/src/components/Progress.astro index 00cd0d0..0bfdec2 100644 --- a/frontend/src/components/Progress.astro +++ b/frontend/src/components/Progress.astro @@ -11,7 +11,7 @@ type Props = { const { id, total, confetti = true } = Astro.props; --- - + @@ -79,14 +79,14 @@ const { id, total, confetti = true } = Astro.props; const value = checkpoint.size < total ? checkpoint.size : total; label.innerText = `${value} / ${total}`; progress.value = value; - const confettiId = `${id}-confetti`; if (value !== total) { return; } - if (launchConfetti && !checkpoint.has(confettiId)) { + const completedId = `${id}-completed` + if (launchConfetti && !checkpoint.has(completedId)) { confetti(); - add(confettiId); } + add(completedId); }); const feedback = this.querySelector("dialog")!; diff --git a/frontend/src/components/RobotGame/RobotGame.ts b/frontend/src/components/RobotGame/RobotGame.ts index 6d7d8f4..5da3110 100644 --- a/frontend/src/components/RobotGame/RobotGame.ts +++ b/frontend/src/components/RobotGame/RobotGame.ts @@ -66,8 +66,8 @@ export class RobotGame extends HTMLElement { this.codeblock.setRunning(false); return Promise.reject(); } - - const responses: [EvalResponse, Board][] = await Promise.all( + + const responses: [Promise, Board][] = await Promise.all( this.boards.map(async (board) => { const { rows, cols, start, enemies } = board; await this.setupCodeBlock( @@ -77,14 +77,12 @@ export class RobotGame extends HTMLElement { enemies, this.functions, ); - - const response = await this.codeblock.evaluateSnippet(value); + + const response = this.codeblock.evaluateSnippet(value); return [response, board]; }), ); - - console.log({ robotResponses: responses }); - + const simulationError = async () => { this.codeblock.setOutput( "There was an error during the simulation, please try again.", @@ -101,7 +99,8 @@ export class RobotGame extends HTMLElement { return simulationError(); } - for (const [response, board] of responses) { + for (const [r, board] of responses) { + const response = await r; if (typeof response !== "string") { return simulationError(); } @@ -253,8 +252,6 @@ export class RobotGame extends HTMLElement { await wait(150); } - console.log({ killedEnemies, numEnemies: board.numEnemies }); - if (killedEnemies < board.numEnemies) { return undefined; } diff --git a/frontend/src/content/docs/en/first-steps/5-killing-some-slimes.mdx b/frontend/src/content/docs/en/first-steps/5-killing-some-slimes.mdx index b908c6d..8b998cd 100644 --- a/frontend/src/content/docs/en/first-steps/5-killing-some-slimes.mdx +++ b/frontend/src/content/docs/en/first-steps/5-killing-some-slimes.mdx @@ -55,8 +55,8 @@ More functions will be unlocked once enough monsters are defeated. ##### 2. Usage To kill a monster, just move the robot where it is and the machine will do the rest. -To ensure 100% success rate, multiple simulations will run before executing your program. -**This means that your code must be able to solve ALL the simulations.** +To ensure a 100% success rate, multiple simulations will run before executing your program. +**This means that your code must be able to solve ALL the simulations at the same time.** ##### 3. Legal and Ethical Considerations - Adhere to local laws and regulations governing the use of monster-killing robots.