diff --git a/.vs/comivoyar/v15/.suo b/.vs/comivoyar/v15/.suo index 5b171cf..98b5f1c 100644 Binary files a/.vs/comivoyar/v15/.suo and b/.vs/comivoyar/v15/.suo differ diff --git a/.vs/comivoyar/v15/Server/sqlite3/storage.ide b/.vs/comivoyar/v15/Server/sqlite3/storage.ide index 3be0b8b..c1e4051 100644 Binary files a/.vs/comivoyar/v15/Server/sqlite3/storage.ide and b/.vs/comivoyar/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/comivoyar/v15/Server/sqlite3/storage.ide-shm b/.vs/comivoyar/v15/Server/sqlite3/storage.ide-shm index fb21175..2ba1f10 100644 Binary files a/.vs/comivoyar/v15/Server/sqlite3/storage.ide-shm and b/.vs/comivoyar/v15/Server/sqlite3/storage.ide-shm differ diff --git a/.vs/comivoyar/v15/Server/sqlite3/storage.ide-wal b/.vs/comivoyar/v15/Server/sqlite3/storage.ide-wal index d9f76e0..c3199ab 100644 Binary files a/.vs/comivoyar/v15/Server/sqlite3/storage.ide-wal and b/.vs/comivoyar/v15/Server/sqlite3/storage.ide-wal differ diff --git a/comivoyar/Program.cs b/comivoyar/Program.cs index 1236ac0..77f78b4 100644 --- a/comivoyar/Program.cs +++ b/comivoyar/Program.cs @@ -65,15 +65,15 @@ namespace komvo else if (Points.Count == 5) waves = 4; else if (Points.Count == 6) waves = 20; - int cn = 0, cn2 = 0; + int cn = 1, cn2 = 0; string inf = formP; for (int i = 1; i < waves + 1; i++) { for(int j = 0; j < 6; j++) { - if (i == 0 && j == 0) routes[j + (i - 1) * 6] = int.Parse(formP); - else if (j % 2 == 0) routes[j + (i - 1) * 6] = int.Parse(formP = Swap(formP, 0, j / 2)); - else routes[j + (i - 1) * 6] = int.Parse(Swap(formP, 1, 2)); + if (i == 0 && j == 0) { routes[j + (i - 1) * 6] = int.Parse(formP); WriteLine(routes[j + (i - 1) * 6]); } + else if (j % 2 == 0) { routes[j + (i - 1) * 6] = int.Parse(formP = Swap(formP, 0, j / 2)); WriteLine(routes[j + (i - 1) * 6]); } + else { routes[j + (i - 1) * 6] = int.Parse(Swap(formP, 1, 2)); WriteLine(routes[j + (i - 1) * 6]); } } @@ -82,16 +82,34 @@ namespace komvo - if (i % 5 == 0) + if (i % 4 == 0 && waves > 4) { - formP = Swap(inf, cn2++, 4); + formP = Swap(formP, cn2++, 4); WriteLine("{0} {1}", formP, inf); } else { - if (cn > 2) cn = 0; - formP = Swap(inf, cn++, 3); - WriteLine("{0} {1}", formP, inf); + switch (cn) + { + case 1: + formP = Swap(formP, '2', '5'); + cn++; + break; + case 2: + formP = Swap(formP, '3', '2'); + cn++; + break; + case 3: + formP = Swap(formP, '4', '3'); + cn++; + break; + default: + WriteLine("???????"); + break; + } + if (cn > 3) cn = 1; + //formP = Swap(inf, cn++, 3); + //WriteLine("{0} {1}", formP, inf); } @@ -185,6 +203,19 @@ namespace komvo return value; } + public static string Swap(string value, char first, char second) + { + int f, s; + char[] res = value.ToCharArray(); + WriteLine(f = value.IndexOf(first)); + WriteLine(s = value.IndexOf(second)); + res[value.IndexOf(first)] = value[value.IndexOf(second)]; + res[value.IndexOf(second)] = value[value.IndexOf(first)]; + value = new string(res); + + return value; + } + public partial struct Point { diff --git a/comivoyar/bin/Debug/comivoyar.exe b/comivoyar/bin/Debug/comivoyar.exe index 78cdbba..eb2a5cd 100644 Binary files a/comivoyar/bin/Debug/comivoyar.exe and b/comivoyar/bin/Debug/comivoyar.exe differ diff --git a/comivoyar/bin/Debug/comivoyar.pdb b/comivoyar/bin/Debug/comivoyar.pdb index 066940a..d77edf6 100644 Binary files a/comivoyar/bin/Debug/comivoyar.pdb and b/comivoyar/bin/Debug/comivoyar.pdb differ diff --git a/comivoyar/bin/Debug/coord.txt b/comivoyar/bin/Debug/coord.txt index e0bcba9..d140c96 100644 --- a/comivoyar/bin/Debug/coord.txt +++ b/comivoyar/bin/Debug/coord.txt @@ -1,4 +1,4 @@ -10 10 +0 0 20 20 30 30 40 40 diff --git a/comivoyar/obj/Debug/comivoyar.csproj.CoreCompileInputs.cache b/comivoyar/obj/Debug/comivoyar.csproj.CoreCompileInputs.cache index e4c5453..125c6b5 100644 --- a/comivoyar/obj/Debug/comivoyar.csproj.CoreCompileInputs.cache +++ b/comivoyar/obj/Debug/comivoyar.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -6eed873852f8ce9c50ebe974dac1f20cc4ef270e +a325577e7d0bb098d5c8871f5acaa6c0c34b21c6 diff --git a/comivoyar/obj/Debug/comivoyar.exe b/comivoyar/obj/Debug/comivoyar.exe index 78cdbba..eb2a5cd 100644 Binary files a/comivoyar/obj/Debug/comivoyar.exe and b/comivoyar/obj/Debug/comivoyar.exe differ diff --git a/comivoyar/obj/Debug/comivoyar.pdb b/comivoyar/obj/Debug/comivoyar.pdb index 066940a..d77edf6 100644 Binary files a/comivoyar/obj/Debug/comivoyar.pdb and b/comivoyar/obj/Debug/comivoyar.pdb differ