-
-
Notifications
You must be signed in to change notification settings - Fork 357
/
Copy pathProgram.cs
40 lines (38 loc) · 1.25 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// submitted by Julian Schacher (jspp) with great help by gustorn
using System;
using System.Collections.Generic;
namespace JarvisMarch
{
class Program
{
static void Main(string[] args)
{
System.Console.WriteLine("JarvisMarch");
// Example list of points.
// The points are represented by vectors here, but that doesn't really matter.
var points = new List<Vector>()
{
new Vector(-5, 2),
new Vector(5, 7),
new Vector(-6, -12),
new Vector(-14, -14),
new Vector(9, 9),
new Vector(-1, -1),
new Vector(-10, 11),
new Vector(-6, 15),
new Vector(-6, -8),
new Vector(15, -9),
new Vector(7, -7),
new Vector(-2, -9),
new Vector(6, -5),
new Vector(0, 14),
new Vector(2, 8),
};
var jarvisMarch = new JarvisMarch();
var giftWrap = jarvisMarch.Run(points);
// Print the points of the gift wrap.
foreach (var point in giftWrap)
System.Console.WriteLine($"{point.x}, {point.y}");
}
}
}