Live data from Hacker News

Qlock – A JavaScript Quine Clock

aem1k.com

1–10 of 22 posts

Re: Qlock – A JavaScript Quine Clock

#4

If I want to roll it by hand and not use a minifier, is there a code golf dictionary of patterns for javascript?

Of course, search for "js code golf tips" to start. Many tips equally apply to C and JS due to the syntatic similarity, though JS-specific idioms like x|0 exist as well.

Re: Qlock – A JavaScript Quine Clock

#6
I have no clue what a Quine clock is, but I think it would be easier to read if the diagonal stroke on the front of the 1s only extended to the second row of characters from the top, instead of the third.

I noticed this because it was just 11:11 in my time zone >:)

Re: Qlock – A JavaScript Quine Clock

#7
post #6

I have no clue what a Quine clock is, but I think it would be easier to read if the diagonal stroke on the front of the 1s only extended to the second row of characters from the top, instead of the third. I noticed this because it was just 11:11 in my time zone >:)

a quine is where the full source is reprinted in the display.

So in this case, the code to create this clock in your website is

(r=n=>setInterval(t=>{for(j=o="\n",y=5;y--;document.body['inne' +'rHTML']="

&lt"+(S="script>\n")+o+"\n\n&lt/"+S)for(x=-001;
x++

which is also what is the clockface.

Re: Qlock – A JavaScript Quine Clock

#10
post #7
post #6

I have no clue what a Quine clock is, but I think it would be easier to read if the diagonal stroke on the front of the 1s only extended to the second row of characters from the top, instead of the third. I noticed this because it was just 11:11 in my time zone >:)

a quine is where the full source is reprinted in the display. So in this case, the code to create this clock in your website is (r=n=>setInterval(t=>{for(j=o="\n",y=5;y--;document.body['inne' +'rHTML']=" &lt"+(S="script>\n")+o+"\n\n&lt/"+S)for(x=-001; x++ which is also what is the clockface.

Also, adding the snippet will get rid of other content in the body element that might annoyingly distract from this beautiful clock :)
Post reply on HN