npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sudoku-0f

v1.0.0

Published

16x16 Sudoku generator with hex display (0-F)

Readme

Sudoku-0F

A fast 16x16 Sudoku generator for Node.js with TypeScript support.

Features

  • Generate complete 16x16 Sudoku grids
  • Generate solvable puzzles with empty cells (4 difficulty levels)
  • Hex display (0-F) for compact representation
  • TypeScript support with full type definitions
  • Command-line interface with puzzle generation
  • Grid validation and puzzle solvability verification
  • Hex string conversion utilities

Installation

npm install sudoku-0f

Browser Usage

For browser usage, the package includes a browser-compatible build:

<script src="node_modules/sudoku-0f/dist/index.browser.js"></script>
<script>
  // All functions are available globally
  const puzzle = generateSudokuPuzzle({ difficulty: 'medium' });
  console.log('Empty cells:', puzzle.emptyCells);
</script>

Or with a module bundler:

import { generateSudoku16, generateSudokuPuzzle } from 'sudoku-0f/dist/index.browser.js';

Usage

Basic Generation

import { generateSudoku16, printSudoku16 } from 'sudoku-0f';

const result = generateSudoku16();
if (result.isValid) {
    printSudoku16(result.grid);
    console.log(`Generated in ${result.generationTime}ms`);
}

Puzzle Generation

import { generateSudokuPuzzle, printSudokuPuzzle } from 'sudoku-0f';

// Generate a medium difficulty puzzle
const puzzle = generateSudokuPuzzle({ difficulty: 'medium' });
if (puzzle.isValid) {
    printSudokuPuzzle(puzzle);
    console.log(`Empty cells: ${puzzle.emptyCells}`);
}

Class-based Usage

import { Sudoku16Generator } from 'sudoku-0f';

const generator = new Sudoku16Generator();

// Generate complete grid
const result = generator.generate();

// Generate puzzle
const puzzle = generator.generatePuzzle({ difficulty: 'hard' });

// Print with different options
console.log(Sudoku16Generator.printGrid(result.grid, { compact: true }));

Hex Conversion

import { Sudoku16Generator } from 'sudoku-0f';

const grid = /* your 16x16 grid */;

// Convert to hex string
const hexString = Sudoku16Generator.gridToHex(grid);

// Convert back to grid
const restoredGrid = Sudoku16Generator.hexToGrid(hexString);

Command Line

# Generate complete grids
npx sudoku-0f                    # Generate 1 complete grid
npx sudoku-0f 3                  # Generate 3 complete grids
npx sudoku-0f 1 --compact        # Generate 1 grid (compact display)

# Generate puzzles
npx sudoku-0f puzzle                    # Generate 1 medium puzzle
npx sudoku-0f puzzle easy 2             # Generate 2 easy puzzles
npx sudoku-0f puzzle hard --compact     # Generate 1 hard puzzle (compact)
npx sudoku-0f puzzle expert --solution  # Generate 1 expert puzzle with solution

# Show help
npx sudoku-0f --help

Difficulty Levels:

  • easy: ~60-80 empty cells
  • medium: ~80-100 empty cells (default)
  • hard: ~100-120 empty cells
  • expert: ~120-140 empty cells

API Reference

generateSudoku16(options?): SudokuGrid

Generate a complete 16x16 Sudoku grid.

Parameters:

  • options.maxAttempts (number): Maximum generation attempts (default: 1)

Returns:

  • grid: 16x16 array of numbers (1-16, 0 for empty)
  • isValid: boolean indicating if generation succeeded
  • generationTime: generation time in milliseconds

generateSudokuPuzzle(options?): SudokuPuzzle

Generate a solvable 16x16 Sudoku puzzle with empty cells.

Parameters:

  • options.difficulty (string): 'easy', 'medium', 'hard', or 'expert' (default: 'medium')
  • options.maxAttempts (number): Maximum generation attempts (default: 10)

Returns:

  • puzzle: 16x16 array with empty cells (0)
  • solution: Complete solution grid
  • difficulty: Difficulty level used
  • isValid: boolean indicating if generation succeeded
  • generationTime: generation time in milliseconds
  • emptyCells: number of empty cells in the puzzle

Sudoku16Generator.printGrid(grid, options?): string

Format a grid for display.

Parameters:

  • grid: 16x16 number array
  • options.compact: boolean for compact display (default: false)

printSudokuPuzzle(puzzle, showSolution?, compact?): void

Print a puzzle with optional solution display.

Parameters:

  • puzzle: SudokuPuzzle object
  • showSolution: boolean to show solution (default: false)
  • compact: boolean for compact display (default: false)

validateSudoku16(grid): boolean

Validate a 16x16 Sudoku grid.

Performance

Typical generation times: 1-20ms on modern hardware.

License

MIT