This is awesome, but there's a slight bug in this implementation: Wordle won't count additional instances of a letter as wrong-position, it'll just flag them as wrong. For example, if the word is TRACE, and I guess TRACT, the first T will be green, but the second T should be black, not yellow. In this implementation, at the moment, TRACT would return GGGGY, but in Wordle it would be GGGGB. I actually made the same mi…
Oh wow, I never noticed that myself. I'll fix it once I'm at my computer, thanks for pointing it out! The fix will probably be something like 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.
Show HN: A simple Wordle clone in 60 lines, using Hyperscript
31–40 of 53 posts
Re: Show HN: A simple Wordle clone in 60 lines, using Hyperscript
#32Re: Show HN: A simple Wordle clone in 60 lines, using Hyperscript
#33On Safari on iOS, at least, typing fast will accidentally zoom into that part of the page instead of registering it as a character press. But pretty neat implementation otherwise. Awesome work!
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 :)Re: Show HN: A simple Wordle clone in 60 lines, using Hyperscript
#34Not take away from the brevity of the code, but these 60 lines translate into 168KB of JavaScript.
_hyperscript_web.min.js is 84.1 KiB (86,093 bytes) and when zipped it's 22.1 KiB (22,641 bytes)
Re: Show HN: A simple Wordle clone in 60 lines, using Hyperscript
#35 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-...
Re: Show HN: A simple Wordle clone in 60 lines, using Hyperscript
#36Re: Show HN: A simple Wordle clone in 60 lines, using Hyperscript
#37I'm confused. Hyperscript is supposed to be an alternative way to writing JSX, good for skipping the babel/transpile step. Such as the React h() function. For example: 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... http…
Re: Show HN: A simple Wordle clone in 60 lines, using Hyperscript
#38> build 80% of Wordle in a different language 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 :)
Re: Show HN: A simple Wordle clone in 60 lines, using Hyperscript
#39Earlier quoted context omitted.
Look at the source, it is written with that language/framework. I seems they want to pull a Substack. Color me unimpressed.
He used the framework, not named it.
@dang if you happen to read this, can you hide/flag the thread ?
Re: Show HN: A simple Wordle clone in 60 lines, using Hyperscript
#40I found a bug. When there is a repeated character in the guess but not in the word, you’re given an incorrect color key. 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 :)