Exemplo n.º 1
0
        public Cruncher(SolverInfo information, WitnessWebIterator iterator, List <BoxWitness> witnesses, BruteForceAnalysis bfa)
        {
            this.information = information;
            this.iterator    = iterator;            // the iterator
            this.tiles       = iterator.getTiles(); // the tiles the iterator is iterating over
            this.witnesses   = witnesses;           // the dependent witnesses (class BoxWitness) which need to be checked to see if they are satisfied

            this.bfa = bfa;

            // determine how many found mines are currently next to each tile
            this.currentFlagsTiles = new sbyte[this.tiles.Count];
            for (int i = 0; i < this.tiles.Count; i++)
            {
                this.currentFlagsTiles[i] = (sbyte)this.information.AdjacentTileInfo(this.tiles[i]).mines;
            }


            // determine how many found mines are currently next to each witness
            this.currentFlagsWitnesses = new sbyte[this.witnesses.Count];
            for (int i = 0; i < this.witnesses.Count; i++)
            {
                this.currentFlagsWitnesses[i] = (sbyte)this.information.AdjacentTileInfo(this.witnesses[i].GetTile()).mines;
            }
        }
Exemplo n.º 2
0
 public List <SolverTile> getTiles()
 {
     return(iterator.getTiles());
 }