Created
February 23, 2016 21:21
-
-
Save kirjavascript/abb351789a27ca0ca616 to your computer and use it in GitHub Desktop.
syntax golf
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
<meta charset="utf-8"> | |
<style>body{font-size:28px}</style> | |
<body></body> | |
<script> | |
`function readtime(time) { | |
if (time == 'DNF') { return time; } | |
time = parseInt(time); | |
var min = 0; | |
var sec = (Math.floor(time/1000)%60); | |
min = Math.floor(time/60000); | |
if (min!=0&&sec<10) { sec = '0'+sec; } | |
time = Math.floor(time/10); | |
time = time.toString().slice(-2); | |
if (min) return min+':'+sec+'.'+time; | |
else return sec+'.'+time; | |
} | |
function stoptimer() { | |
end_time = performance.now(); | |
clearInterval(window.timer); | |
solve_time = end_time - start_time; | |
get('timer').innerHTML = readtime(solve_time); | |
times[times.length] = solve_time; | |
updatetimes(); | |
cubestate = 0; | |
}`.match(/\W|\w*/g).forEach(d=>document.body.innerHTML+=(d=='\n'?'<br>':d==' '?' ':`<span style="color:#`+`17bf702a2d2296b854e7c777bb2`.match(/.../g)[`functionifvar}return(-.[&><;/)+{]',$=_"forinelse%!whileletconst`.indexOf(d)%9]+`">${d}</span>`)) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment