Python

Banagrams Solver

bananagrams hands you a fistful of letter tiles and one instruction: arrange all of them into a connected crossword before anyone else does. 𐃏 this page documents the real solver living in this repo at static/code/bananagrams/ — a haskell heuristic search in haskell-imp/ plus a playable js incarnation served at /code/bananagrams/ on this site — rather than a from-scratch design; a compact python reference solver (trie + backtracking) is developed at the end to make the algorithmic skeleton explicit.

Read more >

Hashiwokakero (Bridges) Solver

hashiwokakero (“build bridges”, nikoli) hands you a grid of numbered islands and asks you to join them with bridges until every number is spent. it is the friendliest possible introduction to constraint satisfaction: the constraints are few and visual, propagation alone solves most human-published puzzles, and when it doesn’t, you get to write a backtracking search. this page documents my solver at code/private/hashi/ — a go rewrite of a uni assignment originally in c — including the debugging session that writing this page forced on it. 𐃏

Read more >

Sudoku

sudoku is the drosophila of constraint satisfaction: small enough to hold in your head, rich enough to demonstrate every solving paradigm that matters. this page works through four of them against my actual code — a backtracking solver with \(O(1)\) constraint sets (arcade/references/sudoku/solver.py), a dart port that also generates puzzles (arcade-mobile), an integer-programming formulation solved for real with scipy, and the exact-cover view that leads to knuth’s algorithm x. every timing below is a real run on this machine.

Read more >

Ultimate Tic Tac Toe

ordinary tic-tac-toe is a solved bore — both players draw with a lookup table. glue nine boards together and add one rule about where you are allowed to move, and suddenly the game tree is deep enough that you need actual search theory: minimax, the negamax reformulation, alpha-beta pruning, and a heuristic to stand in for the leaves you cannot reach. this page documents the agent my partner and i wrote for unsw comp3411 (assignment 3, “nine-board tic-tac-toe”), warts and all — and the warts are instructive. 𐃏

Read more >

Filter Function

Source: https://www.w3resource.com/python-exercises/filter/index.php

Read more >

Neetcode

Leetcode Stats

The Neetcode curriculum, organised as a topic-dependency tree. The canonical 75-problem subset (with the OA-prep mock schedule) lives on the Blind75 page; the full 150-problem expansion is on Blind150 (problems shared with Blind75 link back to the worked solutions there).