Created
May 22, 2014 15:47
-
-
Save gerasimua/c67599318a675a40f13e to your computer and use it in GitHub Desktop.
SmartGame
This file contains hidden or 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 f = function(c){ | |
var g = function(){return Math.floor(Math.random()*3);} | |
var colors = ['red', 'green', 'blue']; | |
var r = g(); | |
if(typeof c == 'undefined'){ c = 'red'} | |
while(colors.indexOf(c) === r){r = g();} | |
document.body.style.backgroundColor = c; | |
document.body.innerHTML = colors[r]; | |
setTimeout(function(){f(colors[r])}, 1000); | |
} | |
document.body.style.height = "100%"; | |
document.body.style.color = '#ffffff'; | |
document.body.style.fontSize = '64px'; | |
document.body.style.textAlign = 'center'; | |
document.body.style.paddingTop = '15%'; | |
document.body.style.backgroundImage = 'none'; | |
f(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment