Skip to content

Conversation

@raywtham
Copy link

No description provided.


//populate cells in css
var pos = i +","+ j
$('.cell[data-position= "'+ pos +'"]').css('backgroundColor', grid[i][j])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for (var x = matrix - 1 ; x >= 0 ; x--) {
for (var y = matrix - 1; y >= 0 ; y--) {
if (grid[x-1] && grid[x][y] === 0) {
;[ grid[x][y],grid[x-1][y] ] = [grid[x-1][y], grid[x][y] ]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I know why did you put semicolone here?

var r = Math.floor(Math.random() * 255)
var g = Math.floor(Math.random() * 255)
var b = Math.floor(Math.random() * 255)
var $body = $('body')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may move line 173 to outside of the function. Then what will be the benefit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants