Some QOL improvements:
All checks were successful
/ publish (push) Successful in 1m16s

- Added subtle highliting of attempted letters
- Using correct backspace character
- Reduced header size a little
- Added a "define" button to show word definition
This commit is contained in:
Leon Mika 2025-01-26 10:19:06 +11:00
parent f9b1457dea
commit 5b79c43551
5 changed files with 95 additions and 27 deletions

View file

@ -7,7 +7,8 @@ export const GUESS_RESULT = {
export const MARKERS = {
MISS: 'm',
RIGHT_POS: 'g',
RIGHT_CHAR: 'y'
RIGHT_CHAR: 'y',
ATTEMPTED: 'a',
};
class ProgressionState {
@ -87,7 +88,13 @@ export class GameController {
if (this._currentWord.length <= 5) {
if (!this._wordSource.isWord(guess)) {
hits = {};
for (let i = 0; i < guess.length; i++) {
hits[guess[i]] = MARKERS.ATTEMPTED;
}
return {
hits: hits,
guessResult: GUESS_RESULT.FOUL,
};
}