diff --git a/src/Game.svelte b/src/Game.svelte index d77fa24..db0132e 100644 --- a/src/Game.svelte +++ b/src/Game.svelte @@ -23,6 +23,10 @@ let word_position = 0; let wins = false; let endgame = false; + + let green_letters: string[] = []; + let yellow_letters: string[] = []; + let unfit_letters: string[] = []; setTimeout(() => { setGameState({ @@ -32,7 +36,10 @@ current_guess, word_position, wins, - endgame + endgame, + green_letters, + yellow_letters, + unfit_letters }); }, 500) @@ -52,10 +59,6 @@ let not_a_word = false; let game_creator = false; - let green_letters: string[] = []; - let yellow_letters: string[] = []; - let unfit_letters: string[] = []; - ( function() { const urlprops = new URLSearchParams(window.location.search); diff --git a/src/lib/scriptinterface.ts b/src/lib/scriptinterface.ts index 625d2f2..e69a7c2 100644 --- a/src/lib/scriptinterface.ts +++ b/src/lib/scriptinterface.ts @@ -8,13 +8,16 @@ export function allowScripts() { } export class GameState { - word?: string; - guesses?: number; - guessed?: string[][]; - current_guess?: number; - word_position?: number; - wins?: boolean; - endgame?: boolean; + word?: string; + guesses?: number; + guessed?: string[][]; + current_guess?: number; + word_position?: number; + wins?: boolean; + endgame?: boolean; + green_letters?: string[]; + yellow_letters?: string[]; + unfit_letters?: string[]; } export class WordleLibrary {