示例#1
0
 private void UpdateForm(IAdventOfCodeProblem problem)
 {
     TitleTextBox.Text       = problem.ProblemTitle();
     URLTextBox.Text         = problem.ProblemUrl();
     InputFileTextBox.Text   = problem.FileName();
     Part1ResultTextBox.Text = problem.SolvePart1().ToString();
     Part2ResultTextbox.Text = problem.SolvePart2().ToString();
 }
        private string RunTest(IAdventOfCodeProblem problem, string fileName, Func <string[], string> action)
        {
            var input = GetInput(fileName);

            var result = action(input);

            Console.WriteLine($"{problem.GetType().Name} = '{result}'");

            return(result);
        }
 public string PartTwoTest(IAdventOfCodeProblem problem, string fileName)
 {
     return(RunTest(problem, fileName, problem.PartTwo));
 }