Wordle In A Day

Typing in a Guess


This procedure returns the one dimensional list of Labels in the current guess.


This is a generic any Button Click event, intended to service my keyboard.
I have separate button Click Events for my Enter and Delete keys, so I added a test for
if notAlreadyHandled and a check that this button is in my keyboard buttons list.

When a letter button is pressed, its letter should appear in the first blank Label in the current Guess row. That requires a bit of searching and a local variable firstBlankLabel to keep track of our search result. We start at the end of the label row and work our way backwards, remembering each blank label we encounter. At the end of the loop, firstBlankLabel has our best guess where to drop the letter value, which we get from the Button.Text value.


The Delete button has similar logic, searching for the last nonblank Label in the current guess and clearing it. Here we scan from right to left. If they are all blank, we clear the first Label for simplicity.

3 Likes