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