Example #1
0
        public CrunchedWord4Grid Crunch(Word4Grid input)
        {
            SortedTable <Word4> .Index r1 = this.table.Find(input.Row1);
            SortedTable <Word4> .Index r2 = this.table.Find(input.Row2);
            SortedTable <Word4> .Index r3 = this.table.Find(input.Row3);
            SortedTable <Word4> .Index r4 = this.table.Find(input.Row4);
            SortedTable <Word4> .Index c1 = this.table.Find(input.Column1);
            SortedTable <Word4> .Index c2 = this.table.Find(input.Column2);
            SortedTable <Word4> .Index c3 = this.table.Find(input.Column3);
            SortedTable <Word4> .Index c4 = this.table.Find(input.Column4);

            CrunchedWord4Grid crunchedGrid;
            int c = r1.CompareTo(c1);

            if (c == 0)
            {
                c = r2.CompareTo(c2);
                if (c == 0)
                {
                    c = r3.CompareTo(c3);
                }
            }

            if (c > 0)
            {
                crunchedGrid = new CrunchedWord4Grid(c1, c2, c3, c4, r1, r2, r3, r4);
            }
            else
            {
                crunchedGrid = new CrunchedWord4Grid(r1, r2, r3, r4, c1, c2, c3, c4);
            }

            return(crunchedGrid);
        }
Example #2
0
 public CrunchedWord2Grid(
     SortedTable <Word2> .Index i1,
     SortedTable <Word2> .Index i2,
     SortedTable <Word2> .Index i3,
     SortedTable <Word2> .Index i4)
 {
     this.i1 = i1;
     this.i2 = i2;
     this.i3 = i3;
     this.i4 = i4;
 }
Example #3
0
 public CrunchedWord3Grid(
     SortedTable <Word3> .Index i1,
     SortedTable <Word3> .Index i2,
     SortedTable <Word3> .Index i3,
     SortedTable <Word3> .Index i4,
     SortedTable <Word3> .Index i5,
     SortedTable <Word3> .Index i6)
 {
     this.i1 = i1;
     this.i2 = i2;
     this.i3 = i3;
     this.i4 = i4;
     this.i5 = i5;
     this.i6 = i6;
 }
Example #4
0
 public CrunchedWord4Grid(
     SortedTable <Word4> .Index i1,
     SortedTable <Word4> .Index i2,
     SortedTable <Word4> .Index i3,
     SortedTable <Word4> .Index i4,
     SortedTable <Word4> .Index i5,
     SortedTable <Word4> .Index i6,
     SortedTable <Word4> .Index i7,
     SortedTable <Word4> .Index i8)
 {
     this.i1 = i1;
     this.i2 = i2;
     this.i3 = i3;
     this.i4 = i4;
     this.i5 = i5;
     this.i6 = i6;
     this.i7 = i7;
     this.i8 = i8;
 }
Example #5
0
        public CrunchedWord2Grid Crunch(Word2Grid input)
        {
            SortedTable <Word2> .Index r1 = this.table.Find(input.Row1);
            SortedTable <Word2> .Index r2 = this.table.Find(input.Row2);
            SortedTable <Word2> .Index c1 = this.table.Find(input.Column1);
            SortedTable <Word2> .Index c2 = this.table.Find(input.Column2);

            CrunchedWord2Grid crunchedGrid;
            int c = r1.CompareTo(c1);

            if (c > 0)
            {
                crunchedGrid = new CrunchedWord2Grid(c1, c2, r1, r2);
            }
            else
            {
                crunchedGrid = new CrunchedWord2Grid(r1, r2, c1, c2);
            }

            return(crunchedGrid);
        }
Example #6
0
 public Word2GridCruncher(SortedTable <Word2> table)
 {
     this.table = table;
 }
Example #7
0
 public void Load(string fileName)
 {
     this.table = new SortedTable <TWord>();
     LoadFromFile(fileName, s => this.LoadWord(s, w => this.table.Add(w)));
     this.logger.Log("Loaded {0} words.", this.table.Count);
 }