//ничья? bool Nobodywin(Army A, Army B) { if ((A.Take(0) is GG && B.Take(0) is GG) && (changeenumsList(A, B) && changeenumsList(B, A))) { return(true); } return(false); }
bool changeenumsList(Army A, Army B) { bool b = true; for (int i = 0; i < A.Count(); i++) { if (A.Take(i) is ArcherUnit) { List <IUnit> enemies = new List <IUnit>(); int k = i - A.SADistance(i); if (k < 0) { b = false; break; } } } return(b); }
bool changeenumsList(Army A, Army B) { bool b = true; for (int i = 0; i < A.Count(); i++) { if (A.Take(i) is ArcherUnit) { List <IUnit> enemies = new List <IUnit>(); int n = A.SADistance(i); if (i % 2 == 0) { int j = i - 2 * n + 2; int k = i + 2 * n; k = Math.Abs(i - 2 * n) - 2; enemies = B.NewList(0, k); } else { int j = i - 2 * n; int k = i + 2 * n - 2; k = Math.Abs(i - 2 * n) - 2; enemies = B.NewList(0, k); if ((k + 2) < B.Count()) { IList <IUnit> e = B.NewList(k + 2, k + 2); enemies.Add(e[0]); } } if (enemies.Count() > 0) { b = false; break; } } } return(b); }
bool Nobodywin(Army A, Army B) { bool b = false; if ((changeenumsList(A, B) && changeenumsList(B, A))) { if (A.Count() >= 2 && B.Count() >= 2) { if (A.Take(0) is GG && A.Take(1) is GG && B.Take(0) is GG && B.Take(1) is GG) { b = true; } } else if (A.Count() >= 2 && B.Count() < 2) { if (A.Take(0) is GG && A.Take(1) is GG && B.Take(0) is GG) { b = true; } } else if (A.Count() < 2 && B.Count() >= 2) { if (A.Take(0) is GG && B.Take(0) is GG && B.Take(1) is GG) { b = true; } } else if (A.Count() < 2 && B.Count() < 2) { if (A.Take(0) is GG && B.Take(0) is GG) { b = true; } } } return(b); }
bool Nobodywin(Army A, Army B) { bool b = false; if ((changeenumsList(A, B) && changeenumsList(B, A))) { int min; if (A.Count() == B.Count()) { bool c = true; for (int j = 0; j < B.Count(); j++) { if (!(A.Take(j) is GG && B.Take(j) is GG)) { c = false; break; } } b = c; } else { if (A.Count() < B.Count()) { min = A.Count(); } else { min = B.Count(); } int i; bool c = true; for (int j = 0; j < B.Count(); j++) { if (!(A.Take(j) is GG && B.Take(j) is GG)) { c = false; break; } } if (A.Count() > min) { if (!(A.Take(min) is GG)) { c = false; } } else { if (!(B.Take(min) is GG)) { c = false; } } b = c; } } return(b); }