Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Where's the 20 lines of code? The code base is small, but looks like hundreds of lines, not dozens.



I counted 20 in the body of the README's Render function. I count it as one line if the block is a single line that uses a simple test to execute conditionally (for/if).

Once you understand the algorithm, it's conceptually even simpler than 20 lines.


What you look at, is the whole engine and not just the rendering part. This contains, HTML, CSS, loading and initialization of the maps, clear and flip screen code and especially input device logic. The rendering part in the JavaScript is still rather small. However, the code is optimized and therefore larger. For example the drawing of the vertical line is done manually.

Read the explanation of this algorithm and you will see how the 20 lines are meant.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: