Skip to content

Commit

Permalink
Changed package name
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Ferentz committed Jan 17, 2024
1 parent fc034bd commit b5a2b1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vite-template-solid",
"version": "0.0.0",
"name": "solidoku",
"version": "0.2.0",
"description": "",
"scripts": {
"start": "vite",
Expand Down
15 changes: 7 additions & 8 deletions src/GameContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@ import styles from './GameContainer.module.css'
import { boardStore, solutionStore } from './stores/GameStore'
import { generateSudoku } from './game/generate'




const { solution, setSolution } = solutionStore
const { board, setBoard } = boardStore
const [selected, setSelected] = createSignal<{ x: number; y: number } | null>(null)
export const GameContainer = () => {
onMount(()=>{
onMount(() => {
const game = generateSudoku('Easy')
setSolution(game.solution)
setBoard(game.puzzle)
})

const validateGuess = (row: number, col: number) => {
return (guess: number) => {
const solutionValue = solution[row][col]
Expand All @@ -29,9 +26,11 @@ export const GameContainer = () => {
}

const isSolved = () => board.flatMap((m) => m).every((m) => !!m)
createEffect(()=>{
if(isSolved()) {
alert('Yay! You did it!')
createEffect(() => {
if (isSolved()) {
setTimeout(() => {
alert('Yay! You did it!')
}, 1000)
}
})

Expand Down

0 comments on commit b5a2b1a

Please sign in to comment.