Get the latest tech news

Solving Sudoku with Tmux


The question that everyone has been asking me since I compiled Python to run on tmux is: “can you actually do anything useful with this?”. I’m happy to report back that the answer is still no, but I can now use tmux to solve sudoku, and I can do it using a different and trickier approach than the one I used with the compiler. With projects like this, seeing is believing, so I made a quick video showing what it...

After a lot of deep thinking and head-scratching, I have created a short tmux program that can solve a sudoku using just two bind-key statements. Before I drew this out as a transition diagram, I was thinking that I’d need to define far more keybindings—more like one per instruction—but in reality it’s just one keybinding for each point that control flow could jump back to. In the else block of the conditional is the interesting bit: it uses send-keys to type G into the second window (with an index of 1), which kicks off the rest of the program to get the board into the next possible state.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Sudoku

Sudoku

Photo of Tmux

Tmux

Related news:

News photo

Show HN: SudokuVariants – play and construct different variants of Sudoku

News photo

A meditative take on sudoku that changes with the weather

News photo

Forget Apple Intelligence – iOS 18.2 will bring a new Sudoku game to your iPhone