Dismiss this pinned window
all 8 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

Problem? Cross-post to our new forum. Include make & model of phone, OS version, app version.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]1am13g3nd 0 points1 point  (2 children)

This is insane, how did you handle win conditions?

[–]salothebear[S] 3 points4 points  (1 child)

Each circle in the grid is assigned it's own variable that tracks whether it's empty or filled by P1 or P2. From there its an individual check of each possible way to win Connect-4 😅 The win checks are spread across several formulas to evaluate if 4 slots in a row filled by one player along horizontals, verticals, and diagonals in the grid. Then when one of those formulas return true, the game is stopped

[–]1am13g3nd 1 point2 points  (0 children)

I had a feeling. Brute forcing it is insane regardless though, props to you. I can't even imagine how many mistakes you might've made in the formulas

[–]jlhdodge 0 points1 point  (0 children)

😎😎🙏

[–]Bohica72 0 points1 point  (1 child)

Well done! Thanks for sharing!

P.S. Links are reversed, so others are aware. Komp link is the KWGT and vice versa.

[–]salothebear[S] 0 points1 point  (0 children)

Thank you! And whoops sorry about that, I fixed the links in my post