Lurker News

Comments (283) 76 threads

Earlier comments
kritixilithos#
Congratulations!

Are you familiar with code golf? If not, I recommend it. In Code Golf, the objective is to complete a programming task in the shortest program possible, measured in bytes. While doing so, you really learn about the nuances of your language and its obscure features.
When I was about your age, I joined the code golf community at Stack Exchange, and since then my JS skills and general programming skills have improved greatly. I hope that you would find it to be useful too.

mandeepj1 reply#
Congrats.

> dimensional cellular automata in witch all possible rules are encoded into one byte as described here
Small typo here - should be "which" instead of "witch"

liamilan#
Thanks for pointing that out. Fixed.
tinchox5#
Hi Liam! I'm your occasional HN neighbour I live currently just below your post :) (Show HN: A smarthome dashboard concept using zircle-ui).

It's a pleasure to see the impressive reception that your post is having. Also I want to join all the voices of congratulations you have received for your work at your age! Keep doing this kind of things, It is very inspiring for all!

Qwertie1 reply#
Nice work. I'm not a JS expert but I think I saw a bug.

Inside of animate() you are calling setTimeout() to automatically call animate repeatedly but this is also calling setTimeout() every time animate runs but setTimeout() should only be run once.
You should be able to take

  setTimeout(() => {
    animate();
  }, 100);
and paste it over animate() on the last line
telcy1 reply#
What you mean is setInterval and does work well for synchronous execution. His approach is correct and would even work if the animate function is asynchronous as the next tick gets scheduled at the end of animate function execution.
Qwertie1 reply#
Ah yes, you are right. Got those mixed up.
derrikcurran1 reply#
Recursive setTimeout is a great way to allow for easy timing/speed changes on the fly.

Continue this thread — 1 reply

Load more comments