
Otherwise, we have to check if the chosen letter appears elsewhere in the word of the day. If we got a match, pick green for a good match and save it for later, and increment our match counter. Time to compare the guess letter against the corresponding position in the word of the day, using the text segment block and the text compare block. The Labels are Upper Case and my word is lower case, so I downshift the current guess letter. We also keep a local color variable, to hold the current letter match result color, initially mismatch grey.Īgain, I pay the price for not having made my word list the same case as my keyboard letters. We extract the current guess letter at index n. We need the index to help us match corresponding positions in the the word of the day and in the current guess. It is time to loop through the letters of the guess, by index n. If the guess is not in the word list, Notify them without penalty.Ī local variable correctCount (initially 0) helps keep track of how many correct letters are in place, for deciding if the player made a winning guess. (To read these blocks, right click on them and Open Image in New Tab.
