Created
April 20, 2020 01:34
-
-
Save faller222/f25ee2b92973a4dc86b7c4539228e44a to your computer and use it in GitHub Desktop.
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
var time =5 | |
function part2(map, boxes){ | |
if($("div.second").length>=25){ | |
for(var i=0;i<25;i++){ | |
var b = boxes[i]; | |
var pos = parseInt(b.innerText); | |
map[pos]=b; | |
} | |
for(var i=26;i<51;i++){ | |
$(map[i]).trigger("tap"); | |
} | |
} | |
} | |
function part1(time){ | |
var grid = $(".grid.x5").get(0); | |
var map={}; | |
var boxes = grid.getElementsByTagName("div") | |
for(var i=0;i<25;i++){ | |
var b = boxes[i]; | |
var pos = parseInt(b.innerText); | |
map[pos]=b; | |
} | |
for(var i=1;i<26;i++){ | |
$(map[i]).trigger("tap"); | |
} | |
setInterval( part2, time,map,boxes) | |
} | |
part1(time); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment