void MoveSmallDisc() { Pole poleWithSmallDisc = FindPoleWithSmallestDisc(); Disc smallestDisc = poleWithSmallDisc.PopDisc(); if (smallestDisc.GetDiscDirection() == Direction.ANTI_CLOCKWISE) { MoveAntiClockWise(smallestDisc); } else { MoveClockWise(smallestDisc); } }
void MoveBigDisc() { int reducer = 0; bool biggestPieceMoved = false; Pole poleWithBiggestDisc = FindPoleWithBiggestDisc(reducer); do { while (poleWithBiggestDisc == null) { reducer++; poleWithBiggestDisc = FindPoleWithBiggestDisc(reducer); } Disc discFound = poleWithBiggestDisc.PopDisc(); if (discFound.GetDiscDirection() == Direction.ANTI_CLOCKWISE) { if (MoveAntiClockWise(discFound)) { break; } } else { if (MoveClockWise(discFound)) { break; } } reducer++; int startingIndex = poleWithBiggestDisc.GetPoleReference(); poleWithBiggestDisc.PushDisc(discFound, startingIndex); poleWithBiggestDisc = FindPoleWithBiggestDisc(reducer); } while (!biggestPieceMoved); }