예제 #1
0
        public LoadedCalculation Take(string indexStr)
        {
            var data = new Dictionary <string, int>();

            for (int i = 0; i < _table.GetLength(0); i++)
            {
                for (int j = 0; j < _table.GetLength(1); j++)
                {
                    int x = i + 1;
                    int y = j + 1;

                    string indexer = IndexParser.Generate(x, y);

                    // unsafe
                    int val = Int32.Parse(_table[i, j]);

                    data.Add(indexer, val);
                }
            }

            return(new LoadedCalculation(data).Value(indexStr));
        }
예제 #2
0
        public string Get(string indexStr)
        {
            Tuple <int, int> coord = IndexParser.Parse(indexStr);

            return(_table[coord.Item1, coord.Item2]);
        }