Created
October 21, 2012 03:39
-
-
Save hyqhyq3/3925580 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 t = new Date().getTime() | |
function getTime() { | |
return (new Date().getTime()-t)/1000; | |
} | |
function fun(n,order) { | |
console.log(getTime(),"卡片" + n + "正面") | |
setTimeout(function(){ | |
console.log(getTime(),"卡片" + n + "反面") | |
setTimeout(function(){ | |
fun((n+1)%4, order+1) | |
}, (order +1) * 5000) | |
}, 5000) | |
} | |
setTimeout(function(){fun(0,1)},5000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment