A comprehensive web application that analyzes mahjong hands and provides detailed scoring based on Japanese mahjong rules. Input your tiles manually and get instant analysis of yaku patterns, hand validation, and scoring results.
- Text-Based Input: Enter mahjong tiles manually using a simple format
- Quick Input Buttons: Click buttons for individual tiles (1m, 2m, 3m, etc.)
- Example Hands: Pre-built examples of winning hands to test the system
- Comprehensive Yaku Detection: Recognizes 20+ different scoring patterns
- Proper Hand Validation: Ensures hands meet mahjong requirements (4 sets + 1 pair)
- Detailed Scoring: Shows total han, individual yaku, and point values
- Modern UI: Clean, responsive design that works on both desktop and mobile
- Instant Results: No server required - all processing happens in the browser
Mahjong-Scorer-/
├── index.html # Main HTML page with input interface
├── styles.css # Modern styling with responsive design
├── script.js # Comprehensive mahjong logic and scoring
└── README.md # This file
- Open the HTML file in a modern web browser
- Enter your tiles manually or use the quick input buttons
- Click example buttons to see pre-built winning hands
- Click "Analyze & Score Hand" to get detailed results
- View scoring breakdown including yaku patterns and total han
- Numbers + Suit:
1m(1 of man),5p(5 of pin),3s(3 of sou) - Winds:
E(East),S(South),W(West),N(North) - Dragons:
rd(red dragon),wd(white dragon),gd(green dragon)
- Seven Pairs:
1m 1m 2m 2m 3m 3m 4m 4m 5m 5m 6m 6m 7m 7m - Thirteen Orphans:
1m 9m 1p 9p 1s 9s E S W N rd wd gd 1m - Standard Hand:
1m 2m 3m 4m 5m 6m 7m 8m 9m 1p 2p 3p 4p 5p
- Thirteen Orphans (Kokushi Musou)
- Four Concealed Triplets (Suuankou)
- Big Four Winds (Daisuushii)
- Big Three Dragons (Daisangen)
- All Green (Ryuuiisou)
- All Terminals (Chuurenpoutou)
- Nine Gates (Chuurenpoutou)
- Little Four Winds (Shousuushii)
- Little Three Dragons (Shousangen)
- Seven Pairs (Chiitoi)
- All Honors (Tsuuiisou)
- All Terminals (Chinroutou)
- Tanyao (All Simples) - 1 han
- Yakuhai (Honor Tiles) - 1 han
- Pinfu (All Sequences) - 1 han
- Iipeikou (Identical Sequences) - 1 han
- Chanta (Terminal or Honor in Each Set) - 1 han
- Sanshoku Doujun (Three Color Straight) - 1 han
- Ittsu (Straight) - 1 han
- Toitoi (All Triplets) - 2 han
- Sanankou (Three Concealed Triplets) - 2 han
- Sanshoku Doukou (Three Color Triplets) - 2 han
- Honitsu (Half Flush) - 3 han
- Chinitsu (Flush) - 6 han
- HTML5: Semantic markup with intuitive input interface
- CSS3: Modern styling with gradients, animations, and responsive design
- JavaScript ES6+: Class-based architecture with comprehensive mahjong logic
- Web APIs: Local processing with no external dependencies
- Structure Check: Validates 4 sets + 1 pair formation
- Set Recognition: Identifies triplets and sequences
- Yaku Detection: Scans for scoring patterns
- Scoring Calculation: Converts han to points using standard mahjong rules
- Input Tiles: Type tiles manually or use quick input buttons
- Load Examples: Click example buttons to see winning hand patterns
- Analysis: Click "Analyze & Score Hand" for instant results
- Results: View detailed breakdown of yaku, han, and scoring
- Feedback: Get specific guidance on non-winning hands
- Comprehensive tile input system with quick buttons
- 20+ yaku pattern detection
- Proper hand structure validation (4 sets + 1 pair)
- Accurate scoring based on Japanese mahjong rules
- Example hands for testing and learning
- Beautiful, responsive UI design
- Instant analysis and scoring results
- Detailed feedback for non-winning hands
- Add more advanced yaku patterns
- Implement dora (bonus tile) detection
- Add hand history and statistics
- Improve sequence detection algorithms
- Add multiplayer scoring comparison
- Valid Structure: Exactly 4 sets + 1 pair, OR special patterns
- Valid Sets: Each set must be either:
- Triplet: 3 identical tiles (e.g.,
1m 1m 1m) - Sequence: 3 consecutive numbers of same suit (e.g.,
1m 2m 3m)
- Triplet: 3 identical tiles (e.g.,
- Valid Pair: 2 identical tiles
- Yaku Required: Must contain at least one scoring pattern
- Invalid Hand Structure: Tiles can't form 4 sets + 1 pair
- Valid Hand (No Yaku): Correct structure but no scoring patterns
- Chrome/Edge: Full support
- Firefox: Full support
- Safari: Full support (iOS 11+)
- Mobile Browsers: Responsive design with touch-friendly controls
- Frontend-only application: No backend server required
- Local processing: All analysis happens in the browser
- No external dependencies: Works completely offline
- Real mahjong rules: Based on Japanese mahjong scoring system
- Ensure you have exactly 14 tiles
- Use correct tile format (e.g.,
1m, not1or1M) - Check that tiles can form valid sets and pairs
- Make sure you're using a modern browser
- Check that JavaScript is enabled
- Try the example hands to verify the system is working
Happy Mahjong Scoring! Test your hands and discover all the yaku patterns!