Voor het spel Geocaching heb ik een stukje code in C#. Deze code geeft bij compileren een geo-coordinaat. Wie helpt mij?
Alvast bedankt!
De code:
Private static void ShowCoordinates()
{
string dummy = "5320432941379723768723456";
int a = 0x34;
int b = 3; AddOne(b);
string c = Regex.Replace(dummy, "(?:9?[^8]0*)", "");
int d = 1 << 3;
int e = 1 ^ 2;
double f = 4.5;
int g = (int)5.9;
int h = 0 & 255;
int i = 4; i = (i % 2 == 0) ? ++1 : ++1;
string j = dummy.Substring(9, dummy.LastIndexOf('0'));
string coordinates = string.Format("\u004e{0}\u0020{1}{2}\u002e{3}{4}{5:0}\u0020", a, b, c, d, e, f);
coordinates = string.Format("{0}\u0045\u0030\u0030{1}\u0020{2}{3}\u002e{4}", coordinates, g, h, i, j);
Console.WriteLine("De cahe kan gevonden worden op:\n\n{0}", coordinates);
Console.Readline();
}
private static void AddOne(int, b)
{
b = b + 1;
}
Alvast bedankt!
De code:
Private static void ShowCoordinates()
{
string dummy = "5320432941379723768723456";
int a = 0x34;
int b = 3; AddOne(b);
string c = Regex.Replace(dummy, "(?:9?[^8]0*)", "");
int d = 1 << 3;
int e = 1 ^ 2;
double f = 4.5;
int g = (int)5.9;
int h = 0 & 255;
int i = 4; i = (i % 2 == 0) ? ++1 : ++1;
string j = dummy.Substring(9, dummy.LastIndexOf('0'));
string coordinates = string.Format("\u004e{0}\u0020{1}{2}\u002e{3}{4}{5:0}\u0020", a, b, c, d, e, f);
coordinates = string.Format("{0}\u0045\u0030\u0030{1}\u0020{2}{3}\u002e{4}", coordinates, g, h, i, j);
Console.WriteLine("De cahe kan gevonden worden op:\n\n{0}", coordinates);
Console.Readline();
}
private static void AddOne(int, b)
{
b = b + 1;
}