Whoa! Love the idea of a hybrid lua/markdown file; I didn't realize that the readme for the Github project WAS the source code till I noticed it was just a symlink to the .lua file.<p>Very cool.
The more flexibility a language gives you in the order you place your code, the better it is for literate programming. If you haven't seen it yet, check out the source code to coffeescript.<p>Here is the source file: <a href="https://github.com/jashkenas/coffeescript/blob/master/src/grammar.coffee" rel="nofollow">https://github.com/jashkenas/coffeescript/blob/master/src/gr...</a><p>Here is a nicely rendered version of the same file: <a href="http://coffeescript.org/documentation/docs/grammar.html" rel="nofollow">http://coffeescript.org/documentation/docs/grammar.html</a><p>Also see literate coffeescript, a mode that seamlessly integrates markdown. I'd give up vim for a environment that lets me embed images, embed SVG diagrams, use those SVG diagrams at compile time to generate code, etc.
So, I am definitely a fan of literate programming. I'm not sure I am a fan of what I will call the polyglot method, though.<p>Specifically, I don't think I fully grok/agree with the utility of having a single file that is both a markdown file and a lua file through commenting. In the end, it means you are still greatly limited to the ordering semantics of the main language.<p>Which is <i>not</i> to say some folk won't do an amazing job writing a program. They clearly will. However, I think the macro approach of CWEB (or noweb, even) still has a lot of mileage that is overlooked nowdays.
As a Microsoft developer who has never looked at a terminal before, I find these projects amazing.
The OP wrote a tertis clone in terminal - clever / cool<p>THEN its well documented!<p>THEN its in one file - wtf?<p>Well done!
Pretty nice. Writing a tetris clone targeting terminals is a fun endeavor and the easiest way to produce some moving graphics (besides Conway's Game of Life). It's also interesting to ignore curses and read and write plain bytes to the terminal and see what happens. I learned lots of nifty details about terminals there and you find pages like this:<p><a href="http://www.ibb.net/~anne/keyboard/keyboard.html" rel="nofollow">http://www.ibb.net/~anne/keyboard/keyboard.html</a>
Original Tetris for Terminals: 1989!<p><a href="http://www.miketaylor.org.uk/tech/tt/" rel="nofollow">http://www.miketaylor.org.uk/tech/tt/</a><p>Not done in 10 functions though! C on Unix.<p>However, IOCCC entry in the same year:<p><a href="http://homepages.cwi.nl/~tromp/tetris.html" rel="nofollow">http://homepages.cwi.nl/~tromp/tetris.html</a>
Like the example ~300 line tetris implementation for tinygame: <a href="https://github.com/nmillerns/tinygame" rel="nofollow">https://github.com/nmillerns/tinygame</a>
Except that uses raw prints and termios in python instead of curses
Cool project. It reminded me of the "Tetris in 140 bytes" project, worth a look: <a href="https://gist.github.com/aemkei/1672254" rel="nofollow">https://gist.github.com/aemkei/1672254</a>
Wow, the document is awesome and code is really understandable though I haven't used lua before. It's pretty nice work! thanks for sharing :)