Skip to content

Commit 9b2388d

Browse files
committed
feat: adding player moves and correct moves verifier
1 parent 9d1ae45 commit 9b2388d

File tree

1 file changed

+5
-0
lines changed
  • workspaces/simon-game/src/app/components

1 file changed

+5
-0
lines changed

workspaces/simon-game/src/app/components/App.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ import { Box } from "./Box.tsx";
44
import { playNote } from "../util/playNote.ts";
55
import { config } from "../constants.ts";
66

7+
function isSequenceCorrect(check: number[], correct: number[]): boolean {
8+
return check.every((element, i) => element === correct[i]);
9+
}
10+
711
export function App() {
812
const [playerMoves, setPlayerMoves] = useState<readonly number[]>([]);
13+
console.log(isSequenceCorrect);
914
return (
1015
<>
1116
<div style={{ display: "flex", gap: 10 }}>

0 commit comments

Comments
 (0)