From 9a112c476ebd58e40301f1dc9b33b837641089f7 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Fri, 28 Jan 2022 20:45:21 +0700 Subject: [PATCH 1/2] random guess button not dictionary-based, sadly - performance problems --- src/App.css | 3 ++- src/Game.tsx | 2 ++ src/RandomGuess.tsx | 28 ++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/RandomGuess.tsx diff --git a/src/App.css b/src/App.css index 325af74ba..11723eae4 100644 --- a/src/App.css +++ b/src/App.css @@ -95,7 +95,8 @@ table.Game-rows > tbody { justify-content: stretch; } -.Game-keyboard-button { +.Game-keyboard-button, +.Game-random-guess { margin: 2px; background-color: #cdcdcd; padding: 2px; diff --git a/src/Game.tsx b/src/Game.tsx index 89a63b8b7..9cbac9684 100644 --- a/src/Game.tsx +++ b/src/Game.tsx @@ -3,6 +3,7 @@ import { Row, RowState } from "./Row"; import dictionary from "./dictionary.json"; import { Clue, clue, describeClue, violation } from "./clue"; import { Keyboard } from "./Keyboard"; +import { RandomGuess } from "./RandomGuess"; import targetList from "./targets.json"; import { dictionarySet, @@ -287,6 +288,7 @@ function Game(props: GameProps) { letterInfo={letterInfo} onKey={onKey} /> + {gameState !== GameState.Playing && (