set state
This commit is contained in:
1 parent
fd45f1a2bb
commit
2e0597d4a4
2 files changed
+9
-2
No files matched your search
+1
-1
@@ -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<Letter>.filled(length, (char: '', type: HitType.none));
|
||||
// Counts hidden-word letters that can still be claimed as partial matches.
|
||||
|
||||
+8
-1
@@ -6,9 +6,13 @@ void main() {
|
||||
runApp(const MainApp());
|
||||
}
|
||||
|
||||
class GamePage extends StatelessWidget {
|
||||
class GamePage extends StatefulWidget {
|
||||
GamePage({super.key});
|
||||
|
||||
@override State<GamePage> createState() => GamePageState();
|
||||
}
|
||||
|
||||
class GamePageState extends State<GamePage> {
|
||||
final Game _game = Game();
|
||||
|
||||
@override
|
||||
@@ -29,6 +33,9 @@ class GamePage extends StatelessWidget {
|
||||
GuessInput(
|
||||
onSubmitGuess: (guess) {
|
||||
/**/print(guess);
|
||||
setState(() {
|
||||
_game.guess(guess);
|
||||
});
|
||||
}
|
||||
),
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user