Jan-04-2018, 03:31 PM
Sorry about the 2d array, of course it's just a list of strings.
I like the idea of a win function with horizontal, vertical, and diagonal functions within. It's the same idea I had.
I don't know about the use of any, but thanks for the suggestion.
What if I just constantly checked every horizontal, vertical and diagonal every turn? If I used the top counter as the main index, and the other three were like a tail.(if it was a diagonal).
Please tell me that makes sense.
I like the idea of a win function with horizontal, vertical, and diagonal functions within. It's the same idea I had.
I don't know about the use of any, but thanks for the suggestion.
What if I just constantly checked every horizontal, vertical and diagonal every turn? If I used the top counter as the main index, and the other three were like a tail.(if it was a diagonal).
"| x | | | | | | |" "| | x | | | | | |" "| | | x | | | | |" "| | | | x | | | |" "| | | | | | | |" "| | | | | | | |"So the top left x is the main index one, and the other ones would follow it, so that diagonal would be checked like this:
"| | x | | | | | |" "| | | x | | | | |" "| | | | x | | | |" "| | | | | x | | |" "| | | | | | | |" "| | | | | | | |"And when the bottom right when "touches" the end the index moves down. Like a space invader sort or thing.
Please tell me that makes sense.