A modern, responsive Progressive Web App (PWA) implementation of the popular KenKen puzzle game. This app generates puzzles dynamically and provides an intuitive interface for solving them on any device.
- Dynamic puzzle creation with customizable grid sizes (3×3 to 6×6)
- Mathematical operators: Addition (+), Subtraction (−), Multiplication (×), Division (÷)
- Three difficulty levels: Easy, Medium, Hard
- Smart cage generation based on difficulty settings
- Progressive Web App (PWA) - works offline and can be installed
- Responsive design - optimized for phones, tablets, and desktops
- Touch-friendly interface with tap-to-select gameplay
- Keyboard support for desktop users
- Interactive number pad showing only valid moves
- Real-time validation with visual feedback
- Smart hint system suggesting optimal moves
- Timer to track solving time
- Visual feedback for correct/incorrect cage completions
- Win celebration with completion time
- Beautiful gradient backgrounds and glassmorphism effects
- Smooth animations and transitions
- Color-coded cages for easy differentiation
- Dark mode support based on system preferences
- Accessibility features with proper contrast and focus indicators
- Fill the grid with numbers from 1 to N (where N is the grid size)
- No repeating numbers in any row or column (like Sudoku)
- Cage constraints: Each outlined region (cage) must satisfy its mathematical constraint
- Single cells: Must contain the exact target number
- Addition (+): Numbers in the cage must sum to the target
- Subtraction (−): The difference between the two numbers equals the target
- Multiplication (×): Numbers in the cage multiply to the target
- Division (÷): One number divided by the other equals the target
- Tap any cell to select it
- Choose a number from the number pad (only valid options are shown)
- Use hints when stuck
- Check solution to validate your progress
- Complete the puzzle to see your time and celebrate!
- Open any modern web browser
- Navigate to the game URL
- The app works immediately - no installation required!
- Open the game in Chrome, Firefox, Safari, or Edge
- Look for the "Install" or "Add to Home Screen" prompt
- Click install to add the app to your device
- Launch from your home screen or app menu
# Clone or download the project files
cd kenken-pwa
# Serve the files using any web server
# Python 3:
python -m http.server 8000
# Python 2:
python -m SimpleHTTPServer 8000
# Node.js (if you have http-server installed):
npx http-server
# Open browser to localhost:8000kenken-pwa/
├── index.html # Main HTML file
├── styles.css # Responsive CSS styles
├── kenken.js # Puzzle generation algorithm
├── app.js # Main application logic
├── manifest.json # PWA manifest
├── sw.js # Service worker for offline support
├── icon-192.png # App icon (192×192)
├── icon-512.png # App icon (512×512)
└── README.md # This file
- Chrome 80+ (Android/iOS/Desktop)
- Firefox 75+ (Android/Desktop)
- Safari 13+ (iOS/macOS)
- Edge 80+ (Windows/macOS)
- Older browsers may lack PWA features but core gameplay still works
- Internet Explorer is not supported
- Vanilla JavaScript - No external dependencies
- CSS Grid & Flexbox - Modern responsive layouts
- Service Worker API - Offline functionality
- Web App Manifest - PWA installation
- localStorage - Game state persistence (future feature)
- Latin Square generation using backtracking
- Cage creation with mathematical constraint calculation
- Difficulty scaling based on cage sizes and complexity
- Validation system for real-time feedback
- Efficient rendering with CSS transforms
- Minimal DOM manipulation for smooth gameplay
- Offline-first design with service worker caching
- Responsive images and optimized assets
Edit the index.html file and add options to the grid-size select:
<option value="7">7×7</option>
<option value="8">8×8</option>Update the cageSizeLimits object in kenken.js:
const cageSizeLimits = {
easy: { min: 1, max: 2, singleCellChance: 0.5 },
// ... add custom difficulties
};Modify styles.css to customize:
- Color schemes
- Animation timings
- Layout proportions
- Typography
This is a complete, standalone implementation that can be easily extended:
- Fork the repository
- Create feature branches for new functionality
- Test on multiple devices and browsers
- Submit pull requests with clear descriptions
- Statistics tracking (solve times, difficulty progression)
- Puzzle sharing via URL encoding
- Multiple themes and color schemes
- Sound effects and haptic feedback
- Achievement system and badges
- Multiplayer mode with WebRTC
This project is open source and available under the MIT License. Feel free to use, modify, and distribute as needed.
- KenKen puzzle concept invented by Tetsuya Miyamoto
- Implementation by [Your Name]
- Icons and graphics can be customized as needed
- Inspired by traditional pen-and-paper KenKen puzzles
Enjoy playing KenKen! 🧩✨