Beispiel #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);
        }
Beispiel #2
0
 public static IEnumerable <Direction> PossibleMoves(this byte[,] squares)
 {
     return(XT.EnumVals <Direction>().Where(d => !squares.Slide(d).IsEqualTo(squares)));
 }
Beispiel #3
0
 public static IEnumerable <Direction> PossibleDirections(this ulong fld)
 => XT.EnumVals <Direction>().Where(d => fld.Slide(d) != fld);