sudoku-svelte Svelte Themes

Sudoku Svelte

A modern Sudoku web app built with Svelte, TailwindCSS, and Vite

Sudoku Svelte

A modern, responsive Sudoku game built with Svelte, TailwindCSS, and Vite.

Features

  • šŸŽ® 4 Difficulty Levels: Easy, Medium, Hard, Expert
  • ā±ļø Timer: Track your solving time with pause/resume
  • šŸ“ Notes Mode: Toggle pencil marks for candidates
  • ā†©ļø Undo: Revert your last moves (up to 50 steps)
  • šŸŽÆ Smart Highlighting: See related cells and same numbers
  • āŒ Error Detection: Invalid placements are highlighted
  • āŒØļø Keyboard Support: Full keyboard navigation and input
  • šŸ“± Responsive: Works on desktop and mobile
  • šŸŽØ Dark Theme: Easy on the eyes

Getting Started

Prerequisites

  • Node.js 18+
  • npm or pnpm

Installation

# Clone the repository
git clone https://github.com/lingster/sudoku-svelte.git
cd sudoku-svelte

# Install dependencies
npm install

# Start development server
npm run dev

Build for Production

npm run build
npm run preview  # Preview the build

How to Play

  1. Click a cell to select it
  2. Enter a number (1-9) to fill the cell
  3. Press N to toggle notes mode for pencil marks
  4. Use arrow keys to navigate between cells
  5. Press Backspace or Delete to clear a cell
  6. Press Ctrl+Z to undo

Keyboard Shortcuts

Key Action
1-9 Enter number
0, Delete, Backspace Clear cell
N Toggle notes mode
Ctrl+Z Undo
Arrow keys Navigate cells
Escape Deselect cell

Tech Stack

Project Structure

src/
ā”œā”€ā”€ lib/
│   ā”œā”€ā”€ sudoku.ts       # Game logic & puzzle generation
│   ā”œā”€ā”€ store.ts        # Svelte stores for state management
│   ā”œā”€ā”€ Board.svelte    # Game board component
│   ā”œā”€ā”€ Cell.svelte     # Individual cell component
│   ā”œā”€ā”€ NumberPad.svelte # Number input buttons
│   ā”œā”€ā”€ Timer.svelte    # Game timer
│   ā”œā”€ā”€ GameControls.svelte # Difficulty buttons
│   └── WinModal.svelte # Victory modal
ā”œā”€ā”€ App.svelte          # Main app component
ā”œā”€ā”€ main.ts             # Entry point
└── app.css             # Global styles

License

MIT

Top categories

Loading Svelte Themes