[how-to]: omok double 3 rule algorithm

Discussion in 'General Discussion' started by ForevaYong, May 9, 2023.

  1. ForevaYong
    Offline

    ForevaYong Member

    Joined:
    May 9, 2023
    Messages:
    1
    Likes Received:
    0
    Gender:
    Male
    Country Flag:
    Hi to the devs and any others:

    If this isn't too technical to ask, how is the algorithm for the double 3 implemented?
    I'm trying to build an omok game for my friends and I to play and would love to have Maple's double-3 constraint as a part of it.

    I've been stuck on this problem for several days and can't come to a conclusion on how to efficiently identify all possible cases of a double-3.

    My initial thought was a caveman-like style of checking for an open 3 in the line that the piece is initially placed and then to somehow check every possible index in that line for another connected open 3 but that method seems too excessive... maybe I'm hoping for something simpler..

    My current thought is something along the lines of creating a model for every possible double-3 shape. Then check the spot a player places their piece and its surrounding coordinates against that shape in every possible direction from that position.

    If this post is valid, I'd love to hear your thoughts and criticisms. I appreciate any help!
     
    Last edited: May 9, 2023

Share This Page