extending noughts and crosses into N dimensions
im making N dimensional noughts and crosses (i was incredibly bored in class). for the sake of simplicity I've got it running with 4 dimensions for now. how would i extend it into N dimensions?
obviously there'll be a finite amount of dimensions during builds. im just wondering how you'd do it for future use-cases too
PS: this is probably way simpler than im describing it to be. im not very good at C# lol
10 Replies
full script
nvm. i think chatGPT got the answer (still gotta test it)
nope, chatGPT didn't work
&&, not &
& is bitwise and
&& is logical and
have you looked up the algorithm?
Many times. Only even found the 4D algorithm after about a year of searching lol
have you tried implementing it by the algorithm?
do you understand the algorithm?
i do. the main problem is this line here
im not sure how to recursively do this check as N increases
I see
it's a problem that comes up pretty often
Stack Overflow
Iterate over m^n combinations with nested loops
I have an array y of dimension n, every dimension has m entries.
How do I iterate over all combinations of indices using nested for loops?
I'd like to get all possible combinations of sums like sho...
this might give you some ideas