Solving Wordle with uv's dependency resolver
180 points
2 days ago
| 6 comments
| mildbyte.xyz
| HN
simonw
19 hours ago
[-]
Here's my favorite of the Soduku attempts at this (easier to get your head around than Wordle since it's a much simpler problem): https://github.com/konstin/sudoku-in-python-packaging

Here's the same Sudoku trick from 2008 using Debian packages: https://web.archive.org/web/20080823224640/https://algebraic...

reply
mildbyte
19 hours ago
[-]
Funnily enough, I did a Sudoku one too (albeit with Poetry) a few years ago: https://github.com/mildbyte/poetry-sudoku-solver
reply
kibwen
22 hours ago
[-]
If you wanted to leverage uv's package resolver for a less deliberately silly purpose, note that it's using the pubgrub-rs library under the hood: https://github.com/pubgrub-rs/pubgrub
reply
davejagoda
9 hours ago
[-]
Yet another reason to use `uv`!

I try to avoid bugs like this:

By accident, at first, I omitted the letter u in my list of letters that I was generating packages for, which caused extremely cryptic and long (500KB of uv painstakingly explaining to me why I was wrong) dependency resolution errors on specific guesses:

by doing this:

  import string
  LETTERS = string.ascii_lowercase
instead of this:

  LETTERS = "abcdefghijklmnopqrstuvwxyz"
It's a few more characters to type, but easier to examine for correctness.
reply
jeremyscanvic
4 hours ago
[-]
That's really neat. I didn't know about those string constants!
reply
Joker_vD
19 hours ago
[-]
I express my deepest gratitude to the author for not publishing all those "wordle-*" packages to the PyPI. Thank you!
reply
stared
22 hours ago
[-]
Next step: playing Doom with uv's dependency resolver

(reference to: https://news.ycombinator.com/item?id=43184291)

reply
slightwinder
22 hours ago
[-]
Extra points when it runs on an oscilloscope (because pregnancy testers are boring now).
reply
falcor84
21 hours ago
[-]
Not directly related to uv, but I started looking into this now and stumbled upon this discussion about how it's easier to have Quake "render" onto an oscilloscope than Doom:

https://forums.sufficientvelocity.com/threads/is-it-possible...

reply
voidUpdate
3 hours ago
[-]
I'm still waiting to see doom run on a pregnancy test
reply
contravariant
19 hours ago
[-]
Drawing images on an oscilloscope is fun, but I'm not sure if I would count it as a novel hack.
reply
Fuzzy1000
18 hours ago
[-]
Yes please
reply
spelunker
19 hours ago
[-]
Ok, now do npm!
reply
chatmasta
19 hours ago
[-]
npm allows you to have multiple versions of one package installed, so I’m not sure it will work for this, unless you use a package manager that allows you to set constraints like “only one version of this package can be installed.”
reply
spelunker
19 hours ago
[-]
Yeah, turns out I should have read TFA:

>The short summary of the Sudoku + Poetry post is that unlike Rust or JavaScript, a single Python project cannot use more than one version of a specific Python package.

reply