Exemplo 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);
        }
Exemplo 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);
            }
        }