Upgrade packages.

This commit is contained in:
Oleksii Trekhleb
2018-07-05 16:30:00 +03:00
parent 58640ee7b5
commit 17ad4dc4d1
14 changed files with 1695 additions and 542 deletions

View File

@@ -16,16 +16,16 @@ function isSafe(queensPositions, rowIndex, columnIndex) {
if (
// Check if queen has been already placed.
currentQueenPosition &&
(
currentQueenPosition
&& (
// Check if there are any queen on the same column.
newQueenPosition.columnIndex === currentQueenPosition.columnIndex ||
newQueenPosition.columnIndex === currentQueenPosition.columnIndex
// Check if there are any queen on the same row.
newQueenPosition.rowIndex === currentQueenPosition.rowIndex ||
|| newQueenPosition.rowIndex === currentQueenPosition.rowIndex
// Check if there are any queen on the same left diagonal.
newQueenPosition.leftDiagonal === currentQueenPosition.leftDiagonal ||
|| newQueenPosition.leftDiagonal === currentQueenPosition.leftDiagonal
// Check if there are any queen on the same right diagonal.
newQueenPosition.rightDiagonal === currentQueenPosition.rightDiagonal
|| newQueenPosition.rightDiagonal === currentQueenPosition.rightDiagonal
)
) {
// Can't place queen into current position since there are other queens that