Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 3516eda8 authored by Igor Poboiko's avatar Igor Poboiko

Fix fifteen puzzle solveability

Differential Revision: https://phabricator.kde.org/D5913
BUG: 358940
parent 9cf82093
......@@ -74,7 +74,7 @@ Item {
var blankRow = -1;
for (var i = 0; i < size; ++i) {
if (pieces[i].number == 0) {
blankRow = i / boardSize;
blankRow = Math.floor(i / boardSize);
continue;
}
for (var j = 0; j < i; ++j) {
......@@ -134,7 +134,7 @@ Item {
function checkSolved() {
var size = boardSize * boardSize;
for (var i = 0; i < size - 1; ++i) {
for (var i = 0; i < size - 2; ++i) {
if (pieces[i].number > pieces[i + 1].number) {
// Not solved.
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment