Literate Programming
====================

:1: http://en.wikipedia.org/wiki/Literate_programming
:2: http://www-cs-faculty.stanford.edu/~knuth/
:3: http://en.wikipedia.org/wiki/TeX

{1}[Literate programming] is a programming methodology conceived by {2}[Donald
Knuth] while working on {3}[Tex].  In literate programming, programs are
written in natural languages to explain the application's login with snippets
of traditional source code between the explanation.  A processing tool is then
able to extract the snippets of code and reorder them in a form suitable for
the computer to understand.

The tools and games below are exercises that I made to try out literate
programming.  Most of these applications are simple on purpose, the goal was to
learn about literate programming.  Although, I believe that most of these
applications might be read as simple tutorials.

WARNING: The documents below have been declared “boring as hell” by some of my
acquaintances.  This might be because I am not a native English speaker and I
can't seem to convey my meaning in a easily understandable way.  It might be
because I am, as a person, as funny as watching the paint dry.


Games
-----

:4: http://en.wikipedia.org/wiki/Bulls_and_cows
:5: http://en.wikipedia.org/wiki/Pong
:6: http://en.wikipedia.org/wiki/Curses_(programming_library)
:7: http://en.wikipedia.org/wiki/The_Horde_(video_game)
:8: http://www.hojamaka.com/game/mamono_sweeper/en.html
:9: http://www.libsdl.org/
:10: http://www.libsdl.org/projects/SDL_ttf/
:11: http://www.android.com/
:12: http://developer.apple.com/devcenter/ios/index.action
:13: http://www.ludumdare.com/compo/ludum-dare-21/?action=preview&uid=1885
:14: http://doryen.eptalys.net/libtcod/

 * link:bullsandcows.html[Bulls and Cows] (link:bullsandcows.pdf[PDF]) -- A
   very simple command line code-breaking game based on a {4}[paper and pecil
   game of the same name].  Written in C++.

 * link:hangman.html[hangman] (link:hangman.pdf[PDF]) -- A simple command line
   hangman game.  Written in C++.

 * link:pong.html[pong] (link:pong.pdf[PDF]) - A clone of the well known
   classic {5}[Pong].  Written in C and {6}[curses].

 * link:horde.html[horde] (link:horde.pdf[PDF]) - An ASCII-based clone of an
   action-strategy game called {7}[The Horde].  Written in C and {6}[curses].

 * link:monstersweeper.html[Monster Sweeper] (link:monstersweeper.pdf[PDF]) -
   An ASCII demake of Hojamaka Games' {8}[Mamono Sweeper].  Written in C++ and
   {6}[curses].

 * link:balls.html[Balls!] (link:balls.pdf[PDF]) - Remove bouncing balls from
   the screen with only a single explosion.  Written in C++, {9}[SDL], and
   {10}[SDL_ttf].

 * link:balls-android.html[Android Balls!] (link:balls-android.pdf[PDF]) - An
   {11}[Android] port of link:balls.html[Balls!].  Written in Java.

 * link:balls-ios.html[iTouchBalls] (link:balls-ios.pdf[PDF]) - An {12}[iOS]
   port of link:balls.html[Balls!].  Written in Objective-C.

 * link:asciimaze.html[Ascii Maze] (link:asciimaze.pdf[PDF]) -- My {13}[entry
   for the 21st Ludum Dare] competition held on 19th-21st August 2011.  The
   competition's theme was 'Escape' and I dediced to make a simple top-view
   maze game in C++ and {14}[libtcod].


Tools
-----

:13: http://www.methods.co.nz/asciidoc/
:14: http://live.gnome.org/Vala
:15: http://www.docbook.org/
:16: http://pygments.org/
:17: http://www.python.org/

 * link:atangle.html[atangle] (link:atangle.pdf[PDF]) -- Extracts and sorts
   code snippets from literate programs written using {13}[AsciiDoc].  Written
   in {14}[Vala].

 * link:cpif.html[cpif] (link:cpif.pdf[PDF]) -- Overwrites a file with the
   contents of the standard file if the file's contents and the input are
   different.  Written in {14}[Vala].

 * link:db2html.html[DocBook to XHTML] (link:db2html.pdf[PDF]) -- Converts
   {15}[DocBook] documents to XHTML while using {16}[Pygments] to syntax
   highlight 'programlisting', 'source', and 'synopsis' tags.  This is the tool
   used to generate all literate applications in this site.  Written in
   {17}[Python].
