Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
d3 syntaxr
<meta charset="utf-8">
<script src=""></script>
var a =
`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 =;
solve_time = end_time - start_time;
get('timer').innerHTML = readtime(solve_time);
times[times.length] = solve_time;
cubestate = 0;
.html(d=>d==" "?'&nbsp;':d)
.style('color',d=>`#17b #f70 #2a2 #d22 #96b #854 #e7c #777 #bb2`.split(' ')[`functionifvar}return(-.[&><;/)+{]'"=`.indexOf(d)%9])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment