aboutsummaryrefslogtreecommitdiffhomepage
path: root/qml/Bit.qml
diff options
context:
space:
mode:
Diffstat (limited to 'qml/Bit.qml')
-rw-r--r--qml/Bit.qml6
1 files changed, 5 insertions, 1 deletions
diff --git a/qml/Bit.qml b/qml/Bit.qml
index be6d0f6..6563e73 100644
--- a/qml/Bit.qml
+++ b/qml/Bit.qml
@@ -37,12 +37,16 @@ Loader {
var indices = root.matrix.slice(0, bits);
var transformed = [];
indices.forEach(function(elem) {
- transformed.unshift((pad((parseInt(elem) >>> 0).toString(2), bits))[grid.row - 1]);
+ transformed.push((pad((parseInt(elem) >>> 0).toString(2), bits))[grid.row - 1]);
});
var transformed_num = parseInt(transformed.join(""), 2);
this.text = transformed_num;
root.matrix[index] = transformed_num;
+ if (transformed_num === 0) { // A rather dumb fix.
+ root.check(index - 1);
+ root.check(index - 1);
+ }
} else if (index !== bits){
var num = Math.floor(Math.random() * (Math.pow(2, bits) - 1)) + 1;
this.text = num;