From 2e0597d4a416d598af95846ce68af1bf6cb059d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Thu, 4 Jun 2026 18:29:54 +0300 Subject: [PATCH] set state --- src/game.dart | 2 +- src/main.dart | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/game.dart b/src/game.dart index 3ba2635..c1d7a01 100644 --- a/src/game.dart +++ b/src/game.dart @@ -244,7 +244,7 @@ extension WordUtils on Word { /// but where each [Letter] has new a [HitType] of /// [HitType.hit], [HitType.partial], or [HitType.miss]. Word evaluateGuess(Word hiddenWord) { - assert(isLegalGuess); + //assert(isLegalGuess); final result = List.filled(length, (char: '', type: HitType.none)); // Counts hidden-word letters that can still be claimed as partial matches. diff --git a/src/main.dart b/src/main.dart index 7c967a7..ed4a92c 100644 --- a/src/main.dart +++ b/src/main.dart @@ -6,9 +6,13 @@ void main() { runApp(const MainApp()); } -class GamePage extends StatelessWidget { +class GamePage extends StatefulWidget { GamePage({super.key}); + + @override State createState() => GamePageState(); +} +class GamePageState extends State { final Game _game = Game(); @override @@ -29,6 +33,9 @@ class GamePage extends StatelessWidget { GuessInput( onSubmitGuess: (guess) { /**/print(guess); + setState(() { + _game.guess(guess); + }); } ), ],