Exemple #1
0
        public static Dictionary <Direction, ulong> GetPossibleMoves(this ulong fld)
        {
            var retVal = new Dictionary <Direction, ulong>(4);

            foreach (var d in XT.EnumVals <Direction>())
            {
                var val = fld.Slide(d);
                if (val != fld)
                {
                    retVal[d] = val;
                }
            }
            return(retVal);
        }
Exemple #2
0
 public static IEnumerable <Direction> PossibleMoves(this byte[,] squares)
 {
     return(XT.EnumVals <Direction>().Where(d => !squares.Slide(d).IsEqualTo(squares)));
 }
Exemple #3
0
 public static IEnumerable <Direction> PossibleDirections(this ulong fld)
 => XT.EnumVals <Direction>().Where(d => fld.Slide(d) != fld);