Ejemplo n.º 1
0
        /// <summary>
        /// Gets a square position from its rank and file chars.
        /// </summary>
        /// <param name="f">The file char</param>
        /// <param name="r">The rank char</param>
        /// <returns></returns>
        public static int GetPosition(char f, char r)
        {
            if (f < 'a' || f > 'h' || r < '1' || r > '8')
            {
                return(-1);
            }

            return(Board.Position('8' - r, f - 'a'));
        }