Better HN
topnewbestaskshowjobs
Log inSign up

sergex

120 karma · joined Jul 5, 2018 (8y ago) · 44 submissions

I work on http://nandgame.com
Submissions

comment 2y ago · link · parent

Author here. Yeah, the first level is special and perhaps half-baked. It felt like cheating to start with the NAND-gate as the atomic component since transistors are not NAND-gates. So I start with electric relays (since they logically correspond to transistors but are easier to visualize). But I didn't want to get into realistic simulation of electronic circuits with all the complexity this entails.

May I ask how you would have preferred to solve the first level if the game didn't have limitations?

comment 2y ago · link · parent

Is your problem with the user interface, i.e. how to connect wires from input to output, or is is with the logical problem of getting the correct output?

comment 5y ago · link · parent

Yes that would be great!

comment 5y ago · link · parent

I'm not using canvas. SVG is used for the connections, the rest is HTML. I'm not using any particular library for the diagrams, since I couldn't find anything suiting my purpose unfortunately.

I would definitely like to improve the look of the wires.

comment 5y ago · link · parent

No it means you can either optimize for fewest components or fewest nand-gate. The text could be clearer.

comment 5y ago · link · parent

Author here - I would love to do a few layers below the nand gate.

comment 5y ago · link · parent

> I'd like to see the ability to "unbundle" the composite components.

This is a great idea, and you are not the first to suggest it. I just haven't gotten around to implement it.

comment 5y ago · link · parent

Yes it has improved a lot. Still more improvements to come!

comment 5y ago · link · parent

Thank you very much for the suggestions.

comment 5y ago · link · parent

Author here: The reason you drag from the input rather than output is that a pin can have only one input.

comment 5y ago · link · parent

Author here - thank you for the feedback!

The nand-count is based on how you built the components involved. So optimizing a component will have have cascading effects.

"This is the simplest solution!" means the solution with fewest individual components on the canvas. I realize the text could be clearer.

comment 5y ago · link · parent

Author here - It uses TypeScript and the Angular framework. Not because I prefer Angular in particular but because I had to learn it anyway for a work-related project. I think TypeScript is great.

comment 6y ago · link · parent

It is a web site, but it seems they have a "sites" plan for 5$ a month. Looks great, thanks!

14.

Ask HN: Scalable Hosting for Side Project

3 points · by sergex · 6y ago · 3 comments

comment 8y ago · link · parent

That would be really cool. I need to refactor a bit to allow different translations of the text, but I can get back to you when it is possible.

comment 8y ago · link · parent

Code goes into how logic gates like the nand gate are built, so it does start at a lower level than Nand to Tetris which start with nand gates as primitives.

comment 8y ago · link · parent

Yeah it currently only compares the solutions towards the minimum number of components of any type. I also intend to compare against the minimum number of nand gates overall, but this is not yet supported.

comment 8y ago · link · parent

That would be really cool!

comment 8y ago · link · parent

I made a small game inspired by the first lessons in the course: http://nandgame.com/

comment 8y ago · link · parent

Thank you for finding the bugs! It shouldn't even be possible feed a 5 to a one-bit connector.

Yes I think I shot myself in the foot by designing the connectors so the labels could only be one or two letters. There is no technical reason they couldn't have descriptive labels like "clock" rather than "c". But it would probably require to turn the design "on the side", so the connectors are left-right rather than top-bottom.

I know I miss tests for a few of the levels.

Thanks for the nice words, it is encouraging!

comment 8y ago · link · parent

Actually there was a bug both in the text and in the code. A=1 should be 0x8FE0, but this was not specified correctly. I have fixed it now (I hope).

comment 8y ago · link · parent

Thanks, it is a very cool idea. I wanted to make the game really simple and accessible, but there seem to be interest in optimization challenges like finding the smallest/cheapest/fastest possible solution.

comment 8y ago · link · parent

You are correct, the text is wrong. It should be 128KB, not 64KB. A word is two bytes (on a 16-bit architecture) so we can address 64K words which is 128KB. (I think you mixed up byte and word in your comment, but I understand what you meant.)

The explanatory text for the level does not really define neither "byte" or "word", so beside fixing the error it also need more details. (But I want to avoid going down the rabbit hole of explaining that bytes can have different sizes than 8 and so on)

comment 8y ago · link · parent

May I ask about browser/platform and what you did to make this happen? I am not able to reproduce the issue.

comment 8y ago · link · parent

Yeah I'm unsure how to clearly communicate how the connectors work.

comment 8y ago · link · parent

Interesting idea, but how should this be determined? Would it be a "cost" per transistor and wirelength, and then the minimum clock cycle time would be the "worst case" path through the circuit?

comment 8y ago · link · parent

No, just ignorance on my part. I would be easy to flip input and output though.

comment 8y ago · link · parent

Doh, you are correct about selector - the decoder should no be available here (and is not needed). And the bus definitely needs an introduction.

comment 8y ago · link · parent

Thanks! A possible solution [spoiler alert!] is inv(add(inv(input), inv(0)) where inv(0) is an inverter without any input.

By the way I suppose the subtraction component should be available in this task. This would make is simpler. I had trouble deciding if increment should be before or after subtraction.

12