Example #1
0
        public static List <string> GetPossibleMoves(string piecewithposition)
        {
            var    input         = piecewithposition.Split(' ');
            string PieceName     = input[0];
            string Position      = input[1];
            var    piece         = PieceCreator.GetPiece(PieceName, Position);
            var    possibleMoves = piece.GetAllPossibleMove();

            return(possibleMoves.Select(x => x.BoardValue).ToList());
        }
Example #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("please enter peaceName and position"); //“King D5
            var    input           = Console.ReadLine().Trim().Split(' ');
            string PieceName       = input[0];
            string Position        = input[1];
            var    piece           = PieceCreator.GetPiece(PieceName, Position);
            var    possibleMoves   = piece.GetAllPossibleMove().Select(x => x.BoardValue).ToList();;
            string combindedString = string.Join(",", possibleMoves);

            Console.WriteLine("possible moves are " + combindedString);
        }