You could try running this code in an IDE and examining how the values as they change. I think that should reveal the logic nicely.
This comment is hidden because it contains spoiler information about the solution
more notably, this description fails the old trick question, What does one put in a toaster?
What does one put in a toaster?
C Translation kumited!
woe the vestigial lambda
it runs all 4 tests as a group
X always goes first
input means the string that is passed into the function. length means how many characters are in the string
0 will always be less than or equal to the length AND the length will always be less than or equal to 100
It can't happen because if X places three letters in a row: game over. Thus 0 wouldn't've even had a chance to place its third letter at all.
C Translation kumited.
Thanks for the comment. I made these changes to help direct the user:
If you see anything else that is not right, please let me know.
C Translation kumited, thanks.