Skip to content

Commit 8e1320e

Browse files
committed
Forgot to commit this
1 parent ec14e37 commit 8e1320e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tetris.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,20 +409,23 @@ function init(gt) {
409409
// make ten random numbers, make sure next isn't the same as last?
410410
//TODO make into function or own file.
411411

412-
digLines = [12, 13, 14, 15, 16, 17, 18, 19, 20, 21]
412+
digLines = [12, 13, 14, 15, 16, 17, 18, 19, 20, 21];
413413

414414
statsLines.innerHTML = 10;
415415
//TODO Use seed
416-
var randomNums = [];
416+
//TODO Shuffle 1-10
417+
var randomNums = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
418+
// Doesn't look random enough
419+
randomNums.sort(function() {return 0.5 - rng.next()});
417420
for (var i = 0; i < 10; i++)
418421
randomNums.push(~~(Math.random() * 10));
419-
console.log(randomNums);
420422
for (var y = 21; y > 11; y--) {
421423
for (var x = 0; x < 10; x++) {
422424
if (randomNums[y - 12] !== x)
423425
stack[x][y] = 8;
424426
}
425427
}
428+
drawStack();
426429
}
427430

428431
menu();
@@ -589,7 +592,6 @@ function addPiece(tetro) {
589592
else
590593
statsLines.innerHTML = digLines.length;
591594

592-
// Redraw the stack.
593595
drawStack();
594596
}
595597

0 commit comments

Comments
 (0)