Beispiel #1
0
Datei: X.cs Projekt: key-moon/X
    public static int Solve(Case testCase)
    {
        Image image = testCase.Image;

        ImageWriter.Add(image);
        image.Clean();
        ImageWriter.Add(image);
        var separated = image.Separate().ToArray();

        ImageWriter.Add(separated);

        var    parser = new CharactorParser();
        string parsed = "";

        foreach (var charImg in separated)
        {
            parsed += parser.Parse(charImg);
        }

        Console.WriteLine(parsed);

        ImageWriter.Add(parsed.Select(x => FontData.Data[x]).ToArray());
        ImageWriter.Write(testCase.Num.ToString());

        int evalRes = FormulaEvaluator.Eval(parsed);

        return(evalRes);
    }