Class GoMokuPatterns

  • Direct Known Subclasses:
    GoMokuPatternsFile

    public class GoMokuPatterns
    extends Patterns
    Encapsulates the domain knowledge for GoMoku. Its primary client is the GoMokuController class. These are key patterns that can occur in the game and are weighted by importance to let the computer play better.
    • Constructor Detail

      • GoMokuPatterns

        public GoMokuPatterns()
        Constructor.
    • Method Detail

      • getWinRunLength

        public int getWinRunLength()
        This is how many in a row are needed to win if M is five then the game is gomoku
        Specified by:
        getWinRunLength in class Patterns
        Returns:
        how many in a row are needed to win. If M is five then the game is gomoku
      • getMinInterestingLength

        public int getMinInterestingLength()
        Specified by:
        getMinInterestingLength in class Patterns
        Returns:
        patterns shorter than this are not interesting and have weight 0
      • getNumPatterns

        protected int getNumPatterns()
        Specified by:
        getNumPatterns in class Patterns
        Returns:
        total number of patterns represented
      • getPatternString

        protected java.lang.String getPatternString​(int i)
        Specified by:
        getPatternString in class Patterns
      • main

        public static void main​(java.lang.String[] args)