From 3c945af49efdd76b8cd3d8121a025a17dd633b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=20=D0=91=D0=BE=D0=BD=D0=B4=D0=B0?= =?UTF-8?q?=D1=80=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Sun, 23 Oct 2022 18:47:37 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B5=D0=B4=D0=BF=D0=BE=D1=81?= =?UTF-8?q?=D0=BB=D0=B5=D0=B4=D0=BD=D0=B5=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WarmlyShip/WarmlyShip/MapWithSetShipGeneric.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/WarmlyShip/WarmlyShip/MapWithSetShipGeneric.cs b/WarmlyShip/WarmlyShip/MapWithSetShipGeneric.cs index 04dd7af..1f8a387 100644 --- a/WarmlyShip/WarmlyShip/MapWithSetShipGeneric.cs +++ b/WarmlyShip/WarmlyShip/MapWithSetShipGeneric.cs @@ -72,16 +72,16 @@ namespace WarmlyShip private void Shaking() { int j = _setShips.Count - 1; - for (int i = 0; i < _setShips.Count; i++) + for (int i = 0; i < _setShips.Count; ++i) { if (_setShips.Get(i) == null) { - for (; j > i; j--) + for (; j > i; --j) { - var ship = _setShips.Get(j); - if (ship != null) + var car = _setShips.Get(j); + if (car != null) { - _setShips.Insert(ship, i); + _setShips.Insert(car, i); _setShips.Remove(j); break; }