Bondarenko M.S. Lab Work 3 #8

Merged
eegov merged 12 commits from LabWork_03 into LabWork_02 2022-11-07 12:10:38 +04:00
Showing only changes of commit 3c945af49e - Show all commits

View File

@ -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;
}