I am trying to debug a problem but when I run this code it skips if there is two letters in a row:
For example, I ran it with the word ‘crooked’ and it logs ‘croked’. I have tried multiple words. Works perfectly with words like ‘abdomen’ or ‘monkeys’.
for (int i = 0; i < 7; i++)
{
letter = theWord[i];
Debug.Log(letter.ToString());
...
What’s probably happening is that you have your editor console set to collapse identical messages. So, the double letters are being printed, but instead of getting two console messages, you get one message with a (2) next to it.
nothing is wrong with the code you posted, so the problem is somewhere else. you didnt run it with ‘crooked’ you ran it with the variable “theWord”, so i dont know how what you did before. for the future you should post a more verbose example. also this code wont support any word that has more than seven characters…