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