Browse Source

Другой алгоритм для 5

TestMethods
parent
commit
e96f695bc3
  1. BIN
      .vs/comivoyar/v15/.suo
  2. BIN
      .vs/comivoyar/v15/Server/sqlite3/storage.ide
  3. BIN
      .vs/comivoyar/v15/Server/sqlite3/storage.ide-shm
  4. BIN
      .vs/comivoyar/v15/Server/sqlite3/storage.ide-wal
  5. 49
      comivoyar/Program.cs
  6. BIN
      comivoyar/bin/Debug/comivoyar.exe
  7. BIN
      comivoyar/bin/Debug/comivoyar.pdb
  8. 2
      comivoyar/bin/Debug/coord.txt
  9. 2
      comivoyar/obj/Debug/comivoyar.csproj.CoreCompileInputs.cache
  10. BIN
      comivoyar/obj/Debug/comivoyar.exe
  11. BIN
      comivoyar/obj/Debug/comivoyar.pdb

BIN
.vs/comivoyar/v15/.suo

Binary file not shown.

BIN
.vs/comivoyar/v15/Server/sqlite3/storage.ide

Binary file not shown.

BIN
.vs/comivoyar/v15/Server/sqlite3/storage.ide-shm

Binary file not shown.

BIN
.vs/comivoyar/v15/Server/sqlite3/storage.ide-wal

Binary file not shown.

49
comivoyar/Program.cs

@ -65,15 +65,15 @@ namespace komvo
else if (Points.Count == 5) waves = 4; else if (Points.Count == 5) waves = 4;
else if (Points.Count == 6) waves = 20; else if (Points.Count == 6) waves = 20;
int cn = 0, cn2 = 0; int cn = 1, cn2 = 0;
string inf = formP; string inf = formP;
for (int i = 1; i < waves + 1; i++) for (int i = 1; i < waves + 1; i++)
{ {
for(int j = 0; j < 6; j++) for(int j = 0; j < 6; j++)
{ {
if (i == 0 && j == 0) routes[j + (i - 1) * 6] = int.Parse(formP); 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)); 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)); 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); WriteLine("{0} {1}", formP, inf);
} }
else else
{ {
if (cn > 2) cn = 0; switch (cn)
formP = Swap(inf, cn++, 3); {
WriteLine("{0} {1}", formP, inf); 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; 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 public partial struct Point
{ {

BIN
comivoyar/bin/Debug/comivoyar.exe

Binary file not shown.

BIN
comivoyar/bin/Debug/comivoyar.pdb

Binary file not shown.

2
comivoyar/bin/Debug/coord.txt

@ -1,4 +1,4 @@
10 10 0 0
20 20 20 20
30 30 30 30
40 40 40 40

2
comivoyar/obj/Debug/comivoyar.csproj.CoreCompileInputs.cache

@ -1 +1 @@
6eed873852f8ce9c50ebe974dac1f20cc4ef270e a325577e7d0bb098d5c8871f5acaa6c0c34b21c6

BIN
comivoyar/obj/Debug/comivoyar.exe

Binary file not shown.

BIN
comivoyar/obj/Debug/comivoyar.pdb

Binary file not shown.
Loading…
Cancel
Save