Skip to content

Instantly share code, notes, and snippets.

@DarrenCattle
Last active August 29, 2015 14:02
Show Gist options
  • Save DarrenCattle/84258d40a6d0133b3950 to your computer and use it in GitHub Desktop.
Save DarrenCattle/84258d40a6d0133b3950 to your computer and use it in GitHub Desktop.
var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
var delay = 500;
var i = 0; var x = 0; var h = 0;
for(i = 0; i < 32; i++) {
for(x = 0; x < 32; x++) {
setTimeout(
(function(i,x) {
return function() {
h = (x+i)%32;
$('.col_' + h + '_' + x).click();
}
})(i,x), delay);
delay += 500;
}
}
var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
var delay = 200;
var i = 0; var x = 0;
var list = [];
//find all colored squares and add to list
for(i = 0; i < 64; i++) {
for(x = 0; x < 64; x++) {
if($('.col_' + i + '_' + x).style.backgroundColor)
list.push({"x": x,"y": i});
}
}
//eliminate list
for(var a = 0;a < list.length;a++) {
setTimeout(
(function(a) {
return function() {
$('.col_' + list[a].y + '_' + list[a].x).click();
console.log("coordinates: " + list[a].x + " , " + list[a].y);
}
})(a), delay);
delay += 200;
}
var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
var delay = 200;
var i = 0; var x = 0; var y = 0;
for(i = 0; i < 400; i++) {
setTimeout(
(function(i) {
return function() {
x=Math.round(Math.random()*31);
y=Math.round(Math.random()*31);
$('.col_' + y + '_' + x).click();
}
})(i), delay);
delay += 200;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment