Unravel word-math puzzles instantly. Our advanced backtracking algorithm
cracks complex equations like SEND + MORE = MONEY effortlessly.
Optimized DFS pruning evaluates thousands of states per second.
Learn the backtracking strategy that powers the engine.
Sleek glassmorphism design with dark & light modes.
Understand the math, rules, and algorithms behind the puzzles.
Cryptarithmetic (also called alphametics) is a type of mathematical puzzle where digits are replaced by letters. The goal is to find a digit for each letter so the resulting arithmetic equation is correct.
Each letter stands for a unique digit (0-9), and the equation must hold true when letters are replaced by their assigned digits.
SEND + MORE = MONEY
IS × SO = TOO
EARTH + AIR + FIRE + WATER = NATURE
Let's walk through the classic puzzle.
Backtracking is a Depth-First Search (DFS) strategy that builds candidates incrementally and abandons a branch as soon as it detects the partial solution is invalid.
function solve(charIndex) {
if (charIndex === chars.length) {
return evaluate(); // check if sum == 0
}
for (digit = 0 to 9) {
if (digit not used AND passes constraints) {
assign(chars[charIndex], digit);
if (solve(charIndex + 1)) return true;
unassign(chars[charIndex]);
}
}
return false; // backtrack
}Pruning optimizations:
A client-side demonstration of backtracking algorithms applied to Cryptarithmetic puzzles.
The solver converts each word into base-10 positional weights per character. It then uses recursive DFS with backtracking, assigning digits 0-9 to unique letters and checking if the weighted sum equals zero. Leading-zero constraints are enforced as pruning steps.
index.html — Structure & contentstyle.css — Styling, animations, themesscript.js — Solver logic, UI interactionsBuilt as a college project to demonstrate the application of Artificial Intelligence and Constraint Satisfaction concepts in a modern, interactive web interface.