The goal here wasn't really to create a good version of Wordle, it was to build 80% of Wordle in a different language to see what it looks like. Turns out, it looks pretty good! Stuff like using CSS rule precedence to highlight the squares, CSS selectors to figure out which key to highlight, and using the DOM to keep state are all really natural in Hyperscript. I highly suggest going to the site and viewing the source!
I actually made the same mistake in a Wordle solver I was writing recently - it's easy to miss, since Wordle doesn't make this explicit and you have to infer it yourself.
if letter not in (.bg-warning in first .guess).innerText then add .bg-warning
Haven't tested as I'm on my phone, but seems like a simple enough fix.E.g. Word was GROUP I guessed SPOON Output was green O at location 3 and yellow at 4. Happened for a couple more guesses making me think there is another O eventually to realize there are no more spots and it’s a bug.
Turns out, HN finds and reports bugs much faster than family and friends :)
But pretty neat implementation otherwise. Awesome work!
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
That should fix it, I'll push a new version after fixing the word matching issue others have pointed out. I underestimated Wordle's complexity :)will be a great chance to optimize the hyperscript runtime for mobile
It'd be very easy to check against just a list of words, but that'd require more storage and be slower than a bloom filter.
h('header', { id: 'my-header', className: 'header' },
h('div', { className: 'logo' },
h('a', { href: '/' }, 'mtsknn.fi')
)
)
Hyperscript.org doesn't seem to be related to this at all?https://mtsknn.fi/blog/hyperscript-hyperior-alternative-to-j... https://dev.to/fromaline/hyperscript-the-hidden-language-of-...
Though not enforced by the Hyperwordle clone, the script plays the game on "hard" mode by default where all letter hints must be included in subsequent guesses. Ironically, this constraint made the algorithm more efficient, easy mode tends to take longer and fail more frequently!
Anyone have a better algo yet? https://github.com/rgkimball/wordlebot
Ed, nevermind:
> I highly suggest going to the site and viewing the source!
For chrome on Android:
view-source:https://arhamjain.com/hyperwordle/I have been trying to do the same thing! I was looking for projects on github that I could adapt to a new language. Sadly, most of them require a server. It seemed to me that this game could pretty easily just run on the client alone.
I will dig into yours and see how it can be adapted to different languages too :)
hyperscript.org@0.9.4:1 'first <:empty/> in first .guess' is null
the hyperscript runtime is defintely... pedestrian
See https://github.com/hyperhype/hyperscript and all its descendants, like Mithril, HyperApp or Sinuous.
Could you please think of another name ?
https://github.com/bigskysoftware/_hyperscript
but not sure it's anything to do with the OP though
I seems they want to pull a Substack. Color me unimpressed.