예제 #1
0
        protected override void InternalVisualize(TestCaseUI ui)
        {
            for (int x = 0; x < maze.Size.Width; x++)
            {
                for (int y = 0; y < maze.Size.Height; y++)
                {
                    if (maze.IsWall(new Point(x, y)))
                    {
                        DrawWall(ui, x, y);
                    }
                }
            }
            Point last = maze.Robot;

            foreach (var cur in robot.Path)
            {
                ui.Line(Conv(last.X), Conv(last.Y), Conv(cur.X), Conv(cur.Y), actualAnswerPen);
                last = cur;
            }
            ui.Circle(Conv(robot.X), Conv(robot.Y), cellSize / 3.0, actualAnswerPen);
            ui.Circle(Conv(maze.Exit.X), Conv(maze.Exit.Y), cellSize / 2.5, expectedAnswerPen);
        }
예제 #2
0
        protected override void InternalVisualize(TestCaseUI ui)
        {
            ui.Log("Calculated area: " + calculatedArea);
            ui.Log("Calculated isConvex: " + calculatedIsConvex);
            ui.Log("Expected area: " + area);
            ui.Log("Expected isConvex: " + isConvex);
            ui.Rect(new Rectangle(-90, -90, 180, 180), new Pen(Color.FromArgb(50, Color.Green), 1));
            Action <PointF> plot = p => ui.Circle(p.X, p.Y, 3, neutralPen);
            PointF          prev = scaledPoints.Last();

            foreach (var curr in scaledPoints)
            {
                plot(curr);
                ui.Line(prev.X, prev.Y, curr.X, curr.Y, neutralThinPen);
                prev = curr;
            }
        }