When I grew up, I learned to program by typing in BASIC code from the back of magazines and from books I found at the library. There doesn’t seem to be anything like that anymore, but I think it’s a great way to learn so I’m proposing we bring that back.
I’m talking about things like this:
http://www.atariarchives.org/basicgames/showpage.php?page=36
The kid types the game, and he or she then gets to play it. Great for 4th-6th graders just getting started. Even greater for parents and teachers to use in class.
I think we need to keep it simple. I’m going to do my examples in very basic Ruby, although it would be nice to see Python too. If we get enough contributers, maybe we do this in two parts, or we do each program in multiple languages.
Fork this, write a chapter and commit it to the repository. That’s it. If you know Docbook, great. Write a chapter using the sample chapter as a template and hook it up in the book.xml file. If you don’t, just write it as a text file and someone else can convert it. Put it in the plaintext_chapters folder. If you commit a chapter, I’ll add you to the main repo as a committer.
Think of small simple games that you ca do, like Craps, Blackjack, a slot machine, rock-paper-scissors, maybe even a simple text adventure. Graphical games are cool too, and so are math games. Be imaginative, but keep it simple. You don’t even really need to explain the concepts if you don’t want to - just let the kids type in the code and run it. And don’t steal code from somewhere else. Nobody wants to get sued.
We’ll also need people to test and verify and review stuff that’s been submitted.
Use para for paragraphs, and sect1, sect2, and sect3 for section hierarchies.
<sect1>
<title>Overview</title>
<para>This is a paragraph.</para>
<sect2>
<title>This is a subsection</title>
<para>This is a paragraph in the subsection.</para>
</sect2>
</sect1>
Use programlisting for source code.
<programlisting language="ruby"><![CDATA[
puts "Hello there. What is your name?"
gets name
puts "Hello #{name}! Nice to meet you!"
]]></programlisting>
Use screen to show screen output.
<screen> Hello there. What is your name? Brian Hello Brian! Nice to meet you! </screen>
You can include a screenshot with this markup
<figure xml:id="fig.">
<title></title>
<screenshot>
<mediaobject>
<imageobject>
<imagedata fileref="" align="center" width="" />
</imageobject>
<caption><para>Your caption</para></caption>
</mediaobject>
</screenshot>
</figure>
Put images in the images/png folder in a subfolder with the same name as your chapter.
This will build using the Short Attention Span Docbook chain (github.com/napcs/docbook) or pretty much any other docbook system that uses Docbook 5. Oxygen’s built-in system seems to work just fine. I’ll try to set up a continuous integration system somewhere in the future once there’s some serious content, and I’ll build frequent copies and link them here.
Let’s leave this completely open. Creative Commons sound good?