It was working only with three or less X or O signs. I have changed it to work for all combinations
Then I thought of for loop, and realized that the work will be much longer than I wished while making a note on the paper. Index would be more ideal to check each combination with a shorter code.