These are public posts tagged with #sudoku. You can interact with them if you have an account anywhere in the fediverse.
Wow, mighty impressed by Google Gemini 2.5 pro. With help of ChatGPT o1 I had created python code to solve Sudokus and to Generate Sudokus. For the UI I wanted to try out Gemini.
So I wrote a single prompt, more a spec, of the UI features I wanted.
And the AI delivered a perfectly working, beautiful UI, even with some features I hadn't specified so clearly.
Here's the prompt:
You are an expert python developer.
Below you find python code that can solve and generate sudoku puzzles.
Please write python code for a tk user interface that allows users to solve sudoku puzzles generated by this code. The UI shall have these features
* button to generate a new puzzle, with a difficulty between 1 and 10. Based on the difficulty, use generate_random_start_board, followed by generate_sudoku(startboard, difficulty).
* see the sudoku in standard sudoku layout with clearly separated 3x3 spaces. Use large cells. A cell holds up to 9 very small numbers of what the user thinks are possible numbers, and one large number with the value for the cell the user chose.
* possibility to click into a cell which marks the cell as active
* a toggle (you decide which kind) that decides what happens if the user types a number. If the toggle is "domain" (please find a better word) then you add/remove one of the small numbers. If the toggle is "value" (please find a better word), then you enter the actual value of the cell.
* a button to check whether the solution is still valid, with appropriate means of showing this to the user.
* a restart button
* a "new puzzle" button
And here's two screenshots. Isn't this mindblowing?
Sudoku 3/3
Die Webseite heißt "Sudoku-Labor" weil ich hier verschiedene Versuche zum Thema gemacht habe. Und auch die Besucher können hier experimentieren.
Man kann mit dem Smartphone ein Sudoku aufnehmen oder ein gespeichertes Bild laden. Mein OCR versucht, das Rätsel zu analysieren. Danach können sie es lösen lassen.
Mit einer Zufallsfunktion können sie Rätsel erzeugen lassen (dauert etwas ). Sie können eigene Rätsel erzeugen und diese prüfen. Und es gibt eine Auswahl von Rätseln, die sie lösen und downloaden können.
Viel Spaß .
Hier können sie jedes 9x9 Sudoku lösen und neue Rätsel…
Sudoku-LaborSudoku 2/3
Also habe ich beschlossen, zu beweisen, dass man Sudokus ganz leicht ausrechnen kann.
Na ja, ich musste einige Umwege machen bis es glückte. Und auf diesen Wegen konnte ich feststellen, dass Sudoku mathematisch sehr interessant ist.
So haben erst kürzlich Forschungen ergeben, dass die kleinste Anzahl Vorgaben für ein eindeutiges Sudoku (mit nur einer Lösung) 17 ist.
Des Weiteren gilt: Ein Rätsel mit 17 Zahlen, welches unlösbar ist, ist extrem selten.
Nun ist mir aber schon zwei Mal geglückt, ein unlösbares 17er Spiel zu erzeugen.
Hier isses, vielleicht kann es einer von Euch lösen.
In APPLAUS!, 362,880 distinct colorations of a #sudoku solution provide the serreal patterns for 4 up-tempo contrapuntal rhythmic 'voices,’ performed by 4 persons clapping their hands.
A complete, unabridged rendition of the piece lasts exactly one year. The recordings on the album (made with #SonicPi) traverse that year in ‘FF’: 87 out of 362,880 ‘runs’ were selected at regular intervals from their lexicographic sequence.
#experimental #music #speculative #sudokism
https://soundblog.bandcamp.com/album/applaus-voor-vier-klappers
Title: Simsu
️ What's: A libre Sudoku game
️ https://gottcode.org/simsu/
️ https://github.com/gottcode/simsu
️ https://floss.social/@gottcode
#LinuxGaming #ShareYourGames #Puzzle #Sudoku
️ #Arch #RPM #Deb #Flatpak
Our entry:
️Homeless
️ Update: 1.4.5
Code improvement
️
️ Changes: https://github.com/gottcode/simsu/releases/tag/v1.4.5
️ From: 🛜️ https://gottcode.org/feed.atom
Hab heute mal wieder was für meinen schwarzen Gürtel in #Sudoku getan.
Aber jetzt mal ernsthaft: Hat wer von euch mit Ü50 mal mit #Kampfsport oder #Selbstverteidigung angefangen? Was für Erfahrungen habt ihr gemacht?
Überlege langsam, dass das mal notwendig werden könnte.
Ho scoperto il sudoku, bello, non avrei mai creduto
#giochi #sudoku
https://it.wikipedia.org/wiki/Sudoku
https://f-droid.org/packages/org.secuso.privacyfriendlysudoku
Sudoku puzzle partially completed, spoilers.
@svencodes Hi Sven. Is there a bug tracker for sudokupad.app somewhere? My puzzles get corrupted on occasion. Today it lost much of the coloring, which is catastrophic.
Puzzle: https://sudokupad.app/h8znpkd7qs
Platform: Android, Firefox.
Report: Every cell was colored. When I reloaded the URL it restored a corrupted version, shown in the image below.
Edit: Never mind, I found it. I reported the issue there: https://github.com/SudokuPad/sudokupad-web-issues/issues/46
Normally the rule of thumb on YouTube is "don't look in the comments section", but Cracking the Cryptic is so wholesome. Here we have champion Sudoku solvers speed-solving wickedly difficult variant Sudoku puzzles, and when someone who's halfway decent at solving medium-difficulty classic Sudoku asks a question, they are taken seriously and given a proper explanation. There is no elitism or bullying. No rudeness, not even impatience. All skill levels are welcome in the comments so long as, per Simon Anthony's request, they are kind.
Falling into infinity and hitting the bottom
There is a part of my brain which is intensely nerdy. It wakes up about 11pm. I’ve been working with lists of lists (of lists of lists of…) in python, and doing various things with them.
One of the things I wanted to do was to be able to define a particular “family tree” of datasets, which groups datasets according to the things they have in common, and once it was defined use that to generate an ensemble, plots, etc.
One of the nice things about this is that it offers ample opportunities for writing recursive functions – functions that call themselves. This delights me far more than it should.
The first recursive function I wrote was a nice easy one, which traverses the trees from right to left, randomly choosing a branch at each level, until is reaches one of the datasets on the left.
The function to plot the hierarchies (see the figure above) is also recursive, going down to the deepest level of the tree, connecting each of the datasets in a group or subgroup (or subsubgroup etc) and then popping up a level and repeating the procedure.
I also wrote some other recursive functions for the simple pleasure of it: to build a depth tree, to count how many datasets there are in the hierarchy, to get all the members in a list, etc…
I don’t know why recursive functions are so appealing. There’s something neat about them, like sending off a little worker to burrow (maybe endlessly) into some simple, but layered task.
My favourite recursive function was one that I wrote to solve sudokus. I was on holiday and realised I had spent several hours doing sudoku puzzles. They were difficult ones but not impossible and each one took maybe take half an hour or more to complete. The worst ones might take an hour or more. This struck me as a silly use of my time. Obviously, I couldn’t leave the sudokus undone, so I figured I would write a program to solve them, learn python1, and exorcise this particular obsession.
I started off by copying all the tricks I knew of into code. I guess everyone who does sudokus has their own pet names for the different strategies they employ, but I had placeholders for functions like slicing, squares, pairs, triples, ghosts, and singles, which was all very absorbing, but, at the same time, somehow unsatisfying.
Then I realised that I could use a much simpler method: guess. I could find an empty square, guess what it contained, check that it didn’t lead to a contradiction, and then guess again. If a guess did lead to a contradiction, I just needed to backtrack one level and make a different guess. The code for it was absurdly simple and watching it fill, backtrack, and refill grids was strangely soothing.
It solved all the sudokus I gave to it, even the toughest ones from the back of the sudoku book, so it did the job. I had a very enjoyable sudoku-free holiday after that2.
-fin-
This was attempt number one to learn python. I’ve lost count at this point.
Except for the easy ones in the local newspaper.
#artificialIntelligence #programming #python #recursion #sudoku
Working on a Sudoku game using Svelte 5.
https://sudoku-svelte5.netlify.app/
source: https://github.com/tkroo/sudoku-svelte5
#Sudoku #Svelte
Title: Simsu
️ What's: A libre Sudoku game
️ https://gottcode.org/simsu/
️ https://github.com/gottcode/simsu
️ https://floss.social/@gottcode
#LinuxGaming #ShareYourGames #Puzzle #Sudoku
️ #Arch #RPM #Deb #Flatpak
Our entry:
️Homeless
️ Update: 1.4.4
Hotfix
️
️ Changes: https://gottcode.org/simsu/
️ From: https://mastodon.social/@holarse/113810374084192522