Earlier quoted context omitted.
It's a program that fits in one screen and has 3 functions. No need for these trendy overcomplications.
The fact that it's dead simple is the point of the recommendation. It gives an opportunity to learn the tool with the bare minimum of moving parts involved.
Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
51–60 of 304 posts
Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#52Earlier quoted context omitted.
This comment violates HN's rules. Please assume good faith and don't attack people. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/showhn.html Consider the ridiculous downside of someone being 12, posting their program to HN, and meeting with this as a first comment. How awful.
No it's not awful. People will doubt him sometime, and it's better to learn how to deal with that and gain a life skill rather than expecting every person to be sweet and supporting. There are some kids who just goes on game chats to mess with others, play loud music, bully them, grief them etc. They are usually around 12 years old to 16 years old. I'm sure these things are not new to this kid. Welcome to the planet.
Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#53Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#54Far 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!
Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#55At 12, I was writing 6809 and 68k asm, and cracking games. The most impressive demos in the Atari scene were written when we all were around 15. Because we had plenty of spare time and still lived at our parent's house. And because we loved programming. Nowadays, kids are just not interested in computers any more, besides playing Fortnite and more generally, using apps or wasting time on Youtube and Instagram. Trivia…
Ignore this guy
The taijitu is whole.
Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#56In 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 !
Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#57This 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???
...that being said, this is way cleaner than any code I'd written at 12 I'm pretty sure.
Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#58Google 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!
Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#59Technically, 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.
[deleted]
Re: Show HN: I'm 12, learning JS, and wrote Wolfram's cellular automaton in Node
#60Good 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": " no…
Additionally, this runs in Node, so you don't need to compile the source files with `parcel`.