Esempio n. 1
0
        public static ulong NextMask(this IGenerator rnd, FreeCells cells)
        {
            var   index = cells[rnd.Next(cells.Count)];
            ulong mask  = rnd.NextCell() << (index * 4);

            return(mask);
        }
Esempio n. 2
0
        public Board FillEmptySpot(IGenerator rnd)
        {
            var freeCells = FreeCells.FromBoard(this);

            if (freeCells.Any())
            {
                var bits = Bits | rnd.NextMask(freeCells);
                return(new Board(bits, Score));
            }
            else
            {
                return(Empty);
            }
        }