-
-
Save sorah/99a643bdbcb978b0fada to your computer and use it in GitHub Desktop.
Google Developer Day 2011 Tokyo / DevQuiz: Web Game
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
a = $(".card").map(function(i,v){ | |
return $(v).click().css("background-color") | |
}) | |
r = [] | |
$(a).each(function(i,v){ | |
var ans = undefined; | |
var flag = true; | |
$(a).each(function(j,b){ | |
if(v == b && j != i ){ | |
ans = j; | |
} | |
}); | |
$(r).each(function(j,b){ | |
if(b[0] == ans && b[1] == i) { | |
flag = false | |
} | |
}); | |
if(ans && flag) { | |
r.push([i,ans]) | |
} | |
}); | |
$(r).each(function(i,v){ | |
$("#card"+v[0]).click(); | |
$("#card"+v[1]).click(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment