Page 1 of 3

Wordie - an open source Wordle implementation

Posted: Thu May 12, 2022 9:07 pm
by milon
Everybody loves Wordle, right?
For fun & for coding practice, I give you Wordie - an open source implementation of Wordle. :D

Screenshot_2022-06-23_14-11-47.png
Screenshot_2022-06-23_14-11-47.png (59.86 KiB) Viewed 4400 times

This is version 0.5 of Wordie. It's pretty and the mechanics are complete, but there's still a lot of tweaking to do. It's currently missing a bunch of nice stuff like music, sound effects, animations, stats tracking, etc. The only "bug" I know about is the keyboard doesn't update its colors after making a guess (I just haven't added that feature yet), but it will correctly redraw if you resize the window. There's lots of optimizations & code cleanup that can happen - check the source code and look for the "fixme" comments scattered around.

The onscreen keyboard SHOULD mimic your physical keyboard, and therefore should be compatible with non-US layouts. I can't really test this though, so someone please let me know. :)

I'm releasing it now because a bunch of IRL stuff just came up, and I likely won't be able to do anything significant with this for a few months or longer.

Let me know how you like it, what you don't like, etc. And feel free to patch the code too! Just try to avoid external libraries for my sake, please.

Enjoy!

EDIT - Download current version here, or from my latest post: download/file.php?id=21234

Re: Wordie - an open source Wordle implementation

Posted: Thu May 12, 2022 9:28 pm
by BrotSagtMist
Nice gui, no idea how the game is played tho.
I am not sure if creating an on screen keyboard with custom keys makes sense.
Mine is failing pretty hard here:
shot-2022-05-12_23-22-17.jpg
shot-2022-05-12_23-22-17.jpg (23.61 KiB) Viewed 5933 times

Re: Wordie - an open source Wordle implementation

Posted: Thu May 12, 2022 9:35 pm
by togFox
I'm not a wordle person but it looks pretty. :)

Re: Wordie - an open source Wordle implementation

Posted: Thu May 12, 2022 11:16 pm
by milon
BrotSagtMist wrote: Thu May 12, 2022 9:28 pm Nice gui, no idea how the game is played tho.
I am not sure if creating an on screen keyboard with custom keys makes sense.
Mine is failing pretty hard here:
shot-2022-05-12_23-22-17.jpg
Wow, that's definitely a fail! What layout & language does your system use?

And the onscreen keyboard is a part of the game. It color codes to help you track what you've learned about each letter so far.

And thanks togFox! You can chuck the help button (the ? in the top-right) for a help panel.
EDIT: Thanks to autocorrect, you can chuck the help button! :) Or you can just click it. Whatever works on your system, lol.

Re: Wordie - an open source Wordle implementation

Posted: Thu May 12, 2022 11:29 pm
by BrotSagtMist
Its neo german, similar to dvorak, the keys in question are üöä.
Also noticed the game crashes if i click anything other than a key with the mouse.

Re: Wordie - an open source Wordle implementation

Posted: Mon May 16, 2022 5:23 pm
by milon
Gotcha. That makes sense - I hadn't considered non-US keys being present, so that's a broken implementation on my part. Sorry about that! I'm not sure when I'll have time to fix it. Since I'm just dealing with English 5 letter words (currently), I should probably just hard code a US layout - or maybe do that as a fallback if non-US keys are present.

About the mouse crashing, that's a new issue to me. What's the error message?

Re: Wordie - an open source Wordle implementation

Posted: Thu May 19, 2022 7:57 pm
by BrotSagtMist

Code: Select all

game_state.lua:21: attempt to perform arithmetic on field 'w' (a nil value)


Traceback

[love "callbacks.lua"]:228: in function 'handler'
game_state.lua:21: in function 'isHovering'
game_state.lua:39: in function 'mousepressed'
main.lua:86: in function <main.lua:84>
[love "callbacks.lua"]:154: in function <[love "callbacks.lua"]:144>
[C]: in function 'xpcall'
But you should be able to replicate that, no? If not, is that related to the keyboard?

Re: Wordie - an open source Wordle implementation

Posted: Thu May 19, 2022 9:01 pm
by milon
BrotSagtMist wrote: Thu May 19, 2022 7:57 pm

Code: Select all

game_state.lua:21: attempt to perform arithmetic on field 'w' (a nil value)


Traceback

[love "callbacks.lua"]:228: in function 'handler'
game_state.lua:21: in function 'isHovering'
game_state.lua:39: in function 'mousepressed'
main.lua:86: in function <main.lua:84>
[love "callbacks.lua"]:154: in function <[love "callbacks.lua"]:144>
[C]: in function 'xpcall'
But you should be able to replicate that, no? If not, is that related to the keyboard?
No, I haven't seen that at all, and I've tested mouse & keyboard fairly extensively (on US layouts only). Very weird. Maybe it's related to the keyboard somehow?

Anyway, I've uploaded a new version that might just fix it. It does a static US QWERTY layout, should be touch-friendly (currently untested), I tweaked the colors a little, and correctly updates the keyboard appearance after each guess. New .love is in the OP, or you can get it from this link: [obsolete link removed]

Re: Wordie - an open source Wordle implementation

Posted: Thu May 19, 2022 9:16 pm
by BrotSagtMist
Same errors.

Re: Wordie - an open source Wordle implementation

Posted: Fri May 20, 2022 1:04 am
by pgimeno
It's crashing because `pointer` (as a gui element) lacks w and h.