How to Make Connect 4

That is exactly how I feel! Why do you think I do not favor Psuedo Teaming!

Mathematics and the Pi nation are honored to see your devotion to us.

2 Likes

Pseudo teaming is slightly different, also you can implement a more accurate version of pseudo teaming by giving the player the AMOUNT of a certain item, increasing automation and the team number also gets preserved.

Here are two more mathy approaches:


Have the board be stored in 9 properties and check them with block code and recursion

Store the board as two 9 digit binary numbers, one for red and one for blue, and then use bitwise operations to quickly check them using AND.

The first approach is proven to work well, but while unproven the second approach is more mathy (More work to make it than just bruteforcing, but more fun.)

its red and yellow though :slight_smile:

Yes- represent the peices as -1, 0, and 1 for the first idea, and for the second use 1 for a peice and 0 for no peice.

Wow. You spelled piece wrong each time. We could have an algorithm that systematically checks whether or not it has adjacent pieces. If it does it keeps checking until there are 4 of them found in a row.

1 Like

I just checked for all possible win situations- much simpler lol

It’s simpler but MUCH more tedious in a 7x7.

Recursion saves a ton of space

Yeah, my idea could use recursion.

I remember you…

Bump

ba bumb™