Răsfoiți Sursa

refactor: stop writing colors to word-bank files from solvers

All 4 solvers now push only {guess} into replay steps.
Colors are computed client-side at render time.
Oleg Panashchenko 1 săptămână în urmă
părinte
comite
19cd6d1466
6 a modificat fișierele cu 238 adăugiri și 1358 ștergeri
  1. 119 686
      data/word-bank-ru.json
  2. 115 668
      data/word-bank.json
  3. 1 1
      solver/src/entropy.ts
  4. 1 1
      solver/src/frequency.ts
  5. 1 1
      solver/src/greedy.ts
  6. 1 1
      solver/src/vowel-first.ts

Fișier diff suprimat deoarece este prea mare
+ 119 - 686
data/word-bank-ru.json


Fișier diff suprimat deoarece este prea mare
+ 115 - 668
data/word-bank.json


+ 1 - 1
solver/src/entropy.ts

@@ -45,7 +45,7 @@ export function solveEntropy(target: string, allWords: string[], maxAttempts = 6
     }
 
     const fb = getFeedback(target, bestGuess);
-    steps.push({ guess: bestGuess, colors: fb.split('') });
+    steps.push({ guess: bestGuess });
 
     if (fb === 'ggggg') return { attempts: attempt, steps };
 

+ 1 - 1
solver/src/frequency.ts

@@ -36,7 +36,7 @@ export function solveFrequency(target: string, allWords: string[], maxAttempts =
     for (const g of pool) { const s = scoreWord(g, freq); if (s > bestScore) { bestScore = s; bestGuess = g; } }
 
     const fb = getFeedback(target, bestGuess);
-    steps.push({ guess: bestGuess, colors: fb.split('') });
+    steps.push({ guess: bestGuess });
     if (fb === 'ggggg') return { attempts: attempt, steps };
 
     candidates = candidates.filter((c) => getFeedback(c, bestGuess) === fb);

+ 1 - 1
solver/src/greedy.ts

@@ -20,7 +20,7 @@ export function solveGreedy(target: string, allWords: string[], maxAttempts = 6)
   for (let attempt = 1; attempt <= maxAttempts; attempt++) {
     const guess = attempt === 1 ? (STARTERS.find((w) => allWords.includes(w)) ?? allWords[0]) : candidates[0];
     const fb = getFeedback(target, guess);
-    steps.push({ guess, colors: fb.split('') });
+    steps.push({ guess });
     if (fb === 'ggggg') return { attempts: attempt, steps };
 
     candidates = candidates.filter((c) => matchesFeedback(c, guess, fb));

+ 1 - 1
solver/src/vowel-first.ts

@@ -40,7 +40,7 @@ export function solveVowelFirst(target: string, allWords: string[], maxAttempts
     }
 
     const fb = getFeedback(target, bestGuess);
-    steps.push({ guess: bestGuess, colors: fb.split('') });
+    steps.push({ guess: bestGuess });
     if (fb === 'ggggg') return { attempts: attempt, steps };
 
     for (let i = 0; i < 5; i++) { if ((fb[i] === 'g' || fb[i] === 'y') && VOWELS.has(bestGuess[i])) knownVowels.add(bestGuess[i]); }

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff