Live data from Hacker News

NandGame – Build a Computer from Scratch

nandgame.com

51–60 of 141 posts

Re: NandGame – Build a Computer from Scratch

#51
post #9

There was this ancient Flash game called "Engineer of the People" that was all about designing IC circuits (NPN and PNP junctions) in the Soviet Union for some secretive reason. I never beat the game and got to the reveal. IIRC it was by Zachtronics, the same guy that did Shenzhen I/O and infiniminer (the inspiration for Minecraft).

Last time I tried a Zachtronics game I thought it was awesome and that it was far too much like my actual job so I refunded it. Would have played so much of it if I was still in school.

The main issues I've found in his games (at least for Shenzen I/O and TIS-100) is that the difficulty ramps up a lot in the later levels, and there are artificial limitations that are make the game way harder and less fun. For example, the lack of a "swap dat acc" instruction, having just 2 registers at most, among others. You can work around that but the game's idea shouldn't require you to exploit weaknesses of its simulation engine.

Re: NandGame – Build a Computer from Scratch

#52

Building circuits is neat, but I think this has some problems as a game: 1. It seems to only let you save one solution for each level, even though there are two optimization goals. It should let you save one for fewest components and one for fewest NAND gates. 2. It's not really clear how NAND gate counts work in later levels where you're using potentially non-optimal components you've built? Like does it count each…

> it seems like XOR counts as 6 even though there's apparently a way to do it with fewer?

This is a great game and tbh I think you're just butthurt because you couldn't figure out any of the optimal solutions. Xor is the first one and it sounds like you didn't solve it. (fwiw I haven't figured it out yet either)

1. It does only save one solution for each level but if you can do it in fewer nands, why do you need to keep the fewest components? Most puzzle games like this work this way

2. In later levels it uses your best solution from previous levels. The basic (non-optimal) xor solution has 3 compents with 6 nand. The first time I did half-adder, it told me my solution was 2 components/8 nand (a 2-nand AND plus a 6-nand XOR). After trying for optimal xor again (and failing), solving half-adder shows "2 components used. Mission XOR is not completed, so the total number of gates could not be counted." So it uses YOUR best solutions.

3. I mean it's pretty obvious. optimal == fewest nand, simplest == fewest components. If you optimize for nands, your solution is going to be less simple/more complicated.

I think it's a really great game. You should give it another try

Re: NandGame – Build a Computer from Scratch

#54
post #9

There was this ancient Flash game called "Engineer of the People" that was all about designing IC circuits (NPN and PNP junctions) in the Soviet Union for some secretive reason. I never beat the game and got to the reveal. IIRC it was by Zachtronics, the same guy that did Shenzhen I/O and infiniminer (the inspiration for Minecraft).

I also played his chemistry/alchemy games SpaceChem and Codex of Alchemical Engineering. Highly recommended.

Oh man, I was hooked the moment I played SpaceChem. I think that game and Kerbal Space Program are responsible for reigniting my interest in math and computers.

Re: NandGame – Build a Computer from Scratch

#55

Building circuits is neat, but I think this has some problems as a game: 1. It seems to only let you save one solution for each level, even though there are two optimization goals. It should let you save one for fewest components and one for fewest NAND gates. 2. It's not really clear how NAND gate counts work in later levels where you're using potentially non-optimal components you've built? Like does it count each…

> it seems like XOR counts as 6 even though there's apparently a way to do it with fewer? This is a great game and tbh I think you're just butthurt because you couldn't figure out any of the optimal solutions. Xor is the first one and it sounds like you didn't solve it. (fwiw I haven't figured it out yet either) 1. It does only save one solution for each level but if you can do it in fewer nands, why do you need to k…

> Most puzzle games like this work this way

As far as Zachtronics games go, you've been able to save multiple solutions since IIRC Infinifactory, and those games all have two or three optimisation goals.

I think Silicon Zeroes only remembers one solution per puzzle, however in most of its levels its goals are quite closely related.

OCTOPTICOM also only saves one solution per level, but only has one optimisation goal, I believe.

I don't believe your assertion is true; at the least, it is not true in my experience.

Re: NandGame – Build a Computer from Scratch

#56
post #9

There was this ancient Flash game called "Engineer of the People" that was all about designing IC circuits (NPN and PNP junctions) in the Soviet Union for some secretive reason. I never beat the game and got to the reveal. IIRC it was by Zachtronics, the same guy that did Shenzhen I/O and infiniminer (the inspiration for Minecraft).

I remember that game like it was yesterday --- and then checked to see that it was created over a decade ago ! I was hoping someone would make a more realistic sequel with something like CMOS, but haven't seen any since then. On that topic, digital logic games have been around for a long time: https://en.wikipedia.org/wiki/Rocky%27s_Boots

Rocky's Boots is a cool childs game but the one to try is the sequel Robot Odyssey (1984) which is conveniently available online now.

https://www.robotodyssey.online/

wiki https://en.wikipedia.org/wiki/Robot_Odyssey

Re: NandGame – Build a Computer from Scratch

#57
post #48

I got excited when I saw the title, then checked the URL and it is a software simulation / game of building a computer. I'm not denying this can be interesting, but I've been thinking for a while to get my hands dirty with hardware as a side project. (I'm a software eng by profession). I haven't really done a lot of research on this yet, but does anyone have any recommended guides/books/tutorials on how to get starte…

I would recommended just using the Nand2Tetris book Elements of Computing Systems and implement the computer on an FPGA. I went through the course using the original project’s simulation tools, and I am now circling back and implementing the Hack CPU on a Xilinx FPGA using VHDL.

That's my plan too! I'm still working on the Coursera course and I just started working on the ALU.

Can you suggest any resources for FPGAs? What kind of hardware do you intend to implement the Hack CPU on?

Re: NandGame – Build a Computer from Scratch

#58

Building circuits is neat, but I think this has some problems as a game: 1. It seems to only let you save one solution for each level, even though there are two optimization goals. It should let you save one for fewest components and one for fewest NAND gates. 2. It's not really clear how NAND gate counts work in later levels where you're using potentially non-optimal components you've built? Like does it count each…

> it seems like XOR counts as 6 even though there's apparently a way to do it with fewer? This is a great game and tbh I think you're just butthurt because you couldn't figure out any of the optimal solutions. Xor is the first one and it sounds like you didn't solve it. (fwiw I haven't figured it out yet either) 1. It does only save one solution for each level but if you can do it in fewer nands, why do you need to k…

> This is a great game and tbh I think you're just butthurt because you couldn't figure out any of the optimal solutions.

There's no need to be rude. Insults like this don't add to your argument.

> 1. It does only save one solution for each level but if you can do it in fewer nands, why do you need to keep the fewest components? Most puzzle games like this work this way

Because they're separate optimization goals. I want to hit all of them and have each of them saved. Compare Zachtronics games, as magnostherobot mentions. Also, the ones with fewest components will typically be conceptually clearer.

> 2. In later levels it uses your best solution from previous levels. The basic (non-optimal) xor solution has 3 compents with 6 nand. The first time I did half-adder, it told me my solution was 2 components/8 nand (a 2-nand AND plus a 6-nand XOR). After trying for optimal xor again (and failing), solving half-adder shows "2 components used. Mission XOR is not completed, so the total number of gates could not be counted." So it uses YOUR best solutions.

Thanks for determining this. But it would be better if, you know, the game said this anywhere. None of this is explained.

> 3. I mean it's pretty obvious. optimal == fewest nand, simplest == fewest components. If you optimize for nands, your solution is going to be less simple/more complicated.

I have to disagree that this is "obvious". I'm sure one could figure it out after playing enough, but one shouldn't have to; the messages could easily be made more explicit. And like note that even this isn't exactly a correct description, because if you come up with a solution that minimizes both, it only says "This is optimal!" rather than saying "This is simplest and optimal!". You see the problem?

And honestly I'm just not sure you're correct. Like doing NOR the obvious way, I got a "this is simplest!" message, but did not get a message saying to do it in fewer NAND gates. So what does that mean? Is it optimal or not? If yes it ought to have told me; if no it ought to have given me the message saying it can be done in fewer.

So yes I do think the game is really being badly unclear about this.

Re: NandGame – Build a Computer from Scratch

#59

I got excited when I saw the title, then checked the URL and it is a software simulation / game of building a computer. I'm not denying this can be interesting, but I've been thinking for a while to get my hands dirty with hardware as a side project. (I'm a software eng by profession). I haven't really done a lot of research on this yet, but does anyone have any recommended guides/books/tutorials on how to get starte…

I liked this for a beginning - http://web.archive.org/web/20160611061746/http://www.cryogen... . Sadly, author now asks Wayback Machine to remove the content of the site...

Re: NandGame – Build a Computer from Scratch

#60
post #2

I've done the Coursera course, Nand2Tetris, that inspired this website [1] and found it deeply intellectually satisfying and engaging. If anyone is interested in learning about the logical primitives that build up to a computer, and how they're implemented using logic gates, I would deeply recommend the course! ----------- [1] https://www.nand2tetris.org/

Course materials (projects) seem to contain only slides, with bullet points, not real explanations. Am I missing something? Should I buy the book to actually have the course?
Post reply on HN