public CornerGuessor(BaseMinesweeperSolver bms, int xlength, int ylength, Vector2Int firstguess) : base(bms, firstguess)
    {
        corner = new List <Vector2Int>();
        edge   = new List <Vector2Int>();

        int lastx = xlength - 1;
        int lasty = ylength - 1;

        //corner
        corner.Add(new Vector2Int(0, 0));
        corner.Add(new Vector2Int(0, lasty));
        corner.Add(new Vector2Int(lastx, 0));
        corner.Add(new Vector2Int(lastx, lasty));

        //edge
        for (int i = 1; i < lastx; i++)
        {
            edge.Add(new Vector2Int(i, 0));
            edge.Add(new Vector2Int(i, lasty));
        }
        for (int i = 0; i < lasty; i++)
        {
            edge.Add(new Vector2Int(0, i));
            edge.Add(new Vector2Int(lastx, i));
        }
    }
Exemplo n.º 2
0
 public OpenGuessor(BaseMinesweeperSolver bms) : base(bms)
 {
 }
Exemplo n.º 3
0
 public OpenGuessor(BaseMinesweeperSolver bms, Vector2Int firstguess) : base(bms, firstguess)
 {
 }
    void SetUpSolver()
    {
        BaseGuessor g;

        if (FirstGuess == new Vector2Int(-1, -1))
        {
            switch (guessor)
            {
            case GuessorType.Random:
                g = new RandomGuessor(af);
                break;

            case GuessorType.Corner:
                g = new CornerGuessor(af, settings.x, settings.y);
                break;

            default:
                throw new System.Exception("Uknown guessor type");
            }
        }
        else
        {
            switch (guessor)
            {
            case GuessorType.Random:
                g = new RandomGuessor(af, FirstGuess);
                break;

            case GuessorType.Corner:
                g = new CornerGuessor(af, settings.x, settings.y, FirstGuess);
                break;

            default:
                throw new System.Exception("Uknown guessor type");
            }
        }
        switch (solvertype)
        {
        case MinesweeperSolverType.Standard_DSSP:
            af = new DSSP(operators, new Vector2Int(x, y), g);
            break;

        case MinesweeperSolverType.Enhanced_DSSP:
            af = new MineGuessingDSSP(operators, new Vector2Int(x, y), g, MGDSSP_UncoverMax);
            break;

        case MinesweeperSolverType.SimpleBruteForce_CSP:
            af = new SimpleBruteForceCSP(operators, new Vector2Int(x, y), g, relativenumberofmines, MaxSolvingLength);
            break;

        case MinesweeperSolverType.SimpleBackTrack_CSP:
            af = new SimpleBackTrackCSP(operators, new Vector2Int(x, y), g, relativenumberofmines, MaxSolvingLength);
            break;

        case MinesweeperSolverType.BorderGuessing_DSSP_WithMineGuessing:
            af = new DSSP_ButRandomBorderGuess(operators, new Vector2Int(x, y), g, true);
            break;

        case MinesweeperSolverType.BorderGuessing_DSSP_WithUncovering:
            af = new DSSP_ButRandomBorderGuess(operators, new Vector2Int(x, y), g, false);
            break;

        default:
            throw new System.NotImplementedException("Unkown MinesweeperSolverType");
        }
        g.bms = af;
    }
Exemplo n.º 5
0
 protected BaseGuessor(BaseMinesweeperSolver bms)
 {
     specialfirstguess = false;
     this.bms          = bms;
 }
Exemplo n.º 6
0
 public BaseGuessor(BaseMinesweeperSolver bms, Vector2Int firstguess)
 {
     specialfirstguess = true;
     this.firstguess   = firstguess;
     this.bms          = bms;
 }
 public RandomGuessor(BaseMinesweeperSolver bms) : base(bms)
 {
 }