We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a315cef commit 4e7dc3dCopy full SHA for 4e7dc3d
workspaces/simon-game/src/app/components/App.tsx
@@ -4,6 +4,10 @@ import { Box } from "./Box.tsx";
4
import { playNote } from "../util/playNote.ts";
5
import { config } from "../constants.ts";
6
7
+function isSequenceCorrect(check: number[], correct: number[]): boolean {
8
+ return check.every((element, i) => element === correct[i]);
9
+}
10
+
11
type GameState = "pre-game" | "game-over" | "player-turn" | "cpu-turn";
12
13
export function App() {
@@ -12,7 +16,7 @@ export function App() {
16
const [_correctMoves, _setCorrectMoves] = useState<readonly number[]>([
17
0, 1, 2, 3,
14
18
]);
15
-
19
+ console.log(isSequenceCorrect);
20
console.log(_correctMoves, _setCorrectMoves);
21
22
if (gameState === "pre-game") {
0 commit comments