Example #1
0
        public static string FlipParsedCoordinates(string coords)
        {
            var mcoords = GoBoardAux.ParsedToModelCoordinates(coords);

            if (mcoords.Item1 == GoBoardAux.NoIndex)
            {
                return("");
            }
            else
            {
                // C# fails mutually distinct types on char and int, and string constructor lame.
                // Must cons array so that string constructor doesn't interpret second char as count.
                return(new string(new char[] { letters[20 - mcoords.Item2], letters[20 - mcoords.Item1] }));
            }
        }
Example #2
0
        //// parsed_label_model_coordinates takes a parsed properties and returns as
        //// multiple values the row, col (in terms of the model used by goboard.py),
        //// and the label letter.  Data should be "<letter><letter>:<letter>".
        ////
        public static Tuple <int, int, char> ParsedLabelModelCoordinates(string data)
        {
            var tmp = GoBoardAux.ParsedToModelCoordinates(data);

            return(new Tuple <int, int, char>(tmp.Item1, tmp.Item2, data[3]));
        }