
Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node - liamilan
https://bitbucket.org/liamilan/wolfram-cellular-automata
======
sgk284
Liam, this is _incredible_!

I thought it might be useful for you to incrementally see how someone in
industry would review or change this code, so here's a little code review via
video: [https://youtu.be/UkVOrcS--04](https://youtu.be/UkVOrcS--04)

We very incrementally build up to the final code, which can be found here:
[https://gist.github.com/stevekrenzel/b490564bf1c7f98e232a6c8...](https://gist.github.com/stevekrenzel/b490564bf1c7f98e232a6c863bd066dd)

Hope you find it helpful!

~~~
hashbig
If you would start a channel where you review code of random public repos I
would definitely subscribe. Well done.

~~~
sgk284
Thanks for the kind words! Will definitely consider.

~~~
ObsoleteNerd
I would absolutely sub to this.

------
sramam
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.

~~~
flavio81
>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.

~~~
skeeterbug
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.

~~~
not_kurt_godel
JS is an objectively bad programming language. It is not fine, it is just
annoyingly common and convenient. The main advances in its ecosystem are
related to transpiling it from other, saner, languages. If he has fun writing
JS, then great for him. He's 12, he'll do it if he wants. But it'd be doing
him a disservice not to open his eyes to much wider, greener pastures of the
programming world.

~~~
exDM69
JS is a bad language but it's the easiest environment to set up.

Back in the day we started with Qbasic not because it is a good language but
because that was easy to set up, we all had it and our friends had it and our
school computers had it.

And JS is less bad a language than Qbasic.

~~~
kilon
That's debatable. It's not as if downloading Python and making your first app
will take you more than a few seconds, minus download time.

Set up is rarely an issue, once you set up a language even as complex as C++
its completely automated. You press a button and magic happens.

If the biggest selling point of a programming language is that it comes
preinstalled with the OS of your choice, its not much of a selling point when
the average user downloads and installs GBs of data just to play the latest
game hype like Fortnite.

The only people who mind installing stuff are predominately web devs. 99.9% of
users out there are fine with it for more than 6 decades now and that wont be
changing any time soon.

~~~
exDM69
It does make a difference especially to a beginner or a child. You might not
have admin privileges at your school or your friends may not be able to
install those tools so you can't show your work.

But you can hack away on any computer with a browser.

~~~
kilon
there are tons of services only that will allow you to code online using any
language eve C , C++ and Assembly. From inside the browser of course. Of
course I am not recommending a beginner to start from any of those languages
but it shows that JS does not have the monopoly of in browser coding. If you
have to stick with browser no matter what.

Ideone is a popular example [https://ideone.com/](https://ideone.com/)

------
jacobolus
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...](https://beta.observablehq.com/@jrus/wolfram-cellular-automaton)

~~~
crooked-v
Dang, that's a neat tool. It's different enough from a Node environment,
though, including some of the necessary rewrites of stuff, that I wonder if a
"more Node-y" sandbox would be more useful for this particular case. An
example:
[https://codesandbox.io/s/r0kwk0o28p](https://codesandbox.io/s/r0kwk0o28p) (I
tweaked the rule number, column width, and output to print to the page, but
otherwise it's the same as the original.)

------
scottmf
Hey looks good :)! Just a few things you might not know about:

Google String.prototype.padEnd. It’s built in to JS and should be able to
replace your zero fill function.

And instead of mutating the ruleSet array you should be able to use
Array.prototype.map like this:

const ruleSet = zeroFill(8, rules.toString(2)) .split('') .reverse() .map(item
=> parseInt(item, 10));

And you can clone arrays like this, instead of using loops:

const oldArr = [...arr];

Also arrays are still mutable even if you assign them to const variables.

I’d offer more help but I’m on mobile. Sorry for the poor formatting. Hope
this helps anyway. Good luck!

~~~
erikpukinskis
Good tips if you want your code to fail randomly on older devices.

~~~
Varcht
Older devices running node?

~~~
ateesdalejr
Surprisingly there are some embedded developers who use Node. I would assume
those devices have a trimmed version of the Node stdlib.

~~~
ascorbic
I'm sure when he ports it to Espruino he can handle Babel.

------
ninjakeyboard
Good for you young jedi. I started coding around that age as well. I made the
mistake of not going through comp-sci but have still been able to work for
Google, publish books, lead teams and companies and products. You'll do just
fine.

You have the ability to write some code! If you want to get a jumpstart, you
should take the princeton algorithms course (for free!):
[https://www.coursera.org/learn/algorithms-
part1](https://www.coursera.org/learn/algorithms-part1)

Or read the textbook by sedgewick that accompanies the course.
[https://algs4.cs.princeton.edu/home/](https://algs4.cs.princeton.edu/home/)

There is very little math in there - it may take some elbow grease and
mentorship to help to convey some of the ideas - but I believe that you could
implement and solve most everything in there. That was my path - I had a
teacher at the age of 14 who would explain to me how different algorithms
worked and I would go and implement them. Drawing a circle (in memory - it was
in C!) or sorting a list (we did bubblesort first IIRC!)

I think you could do it! I believe in you! The course material is approachable
- much more so than basically every other algorithms/data-structures material
I've found. it may take you some time but you'll be soooo far ahead with your
thinking about code.

If you ever start working with Object oriented languages like Java, another
book that may help you when you've gone down the road a bit is the Head First
Design Patterns book.
[http://shop.oreilly.com/product/9780596007126.do](http://shop.oreilly.com/product/9780596007126.do)
It's very easy to read, mostly pictures. It is made to be very easy to read
(all of the books in that series are so look around at them.)

It's helpful to do both - code and also take in some material, but at 12 I
imagine some of the material may be a bit daunting. You're doing really well -
keep it up.

------
deepaksurti
Liam, brilliant!

I am not saying you don't do this, but please please ensure you always sleep
well, follow a good diet and go out and play.

Sometimes, computers make us give up good habits!

Kudos for your great work and keep learning, keep shipping!

------
shamdasani
Woah - very cool! I'm a part of Hack Club
([https://hackclub.com](https://hackclub.com)), which is a nonprofit worldwide
network of high school coding clubs. Hack Club has an amazing community of
young developers - I actually lead a Hack Club at my high school, and I
definitely recommend that you join their slack
([https://hackclub.com/slack_invite](https://hackclub.com/slack_invite)) to
connect with other young makers!

By the way, I'm a 17 year-old developer
([https://shamdasani.org](https://shamdasani.org)), but I probably started
~14. My main project is Enlight ([https://enlight.nyc](https://enlight.nyc))
to teach others to code by building projects. If you'd like to contribute,
that would be awesome - feel free to shoot me an email :)

~~~
zachlatta
Hey Samay! To all in the thread, I started Hack Club and am happy to answer
any questions about the org.

Liam, this is super cool. I also got started young and wish I had the skills
to frontpage at 12 :-). Keep it up!

Would love to have you say hi in the Hack Club Slack. I'm @zrl.

------
rjplatte
That's awesome. What resources did you use to learn Node and JS? Just looked
at your code. Kid. You're a badass. Keep this up, you'll go places.

~~~
liamilan
Thank you! I'm watching a lot of Youtube videos. This is how I got to cellular
automata. My dad showed me git last week.

~~~
rjplatte
That's so freaking cool. Git rocks, and I remember how psyched I was when I
learned about it. What's your next project?

~~~
liamilan
I'm not sure. I'm always messing around with different projects.

I used blocklike.js to jump from Scratch to JavaScript. Then I worked for
months on this one game for the app store called Sticky Quest. You can find it
here: [https://itunes.apple.com/us/app/sticky-
quest/id1425679649?mt...](https://itunes.apple.com/us/app/sticky-
quest/id1425679649?mt=8) This how I learned how to use npm packages such as
Cordova and Eslint.

~~~
Obi_Juan_Kenobi
You could try expanding this project beyond elementary CAs.

One option is a 'totalistic' CA which looks at the average value of a given
neighborhood, and can have more than two states.

[http://mathworld.wolfram.com/TotalisticCellularAutomaton.htm...](http://mathworld.wolfram.com/TotalisticCellularAutomaton.html)

Or you could generate CAs with different starting conditions. Some beautiful
elementary CAs don't 'show up' with just one initial point.

~~~
DonHopkins
The Moveable Feast Machine is similar to cellular automata, but different in
some important ways, that make it extremely robust and fault tolerant:

It's a "Robust First" asynchronous distributed fault tolerant cellular-
automata-like computer architecture.

Robust programs running on massively parallel unreliable hardware can actually
tolerate hardware failure and repair themselves. The Demon Hoard Sort
algorithm is an inherently robust sorting algorithm for the Moveable Feast
Machine.

[http://movablefeastmachine.org/](http://movablefeastmachine.org/)

The "Distributed City Generation" video demonstrates a Movable Feast Machine
rule that builds a self-healing city that fills all available space with urban
sprawl, with cars that drive between buildings, and city streets that
adaptively learn how to route the cars to their nearest destinations, and the
city even repairs itself after disasters!

[https://www.youtube.com/watch?v=XkSXERxucPc](https://www.youtube.com/watch?v=XkSXERxucPc)

Here's some more info:

[https://news.ycombinator.com/item?id=14236973](https://news.ycombinator.com/item?id=14236973)

------
tannerwj
Looks great. I tried it and it runs fine. Nice syntax and convention.

Just a tip, you don't need to include `npm init` in your instructions. That
command only needs to run when you create a new project. It worked just fine
for me with just a `node index.js 18`

Great work!

~~~
liamilan
Thanks! You're right, I fixed it.

------
mockingbirdy
Great that you start so early, I've did the same. For me it was a great way to
gain confidence and build a skill which is very useful. I wouldn't be the same
person now if I didn't program so early.

Seeing how things come to life that you've build with your own hands is a very
empowering experience. Keep it up! :)

------
52-6F-62
Far better than I could do at that age!

I think the furthest I was getting at that time was building out really
terrible looking web pages in Notepad and making awful little animations in
BASIC and Turing (learning lang).

Keep it up!

~~~
markatkinson
I made a colourful ASCII birthday cake in Pascal that beeped happy birthday at
that age. Still one of my proudest programming moments.

~~~
vram22
writeln(chr(7)) ?

or something more (e.g. playing different frequencies to sound like the happy
birthday song)?

Related, and good fun for kids of all ages (first did something like this on
my earliest home computer [1]):

Play the piano on your computer with Python:

[https://jugad2.blogspot.com/2013/04/play-piano-on-your-
compu...](https://jugad2.blogspot.com/2013/04/play-piano-on-your-computer-
with-python.html)

[1] Lissajous hippo, retrocomputing and the IBM PC Jr.:

[https://jugad2.blogspot.com/2012/09/lissajous-
hippo.html](https://jugad2.blogspot.com/2012/09/lissajous-hippo.html)

Western classic music fans may find the comments on that post interesting -
stuff about octaves and frequencies.

------
test6554
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.

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

~~~
tchaffee
How about for a 32 year old who is just learning JavaScript and comes across
this repo? Age has nothing to do with it.

------
gilesvangruisen
This is awesome! Keep up the good work. As a fellow developer who began
writing software around your age, I have some advice that is definitely
subjective and biased, but which you may indeed find helpful.

1\. Keep practicing. Practice makes perfect. Explore different languages,
frameworks, and problem spaces (interfaces, servers, distributed systems,
statistics, etc.) to see what you find most interesting. You will make
mistakes, and that is okay. That is how you learn.

2\. Take frequent breaks. Programming is hard work. It can be truly
exhausting, and you should not be afraid to step away and go for a walk or
something.

3\. The most valuable people in the industry are called "T"s. I.e. people with
a little bit of knowledge/experience across broad range of topics (the
horizontal part of the letter T), but who have deep knowledge/experience in
one or a couple particular topics (the vertical shaft of the letter T).

4\. Begin to develop the skill of taking feedback and accepting criticism.
There's a lot of people out there who will be quick to criticize everything
you do if you put it out into the open. It's a whole skill in itself to be
able to interpret this feedback and separate the signal from the noise. Try to
empathize with the person or group providing feedback and understand that
their motives/perspective may be different from yours. Sometimes that's a
useful thing. Sometimes it's a distraction.

5\. Dn't take things too personally. You are not your code. A criticism of
your code is not a criticism of your character. The less you take things
personally, the easier it is to work with others. After all, the most
impressive systems require immense collaboration.

6\. Don't take yourself too seriously. Have some fun with it! Programming is
super fun, so you should ask yourself regularly "am I still having fun?". If
the answer is "No", maybe find something else interesting to focus on for a
bit.

7\. Broaden your perspective. Along the lines of #1 and #2, it's important to
maintain a broad perspective and push yourself to keep expanding your
perspective. This doesn't just apply to technical problem areas or languages
or frameworks. The best engineers are good problem solvers because they have a
broad perspective not just of the problem space but also more generally of the
world they inhabit. Try to learn about different industries, cultures, people,
and places. You will become a more well-rounded character for doing so, with a
higher ability to empathize with others and understand the complex mechanics
of how the world works.

8\. Be social. I made the mistake of hiding in my room on a computer for much
of my childhood, and it wasn't until high school that I really began to
understand the value of social interaction and maintaining strong solid
friendships. It's as important to spend time away from the computer as it is
too keep practicing.

All the best. Good luck!!

~~~
godelmachine
Would you please provide an example on how one proceed with T shaped learning
and expertise?

~~~
gilesvangruisen
That's a good question. I left that intentionally broad so as not to prescribe
a certain type of learning system or self-education.

There's a lot of ways to learn anything, but I would say that the first step
is pursuing a _variety_ of subjects that you find interesting, and even some
you think are boring. A lot of seemingly boring things I've found turn out to
be quite fascinating when it comes down to it. (e.g. database design)

Over time, you will pick things up, and put them back down. You will return to
some, and stay away from others, but eventually you will build a repertoire of
knowledge and experience in a variety of different fields. I would also bet
that at least one subject will interest you so much that you keep coming back
and in which you will ultimately develop expertise.

Experimentation is the name of the game!

~~~
godelmachine
Thanks for replying, Giles!

I see just dabbling in whatever interests and experimenting with them takes
one forward.

What you wrote is profoundly impactful.

------
deusofnull
This is awesome liam. im just over twice your age and am just now writing game
of life simulators.... man, what was i doing at 12???

~~~
jchw
Trust me, there can be downsides to starting early. In my case, I virtually
skipped having social interactions not on the internet until I was around 20
or so. Not everyone will have this kind of affliction, but you can't have it
all - you gotta choose what's important to you. I hope this doesn't come off
as being too negative, I mostly say this because I think you should try to
appreciate what you did learn rather than lamenting about not being able to
start with coding super early.

...that being said, this is way cleaner than any code I'd written at 12 I'm
pretty sure.

~~~
earenndil
With that said, it can also have the opposite effect. Success in online
interactions at such an age gave me the confidence I needed to be successful
in irl interactions.

------
jcrza
I guess I'm the only one here doubting that the combination of both this
project and the language used in the comment replies is coming from a 12 year
old.

Take it as a compliment if it's legitimate.

~~~
otakucode
Probably not the only one, it's very common for people to be extremely
prejudiced against the young. As with other prejudices, of course, it's wrong
and only scores accurate evaluations by chance. The only thing which prevents
any person, of any flavor or age or background or whatever, from producing
such work and comporting themselves in such a manner is not having learned it
or not practicing it themselves. Anything blamed on 'age' is normally just an
indictment of the society that hasn't provided appropriate education or
incentives.

I was a precoscious kid myself, and took to online communities with vigor
specifically because it permitted me to interact with adults as equals without
them constantly dismissing me without basis apart from my age. I've not
forgotten that, and if anything society now is even more egregiously bigoted
towards the young than ever. Next time you read an article about "kids" or
"teenagers" or "adolescents", try mentally substituting in "women" or "African
Americans" for the group identity they're talking about. You might be
surprised how identical the claims made, and the weak support given for them,
are.

~~~
jcrza
No, it's not the same as doing that for women or black people.

People lie about their gifted child to get them exposure all the time. People
doing that with art comes to mind. Or even just a parent doing assignments for
their kid.

You're not being creative enough if you can't imagine a world in which someone
would lie about something on the internet for attention.

------
jpamata
Hey man, great job! You got some great advice here from the HN crowd and I'd
just like to add one more: blog.

Set up your own site and blog about your journey and the lessons you've picked
up along the way. Learning is about working and reflection. Blogging is a good
platform for that. The very act of writing the content itself is reinforcing
your knowledge. Dive into the work, research, reflect, stay hungry and repeat.
That's what it's all about. Apart from that, you'll be expanding your network
as well. Having some amount of folks following your journey is not just a good
way of inspiring oneself, but also gives you an opportunity to inspire others
as well.

Anyways, keep it up! You're definitely going places.

------
mayneack
IANAL and all that and it doesn't bother me, but the first thing I thought of
was the age related ToS restrictions from the HBO Silicon Valley show.

From the HN "legal" page:

> If you are under 13 years of age, you are not authorized to register to use
> the Site.

[https://www.ycombinator.com/legal/](https://www.ycombinator.com/legal/)

I assume no 12 year olds actually try to follow this boilerplate on the
internet. Do sites that require a DOB to sign up reject those under 12?

~~~
otakucode
The legal restrictions are not actually on Liam, or any user. They are on the
site itself. The law in the US prevents the collection of any personal
information from anyone under 13 years of age. Once you are 13 years old, you
are a trackable, surveillable, profilable, saleable commodity. Prior to that,
though, your personal info is protected from collection.

But... HN doesn't actually collect any personal info. So, that's likely either
a reflex inclusion of such a clause or just an abundance of caution.

------
ArtWomb
Good job! I mentor college CS majors whose code is not as clean as this.
Seriously.

I would also recommend checking out The Coding Train. NYU ITP Daniel
Shiffman's lectures on creative coding. It's time to get started with graphics
;)

[https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw](https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw)

And to get a headstart in Artificial Intelligence, from the same author comes
the ml5.js library: friendly machine learning for the web. Best of luck!

[https://ml5js.org/](https://ml5js.org/)

------
strainer
I like how the array named 'map' reflects our original use of this word,
rather than the special meaning which it has acquired to programmers.

In Javascript and other languages 'map' has become a kind of "functional
operation" so we cant call things 'map' anymore (in public). We have to say
'space' or 'state' or 'grid' or something... but I do still think 'map' was
good.

Congratulations on a very efficient and readable project. Bravo !

~~~
FPGAhacker
Programmers got it from mathematicians. I had the impression it was a fairly
long standing use of the word.

~~~
jacobolus
Mathematicians got it directly from cartography. A “map” “maps” points from
one set of coordinates to another, for example when you want to plot latitude
and longitude on a flat paper.

------
g105b
I'm particularly fond of this because at 12 when I was learning to program I
never thought it was important to keep my work safe, or even documented at
all, and it all exists on a hard drive in landfill now.

If you pursue a career in programming, you'll look back at your early work and
have a great personal self-documentation tool to remind you of how far you've
come.

------
forthispurpose
Everything about it is optimism-inducing on a very deep level. The post
itself, the reaction, the answers, the discussion.

~~~
yeukhon
Well, you either congratulate, or you get downvoted for not being nice. Your
choice here on HN.

------
jVinc
It's amazing that at the same age Steven Wolfram himself had written his first
100 page book "concise directory of physics) and at just one year older wrote
his first book on quantum physics.

~~~
ateesdalejr
From all the amazing things Mr. Wolfram has done at such a young age almost
makes him the Chuck Norris of science.

~~~
aj7
Catching the disease of cellular automata isn’t a good thing. Fredkin was also
affected. This young person has many years to do useful things.

~~~
DonHopkins
Unfortunately it was cancer from the radiation of atomic bomb tests that
killed John von Neumann far too early, not his experiments with cellular
automata.

[https://www.hnf.de/en/permanent-exhibition/exhibition-
areas/...](https://www.hnf.de/en/permanent-exhibition/exhibition-areas/hall-
of-fame/john-von-neumann-1903-1957.html)

[https://en.wikipedia.org/wiki/Von_Neumann_cellular_automaton](https://en.wikipedia.org/wiki/Von_Neumann_cellular_automaton)

[https://en.wikipedia.org/wiki/Von_Neumann_universal_construc...](https://en.wikipedia.org/wiki/Von_Neumann_universal_constructor)

------
jrumbut
I feel bad for all the other 12 year olds whose parents just saw this :)

~~~
onion2k
It's great to be writing code at 12 if you want to write code, and clearly
this kid has a talent for it, but that doesn't detract from what all the other
12 year olds are doing. So long as they're happy and safe to do what they want
to do it's all good. Growing up is not a competition.

Also, while it may seem great to learn early, I've worked with people who
didn't write a line of code until they were in their 50s and they were far
better at it after a few years than I am despite having 20 years more
experience. Some people have a gift. Others have to really work at it. Sadly
I'm in the second group. :)

~~~
rosege
What about those of us in the 3rd group - started late and have to work hard
at it!

------
calhoun137
This is so great and I am really impressed, and even a little inspired! When I
was 12 there was no internet and learning programming was really hard, but it
was more fun for me than anything else. Your project has reminded me how I
felt so many years ago when I was 12 and I would sneak out of bed to program
QBASIC on my APPLE 2C. Thanks for the inspiration and keep up the great work!
Keep working hard like this and you will become a master programmer of the
first rank.

------
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.

------
mandeepj
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!

------
Qwertie
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

~~~
telcy
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.

~~~
Qwertie
Ah yes, you are right. Got those mixed up.

~~~
derrikcurran
Recursive setTimeout is a great way to allow for easy timing/speed changes on
the fly.

~~~
telcy
good point :)

------
amasad
That's really awesome. Here it is running in a Node repl in the browser if you
want to try it quickly (the code verbatim but hardcoded the rule number to 18)
[https://repl.it/@amasad/wolfram-cellular-
automata](https://repl.it/@amasad/wolfram-cellular-automata)

------
transitivebs
You're off to an amazing start!

I'd say just find stuff that genuinely interests you and try to build it. I
got my start focusing on games, but whatever gets you excited. You're already
way ahead of the curve, so have fun with it, experiment, and you'll do great
things :)

------
brianzelip
Nice work! I hacked together something similar for the browser after watching
a FunFunFunction video about automata,
[https://brianzelip.github.io/automata](https://brianzelip.github.io/automata)

(not ideal on mobile)

------
Aardwolf
Off topic for the main achievement :)

But: if I open the bitbucket link on mobile, the left part of the text is
clipped and it doesn't allow scrolling left.

With "request desktop site", it works perfect.

Why does mobile mode even exist if the desktop site works better??

~~~
ronilan
I tend to read my own code in bed on the phone after I commit.

The new Bitbucket interface really dropped the ball on this. It is almost
unusable.

I hope they’ll fix it...

~~~
vram22
Send a request ...

------
FuckOffNeemo
This has suddenly became the most wholesome thread I've ever read on HN.

This is why HN is great.

------
swat535
This is really amazing, reminds me of my childhood days..

I showed this to my girlfriend's sister whom has shown interest in
programming, today I learned that she decided to drop her art classes in
favour of some programming courses!

Well done!

------
brtknr
That’s so cool! When I was 12, the best I built was a game of Who wants to be
a millionaire in Qbasic and this is whole another level from that! You are
inspirational!

------
mbrodersen
Great work :-) I had fun programming Basic and Z80 assembler when I was 11 as
well. I always remember it as being a great time of discovery and passion.

------
lucasverra
Just stepping by to say, congrats for shipping, congrats for posting ! Im 32
and will be posting my public beta next week !

------
thieving_magpie
Congratulations Liam. This is great.

------
davekam
not sure why the age matters?

------
neelkadia
Congratulations Liam!!!

You're doing phenomenal. You'll be role model for up-coming generation.

Great!!

------
chriselles
Congrats! I have shown this to my 13 and 12 year old sons to inspire them.

------
CommanderData
Well done little one. Keep it up and hats off to your parents.

------
timmonsjg
Impressive. Keep it up!

------
wavefunction
Keep it up, this is exactly how great programmers are made!

------
slics
This tells you that talent can be discovered at any age.

------
rootw0rm
congrats! when I was 12 I was war dialling BBSes and pirating shareware games.
hopefully your future turns out bright.

------
mvpu
Great! Now redo this in Python and GoLang :)

------
stevefan1999
Wow, you really had great potentials in CS!

------
fullofsid
You are amazing, keep learning more. :)

------
mcs_
Thank you Lia. You inspired me today.

------
willbw
Well done mate, very impressive.

------
iammer
Very nice.

------
benvineyard
Holy $hit! Nice work man!

------
benvineyard
Holy $hit. Nice work man!

------
jmkni
Very nice work!

------
slolean13
its brilliant, congratulations!

------
whitepoplar
Great work!

------
adultSwim
Cool!

------
mito88
Good work!

------
ultrasounder
very inspiring!!!

------
da_murvel
Excuse my portion of scepticism, it's not the fact that a "12 year old" built
this, sure anyone can learn how to code and we can't know how much help this
person got along the way. But it's rather the person's language when writing
plain text, here in the comments for example. It doesn't feel adolescent but
more grownup to me ... But maybe it's just me realising my own shortcommings
as a 12 year old, as I only was playing with my friends and the odd computer
and video game.

~~~
kristopolous
Do kids really do their own science fair projects? We have different rules of
ownership for age-appropriate levels of mentorship.

Also, I and likely you come from a different generation (I'm aged late 30s)
where my parents knew nothing about coding and I genuinely had to learn
everything on my own reading books at a library when my parents would drop me
off.

I only had access to a very expensive family computer where my parents would
freak out if I changed something on the fancy appliance they poorly understood
and essentially every language other than qbasic needed a pricey proprietary
compiler costing hundreds of dollars.

These days with the accessibility of the internet, explosion of open source,
craigslist laptops perfect for learning going for under $75 and the
commonality of programming as a stable career, it wouldn't surprise me to find
children living in say, the silicon valley with programmer parents who
successfully get their child excited about programming early.

It's a different set of circumstances and a 12 year old able to write graphics
demos doesn't sound that implausible.

------
saagarjha
Technically, you shouldn't be using this site ;)

> If you are under 13 years of age, you are not authorized to register to use
> the Site.

But I applaud you for getting into programming this early.

~~~
ateesdalejr
When I was 12 I ignored this on pretty much any website I signed up for. Words
do little to stop a determined 12 year old.

~~~
EvangelicalPig
On the internet, nobody knows your a dog.

Nice work dude!

------
pantheon
Great work. I will give you a different piece of advice. Make sure to work out
360 out of 365 days in a year, without weights.

~~~
TaupeRanger
Ok I'll bite....where is this very specific advice coming from?

~~~
pantheon
From a guy that was doing cool things with a computer at age 12 but instead of
starting to workout at age 12, started at age 18. Any age is good to start
working out but sooner is better.

~~~
ascorbic
What bizarre advice for a programming thread. And what are those five days
for?

~~~
pantheon
Sick days. Health is the most important thing.

------
Froyoh
wow you code better than me

------
crooked-v
Good work.

For a next step, I would suggest giving a try at breaking it up into multiple
files using import/export statements (it doesn't need it but it's good
practice), and using a bundler like Parcel to build the finished file.

    
    
        npm i --save-dev parcel-bundler
    

...then move your source JS files to a folder named src, and add to
package.json...

    
    
        "scripts": {
          "prepare": "parcel --target node src/index.js"
          "start": " node dist/index.js"
        }
    

In your individual files, you do like...

    
    
        // file-1.js
    
        import somethingName, { whateverName } from './file-2'
    
        // file-2.js
    
        export function whateverName { ... }
    
        const somethingName = '...';
        export default somethingName;
    

...and then run...

    
    
        npm run prepare
        npm run start
    

(The prepare script is also a "magic word" that will auto-run anytime someone
does 'npm install', so usually an end user won't have to manually run it.)

A bundler isn't strictly necessary if you plan to only run something in Node,
but it lets you make a package that's usable in both Node and web projects,
and it makes it simple to use Babel, which lets you Javascript features from
the future that aren't actually in Node proper yet.

~~~
aero142
That last thing a 12 year old needs is a complicated build toolchain.

~~~
bsg75
Hell, I'm 50 and its the last thing I need.

------
modzu
im 12 and what is this

~~~
dolessdrugs
me too thanks

