I am working a longest word game app. So far so good. Now I am adding a function for finding any anagrams of a word (that works). And if my textbox is working fine with other functions, with the request of anagram finding, the words show up from RIGHT TO LEFT. I am pretty sure I have done something stupid somewhere but I have no clue. Can someone explain this oddity, thanks.
Please show us your blocks or the designer, in which component the problem occurs?
You can utilise clock component and string reverse block whatever you type in textbox that will immediately get reversed on clock event.
But Anagram is not hust reversing string.
Here are the designer, and the button , btn anagram, which put the app on the anagram mode, the command being a change of the textbox backgroundcolor for showing the app that it has to find an anagram instead of finding the possible longest word. .
thanks rnareshnu. Very elegant solution, mine is more clumsy.
A counter example:
xxxx vs xxxx
Anagram, or not?
An alternative way to check anagrams:
Split each word at '' to get a list of letters
Sort each list
If lists match, their words are anagrams.
Principally two sorted strings, if match index by index, then they are anagram strings. I also wanted about comparing to sort strings but I didn't find inbuilt string sort block, so I adopted this method.
It is anagram.
Edit: The word XXXX is a palindrome: it can be read backwards.
Personally I am using this function. A slow processing but efficient.
By the by , if I am now in a funny quandary, it's thanks to hon. ABG. I was enthralled by his Wordle app. And from then as my old mother is a bit bored, I modified the daily option , add some yarns at request (vowel,conson,number of possible words.... From then I drifted to a longest word game, a number game (https://www.dailymotion.com/video/x1p7s6)., a sudoku creator and crashed on a sudoku solver.
SOLVED (partially)
The reason why textbox text appears backward is because I AM USING UPCASE .
For having letters in upper case in textbox, Clock 1 is setting textbox text in upcase.
THERE IS NO SOLUTION.
For textbox (not label), using UPCASE or DOWNCASE leads to text showing from left to right???? One can rearrange letters but any change of textbox text disables the DEL button (<X] ) thus, it's not possible to correct typing errors.