Live data from Hacker News

Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node

bitbucket.org

141–150 of 304 posts

Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node

#141
post #89

Congratulations! I showed your project to my 12 year old son who has just started to learn programming (in JS no less!) and his jaw dropped. In addition to being a programmer, you are now a role-model. Really well done.

Thanks a ton! Tell your son that it took me a while, and a lot of work, but it feels great to finish something (there are a lot of projects that I don't finish...). I began learning using Scratch a long time ago. They even featured me last year (the project was a solar system in which I used sine and cosine to calculate the rotation of the planets). I then used blocklike.js to move to JS. I watch a lot of YouTube vid…

sine and cosine last year? Now I want to know what your parents are feeding you!!! ;)

Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node

#142
post #89

Congratulations! I showed your project to my 12 year old son who has just started to learn programming (in JS no less!) and his jaw dropped. In addition to being a programmer, you are now a role-model. Really well done.

>I showed your project to my 12 year old son who has just started to learn programming (in JS no less!) It would be much better if he would start with Scratch, Processing, Smalltalk, or even Python. On JS he'll have to lose time coping with complicated build tools, horrible package system, async etc.

Is this serious? I started programming around 9 or 10 on a Commodore 64. I would go to the local library to get programming books for it. Now you can hit F12 in your browser and get a powerful console into JS. JS is fine, encourage the thirst for knowledge.

Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node

#144
post #141

Earlier quoted context omitted.

Thanks a ton! Tell your son that it took me a while, and a lot of work, but it feels great to finish something (there are a lot of projects that I don't finish...). I began learning using Scratch a long time ago. They even featured me last year (the project was a solar system in which I used sine and cosine to calculate the rotation of the planets). I then used blocklike.js to move to JS. I watch a lot of YouTube vid…

sine and cosine last year? Now I want to know what your parents are feeding you!!! ;)

[deleted]

Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node

#145

Great job! One way to improve this code is to add comments. Use comments to describe what each function does and what the parameters are supposed to be. Then you can tell at a glance what the function does without having to analyze the code later on. Us old people tend to forget things.

Comments in a twelve-year-old's code? For whom? Seven-year-olds? (I'm serious.)

Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node

#147
post #89

Congratulations! I showed your project to my 12 year old son who has just started to learn programming (in JS no less!) and his jaw dropped. In addition to being a programmer, you are now a role-model. Really well done.

>I showed your project to my 12 year old son who has just started to learn programming (in JS no less!) It would be much better if he would start with Scratch, Processing, Smalltalk, or even Python. On JS he'll have to lose time coping with complicated build tools, horrible package system, async etc.

This kid is practicing calculus at 12 years old. He will be able to handle a package manager.

Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node

#148
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

Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node

#149

Great work! I made a quick Observable notebook out of your code, in case anyone wants to see what it does without downloading or running it on their own machine: https://beta.observablehq.com/@jrus/wolfram-cellular-automat...

Hi Jacob, I never got to thank you for doing the observableHQ notebook for my quasirandom sequencing. For your information, I have linked to it on many occasions which includes in my post "Unreasonable Effectiveness of Quasirandom Sequences" which is on front page of HN right now! :) https://news.ycombinator.com

Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node

#150
post #141

Earlier quoted context omitted.

Thanks a ton! Tell your son that it took me a while, and a lot of work, but it feels great to finish something (there are a lot of projects that I don't finish...). I began learning using Scratch a long time ago. They even featured me last year (the project was a solar system in which I used sine and cosine to calculate the rotation of the planets). I then used blocklike.js to move to JS. I watch a lot of YouTube vid…

sine and cosine last year? Now I want to know what your parents are feeding you!!! ;)

I also picked up sine and cosine at around that age; it was thanks to programming.

Various example BASIC programs (e.g. Lissajous curve and circle plotters and such) used those functions and from their behavior I kind of picked up the relationship to both undulation and the circle. I found out about the arctangent function, and from that I realized that it could be used for 3D projection. I made a proof-of-concept program that mapped some connected points in 3D (boxes and whatnot) to 2D by calculating the visual angles using arctangents: i.e. I plotted the angle between the line of sight and each point, rather than a simple planar projection. It resulted in the objects appearing in a very nice "fish eye" perspective on the screen, which was very pleasing. From all that I learned about radians also and how there are "two pi" of them in a circle, since the functions accepted radians and not degrees.

You know how they say that necessity is the mother of invention; it's also the mother of learning trigonometric functions and whatever else.

Post reply on HN