Drupal is a registered trademark of Dries Buytaert

sudoku_gen

No security coverage
View on drupal.org

Sudoku is a Drupal 10/11 module that introduces a fully functional Sudoku puzzle content entity. It allows users to create, edit, view, and solve Sudoku puzzles directly within Drupal. The module is both a fun interactive demo of Drupal’s modern APIs and a foundation for anyone building puzzle, game, or educational content systems.

It demonstrates extensive use of Drupal’s Entity API, Form API, AJAX framework, and menu/routing system, while providing a playable Sudoku experience right in your site.

Each Sudoku puzzle includes a grid editor for entering or generating puzzles, automatic JSON serialization for storage, and AJAX-based puzzle generation and solving. After saving a puzzle, users can view it rendered in a styled grid, with optional “Edit” and “Delete” links available to users with appropriate permissions.

The project’s goal is twofold:

  1. To serve as a practical puzzle module that demonstrates Drupal’s flexibility for building game-like applications.
  2. To act as a developer showcase for implementing modern Drupal APIs in a compact, easy-to-understand module.

Features

Custom content entity (sudoku)

  • Adds a new entity type for managing Sudoku puzzles, fully integrated into Drupal’s content administration interface.

Add, Edit, and Delete forms

  • Includes full CRUD support with entity forms that serialize puzzle data automatically.

Interactive grid editor

  • Each puzzle provides a 9×9 grid of input fields for entering numbers, with client-side validation.

AJAX-powered puzzle generation and solving

  • “Generate” and “Solve” buttons dynamically fill or validate the grid without reloading the page.

Custom view renderer

  • Displays Sudoku puzzles in a clean, CSS-styled grid on the canonical entity view page.

Admin listing page

  • Accessible under Content → Sudoku puzzles, with sortable columns for quick management.

Granular permissions

  • Define who can view, create, edit, and delete Sudoku puzzles.

Example of advanced Drupal APIs

  • Makes use of core APIs including the Entity API, Form API, AJAX API, Library API, and routing system — ideal for developers learning Drupal internals.

Post-Installation

Once installed, look under "Content" for "Sudoku puzzles". Clicking on this item will list all Sudoku puzzle entities currently stored on your site. Navigating one level lower to "Add" will create a new puzzle entity, where you can generate a puzzle of varying difficulty, solve the puzzle, and save or delete the entity.

Activity

Total releases
1
First release
Oct 2025
Latest release
4 months ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
1.0.x-dev Dev Oct 11, 2025