Number 10 already. Not always easy to think of something or find something but it is fun to do.
- How does this work?
- Can you do this in another way?
- What is special here?
Number 10 already. Not always easy to think of something or find something but it is fun to do.
Trying to use my tiny brain on this,
@peter, I got it
It checks the number of “x” and “o” in the string, if one of them is found, it increments their respective counter variable by 1.
Then, return true if the number of “x” and “o” are the same; else false
Am I right?
You guys are quick. Good job. But you still have to answer this question?
here comes the mood spoiler
what’s special?
it really doesn’t matter if it is upper case or lower case, it convert every character to downcase and then proceed
Nope, that is not the special feature.
I think special thing is you set string not Boolean in result in If Then Else
Nope, that is not the special feature.
Recursion
Flagging as duplicate.
I think the special feature is that it only counts appearance of ‘x’ and ‘o’
I don’t see anything “special”, per se, but here are some oddities I noticed:
Shall i tell you?
Maybe it is for Tic-Tac-Toe game? So you can count X and O letters and decide who will play at next turn.
Nope, but i like your fantasy.
because the variable holds numerical value
Logical operators work on everything.
it can be considered good practice if using parent type is same as the child’s, although no fast and hard rule, developers have freedom
Peter, is it really a feature??
I prefer to mix types… Yeah I know. It’s a nightmare for some.