Last active
July 7, 2021 07:26
-
-
Save ophentis/7a0e8079f7f66cdb9c1e to your computer and use it in GitHub Desktop.
http://zzzscore.com/1to50/en/ hacking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function go() { | |
return $('#grid div') | |
.get() | |
.map(function(div) { return {v:div.innerText|0,div:div} }) | |
.filter(function(box) { return box.v }) | |
.sort(function(a,b) { return a.v - b.v }) | |
.reduce(function(p,box) { | |
return p.then(function() { | |
return new Promise(function(resolve, reject) { | |
$(box.div).trigger('tap') | |
setTimeout(resolve.bind(null,box)) | |
}); | |
}) | |
},Promise.resolve()) | |
.then(function(more) { | |
return more && go() | |
}) | |
}() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment