<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>chez michel &#187; Design by Numbers</title>
	<atom:link href="http://michel.wermelinger.ws/chezmichel/category/design-by-numbers/feed/" rel="self" type="application/rss+xml" />
	<link>http://michel.wermelinger.ws/chezmichel</link>
	<description>a self-explanatory site</description>
	<lastBuildDate>Tue, 20 Apr 2010 09:14:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>DBN tutorial: Modules</title>
		<link>http://michel.wermelinger.ws/chezmichel/2008/12/dbn-tutorial-modules/</link>
		<comments>http://michel.wermelinger.ws/chezmichel/2008/12/dbn-tutorial-modules/#comments</comments>
		<pubDate>Sat, 06 Dec 2008 15:51:29 +0000</pubDate>
		<dc:creator>mw</dc:creator>
				<category><![CDATA[Design by Numbers]]></category>

		<guid isPermaLink="false">http://michel.wermelinger.ws/digitar-te/?p=70</guid>
		<description><![CDATA[This post introduces three fundamental programming constructs.]]></description>
			<content:encoded><![CDATA[<p>What if we want to use our command to draw centred squares in various programs? We can simply copy it from our tunnel program and paste into the new program. It&#8217;s a bit cumbersome, but still much better than reinventing the algorithm every time we need it. However, there is a drawback: if we find an error in our algorithm (and that kind of thing happens all the time), we have to change the algorithm and copy the changes to every program that uses the <code>centred_square</code> command.</p>
<p>We can avoid all this contant copying and pasting, and at the same time make our programs much shorter, by storing the <code>centred_square</code> command into a separate <strong>module </strong>(i.e. a file containing just commands) and then loading the module into every program that requires centred squares. If an error in the algorithm is found, only the module is changed and all programs will work, because they always load the newest version of the module when they start executing.</p>
<p>Having one different module for each command we define is the most flexible option, so that each program only loads those commands it needs, but is a bit cumbersome. A better option is to store related commands in the same module, in order to build libraries of reusable algorithms. A program may use just a subset of the commands defined in a module. For our running example, we copy the <code>centred_square</code> command into a file called <kbd>shapes.dbn:</kbd></p>
<pre>// shapes library
// version 1, 30 Oct 2008, Michel Wermelinger
// centred_square command

command centred_square left
// draw a centred square, given the left coordinate
{
   set bottom left
   set centre 50
   set distance (centre - left)
   set right (centre + distance)
   set top right

   line left bottom right bottom
   line right bottom right top
   line right top left top
   line left top left bottom
}</pre>
<p>In file <kbd>tunnel.dbn</kbd> we replace the <code>centred_square</code> command definition by  DBN&#8217;s <code>load</code> command.</p>
<pre class="vspace">// the tunnel
// version 4, 30 Oct 2008, Michel Wermelinger
// put command in external library

load shapes.dbn

line 0 0 100 100
line 0 100 100 0
centred_square 20
centred_square 40</pre>
<p>To recap, this and the previous two lessons introduced three different fundamental programming concepts, all relating to abstraction:</p>
<ul>
<li>variables allow us to abstract concrete values into general concepts</li>
<li>sub-programs (called commands in DBN) allow us to abstract sequences of computational steps into named algorithms</li>
<li>modules allow us to abstract related commands into reusable libraries</li>
</ul>
<p>In the next lesson we get back to drawing: we introduce the use of grey scales to reinforce the notion of distance.</p>
]]></content:encoded>
			<wfw:commentRss>http://michel.wermelinger.ws/chezmichel/2008/12/dbn-tutorial-modules/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>DBN tutorial: Commands</title>
		<link>http://michel.wermelinger.ws/chezmichel/2008/12/dbn-tutorial-commands/</link>
		<comments>http://michel.wermelinger.ws/chezmichel/2008/12/dbn-tutorial-commands/#comments</comments>
		<pubDate>Sat, 06 Dec 2008 15:20:45 +0000</pubDate>
		<dc:creator>mw</dc:creator>
				<category><![CDATA[Design by Numbers]]></category>

		<guid isPermaLink="false">http://michel.wermelinger.ws/digitar-te/?p=126</guid>
		<description><![CDATA[Programming languages allow us to be lazy and DBN is no exception. The basic idea to reduce the size of the program from the previous post is to abstract the algorithm&#8217;s steps into a new DBN command. The name of the command will reflect what the algorithm produces. The way to do it in DBN [...]]]></description>
			<content:encoded><![CDATA[<p>Programming languages allow us to be lazy and DBN is no exception. The basic idea to reduce the size of the program from the previous post is to abstract the algorithm&#8217;s steps into a new DBN <strong>command</strong>. The name of the command will reflect what the algorithm produces. The way to do it in DBN is as follows:</p>
<pre>command <em>NewCommand</em> <em>V1</em> <em>V2</em> ...
{
 // algorithm's steps
}</pre>
<p>states that <em>NewCommand</em> is an algorithm that requires the concepts <em>V1</em>, etc. to execute the steps that are within the braces. Each concept is a variable that will be used by the algorithm&#8217;s steps.</p>
<p>After defining the algorithm, it can be used as a new DBN command, by simply writing <code><em>NewCommand</em> <em>E1</em> <em>E2</em> ...</code> The value of each expression will be computed and assigned to the corresponding variable, and the algorithm will be executed. If more or less expressions are given than needed by the algorithm, an error message will be issued. For example, the same error will occur if we provide more or less than four expressions for the <code>line</code> command. Rewriting our program to abstract the execution steps into a named command should make clear how commands are defined and used in DBN.</p>
<pre>// the tunnel
// version 3, 9 Nov 2008, Michel Wermelinger
// define a command for drawing centred squares

command centred_square left
// draw a centred square, given the left coordinate
{
   set bottom left
   set centre 50
   set distance (centre - left)
   set right (centre + distance)
   set top right

   line left bottom right bottom
   line right bottom right top
   line right top left top
   line left top left bottom
}

line 0 0 100 100 // left bottom corner to right top corner
line 0 100 100 0 // left top corner to right bottom corner

centred_square 20 // near square
centred_square 40 // far square</pre>
<p>Note that the algorithm&#8217;s steps have been indented to show they are within a command. The DBN programming environment provides a button to automatically layout the whole program.</p>
<p>Note also how the program has become succinct while remaining clear. The algorithm&#8217;s steps have been written once and used twice. As a simple exercise, try to further reduce the length of the program by simplifying the computation of the <em>right</em> variable. (Hint: Substitute the variables in the expression by their values and thereby get rid of the assignments that compute <em>centre</em> and  <em>distance</em>.)</p>
<p>Splitting the program&#8217;s steps into several commands (also called <strong>procedures </strong>or <strong>sub-programs</strong> in other languages) is one way of breaking a long program into simpler to understand modules. In the next post we take modularisation one step further.</p>
]]></content:encoded>
			<wfw:commentRss>http://michel.wermelinger.ws/chezmichel/2008/12/dbn-tutorial-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DBN tutorial: Variables</title>
		<link>http://michel.wermelinger.ws/chezmichel/2008/11/dbn-tutorial-variables/</link>
		<comments>http://michel.wermelinger.ws/chezmichel/2008/11/dbn-tutorial-variables/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 12:26:17 +0000</pubDate>
		<dc:creator>mw</dc:creator>
				<category><![CDATA[Design by Numbers]]></category>

		<guid isPermaLink="false">http://michel.wermelinger.ws/digitar-te/?p=123</guid>
		<description><![CDATA[Let us recap the steps we took in the previous post to produce a centred square:

We choose the left coordinate of our square, e.g. left = 20.
We know that the left bottom vertex of a centred square is on the main diagonal and hence bottom = left.
By definition, the left and right sides are equally [...]]]></description>
			<content:encoded><![CDATA[<p>Let us recap the steps we took in the previous post to produce a centred square:</p>
<ol>
<li>We choose the left coordinate of our square, e.g. <em>left</em> = 20.</li>
<li>We know that the left bottom vertex of a centred square is on the main diagonal and hence <em>bottom</em> = <em>left</em>.</li>
<li>By definition, the left and right sides are equally distant from the centre. We know that <em>centre</em> = 50 due to the dimensions of the canvas.</li>
<li>We next compute the distance from the left to the centre, which is <em>distance</em> = <em>centre</em> &#8211; <em>left</em>.</li>
<li>We add this distance to the left to obtain the right coordinate, i.e. we do <em>right</em> = <em>centre</em> + <em>distance</em>.</li>
<li>We know the top right vertex of the square is also on the main diagonal and therefore <em>top</em> = <em>right</em>.</li>
<li>We can now draw the square&#8217;s four sides with the following commands, in any order:
<ul>
<li>line <em>left bottom right bottom</em></li>
<li>line <em>right bottom right top</em></li>
<li>line <em>right top left top</em></li>
<li>line <em>left top left bottom</em></li>
</ul>
</li>
</ol>
<p>What we have just written down is an <strong>algorithm</strong>, a stepwise procedure to obtain our intended result. The most important thing is of course to put the steps in the right order, because each step can only use the information obtained in previous steps. For example, we can&#8217;t exchange the order of steps 4 and 5, because we need first the distance to then compute where the right side will be. However, even if the order of steps is arbitrary, putting them in a sensible order will make it easier to understand how the algorithm works. For example, although the four sides can be drawn in any order because we have all coordinates at hand, drawing the sides in clockwise or anti-clockwise order, i.e. each line starts where the previous ends, makes the steps easier to follow.</p>
<p>To translate the above algorithm into a DBN program, we need to know one more DBN command: <code>set <em>N E</em></code> computes the value of expression <em>E</em> and assigns it to the name <em>N</em> so that whenever the name appears, the assigned value is used instead. Whenever a new value is assigned to the same name, the previously assigned value is lost. For example, executing first <code>set left 20</code> and then <code>set left 40</code> means that any subsequent use of the name <code>left</code> refers to the value 40, not 20. In programming jargon, <code>left</code> is a <strong>variable</strong>, a placeholder for a value, a box for storing a value. Whenever a new value is stored into a variable, the previously stored value is discarded.</p>
<p>In DBN, expressions that use mathematical operators like addition and subtraction have to be written within parentheses. For example, the computation in step 5 above is written in DBN as <code>set right (centre + distance)</code>. We can now present the whole program, which obviously produces the same picture as in the previous post.</p>
<pre>// the tunnel
// version 2, 9 Nov 2008, Michel Wermelinger
// line command uses computed coordinates

line 0 0 100 100 // left bottom corner to right top corner
line 0 100 100 0 // left top corner to right bottom corner

// near square
set left 20
set bottom left
set centre 50
set distance (centre - left)
set right (centre + distance)
set top right

line left bottom right bottom
line right bottom right top
line right top left top
line left top left bottom

// far square
set left 40
set bottom left
set centre 50
set distance (centre - left)
set right (centre + distance)
set top right

line left bottom right bottom
line right bottom right top
line right top left top
line left top left bottom</pre>
<p>Although the program has become much longer, it is much clearer. It shows what is constant (the centre of the canvas), what we choose (the left coordinate, which changes from one square to the other), and what are the relationships between the various coordinates. The program reflects our reasoning, the algorithm we devised. This was achieved by abstracting the concrete values of line endpoints into general concepts like &#8216;left&#8217; and &#8216;bottom&#8217;. We also used intermediate concepts like &#8216;centre&#8217; and &#8216;distance&#8217; to obtain our final results. All these concepts are captured by variables, which we have named after the concepts they represent. (As far as DBN is concerned, we could have named the variables with any string of letters, e.g. <code>blop</code>, but that would obfuscate the concepts to the program&#8217;s reader.)</p>
<p>Abstracting concrete values into general concepts about centred squares has enabled us to write down an algorithm that executes always the same steps after selecting the value for the left side. Wouldn&#8217;t it be nice to write those steps only once, instead of repeating them for each square we want, as we did in the program above? We will see how to do that in the next lesson.</p>
]]></content:encoded>
			<wfw:commentRss>http://michel.wermelinger.ws/chezmichel/2008/11/dbn-tutorial-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DBN tutorial: Lines</title>
		<link>http://michel.wermelinger.ws/chezmichel/2008/11/dbn-tutorial-lines/</link>
		<comments>http://michel.wermelinger.ws/chezmichel/2008/11/dbn-tutorial-lines/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 11:54:19 +0000</pubDate>
		<dc:creator>mw</dc:creator>
				<category><![CDATA[Design by Numbers]]></category>

		<guid isPermaLink="false">http://michel.wermelinger.ws/digitar-te/?p=63</guid>
		<description><![CDATA[In DBN, the canvas for our artistic output is a virtual square sheet of paper, 101 points wide, with the lower bottom point having coordinates [0 0] and the top right point having coordinates [100 100]. The DBN command
line X1 Y2 X2 Y2
draws a straight line from endpoint [X1 Y1] to endpoint [X2 Y2]. For [...]]]></description>
			<content:encoded><![CDATA[<p>In DBN, the canvas for our artistic output is a virtual square sheet of paper, 101 points wide, with the lower bottom point having coordinates <code>[0 0]</code> and the top right point having coordinates <code>[100 100]</code>. The DBN command</p>
<pre><code>line X1 Y2 X2 Y2</code></pre>
<p>draws a straight line from endpoint <code>[X1 Y1]</code> to endpoint <code>[X2 Y2]</code>. For example, if <code>X1</code> = <code>X2</code> then the line is vertical, whereas if <code>Y1</code> = <code>Y2</code> then the line is horizontal.</p>
<p>Let us suppose we are within a square tunnel, facing straight into its unfathomable end. To provide a sense of perspective, we&#8217;d like to draw the joints where tunnel segments meet. Click on the canvas to see what I mean.</p>
<p><applet CODEBASE="http://michel.wermelinger.ws/digitar-te/wp-content/uploads/dbn" ARCHIVE="dbn.jar" CODE="DbnApplet.class"  WIDTH=110 HEIGHT=110></p>
<param NAME="mode" VALUE="grid">
<param NAME="program0" VALUE="tunnel1_line.dbn">
</applet></p>
<p>How do we translate this vision into line commands for DBN to draw it for us? There are  various ways to do it, depending on the line segments we choose in the picture, and finding the best way is not always trivial. In this case, the simplest way is to draw two diagonals across the canvas and then two squares.</p>
<p>The diagonals are drawn with two <code>line</code> commands. To explain what they do, I&#8217;ll add some <em>comments</em>, which are bits of text that help humans understand how a program works. Computers don&#8217;t need such help when executing programs and hence resolutely ignore comments. In the particular case of DBN, a comment starts with <code>//</code> and goes until the end of the line.</p>
<pre>line 0 0 100 100 // left bottom corner to right top corner
line 0 100 100 0 // left top corner to right bottom corner</pre>
<p>Note that in DBN, each command must be written on its own separate line of the program. For example, you can&#8217;t write</p>
<pre>line 0 0
100 100</pre>
<p>or</p>
<pre>line 0 0 100 100 line 0 100 100 0</pre>
<p>Both cases will lead to error messages. Having one command per text line makes it easy for humans to read the programs and for the DBN environment to execute them, sequentially from the first to the last line of code.</p>
<p>As for drawing a square, if we know the coordinates [<em>left bottom</em>] and [<em>right top</em>] of its two diagonally opposing vertices, then drawing the four sides of a square amounts to writing:</p>
<pre>line <em>left bottom right bottom</em> // bottom side
line <em>right bottom right top </em>  // right side
line <em>right top left top </em>      // top side
line <em>left top left bottom</em>     // left side</pre>
<p>The four sides can of course be drawn in any other order. All that remains is to find out the required coordinates. Since both vertices are on the main diagonal, we necessarily have <em>left</em> = <em>bottom</em> and <em>right</em> = <em>top</em>. On the other hand, since the square is centred on the canvas, the distance from the left side to the centre (coordinates <code>[50 50]</code>) must be the same as the distance from the centre to the right side. For example, if <em>left</em> = 20, then the distance is 30 and hence <em>right</em> = 50 + 30 = 80.</p>
<p>We are now ready to write the whole program, just by choosing the left side coordinates for the near and the far squares. I have chosen 20 and 40, respectively. (Note that both left sides have to be to the left of the centre and hence must have coordinates smaller than 50.)</p>
<pre>// the tunnel
// version 1, 30 Oct 2008, Michel Wermelinger
// line command uses concrete coordinates

line 0 0 100 100 // left bottom corner to right top corner
line 0 100 100 0 // left top corner to right bottom corner
// near square
line 20 20 80 20 // left bottom to right bottom
line 80 20 80 80 // right bottom to right top
line 80 80 20 80 // right top to left top
line 20 80 20 20 // left top to left bottom
// far square
line 40 40 60 40 // bottom side
line 60 40 60 60 // right side
line 60 60 40 60 // top side
line 40 60 40 40 // right side</pre>
<p>Although the program does its job of producing the intended picture, shown earlier, it&#8217;s somewhat unsatisfactory, because the reasoning process that led to its construction has been lost. Anyone reading the program (including ourselves after a while!) will not understand how the coordinates for the line commands were obtained. The comments help, of course, but the generic reasoning that enables to draw <em>any</em> centred square has been lost.</p>
<p>Possibly the most exciting thing about programming is that our reasoning can be conveyed to the computer, so that the computer can apply our ingenuity over and over again to different instances of the problem. In other words: we do the creative designing part, we teach it to the computer, and then we let it do the tedious repetitive stuff at high speed &#8211; that&#8217;s what computers are good for.</p>
<p>In the next post we will see how to precisely and succinctly convey our reasoning steps to the DBN system, in order to turn our concrete two squares into the abstraction of a square centred on the canvas.</p>
]]></content:encoded>
			<wfw:commentRss>http://michel.wermelinger.ws/chezmichel/2008/11/dbn-tutorial-lines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DBN tutorial: Getting started</title>
		<link>http://michel.wermelinger.ws/chezmichel/2008/11/dbn-tutorial-getting-started/</link>
		<comments>http://michel.wermelinger.ws/chezmichel/2008/11/dbn-tutorial-getting-started/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 21:55:45 +0000</pubDate>
		<dc:creator>mw</dc:creator>
				<category><![CDATA[Design by Numbers]]></category>

		<guid isPermaLink="false">http://michel.wermelinger.ws/digitar-te/?p=51</guid>
		<description><![CDATA[To execute DBN programs we need the DBN programming environment, available on the DBN website. It can be downloaded and executed on various platforms because it is written in Java. Even more simply, the environment can be run directly from the website as a Java applet, within a web browser. I use the applet instead [...]]]></description>
			<content:encoded><![CDATA[<p>To execute DBN programs we need the DBN programming environment, available on the DBN website. It can be <a href="http://dbn.media.mit.edu/download/">downloaded</a> and executed on various platforms because it is written in Java. Even more simply, the environment can be <a href="http://dbn.media.mit.edu/dbn/applet.html">run directly</a> from the website as a Java applet, within a web browser. I use the applet instead of the downloadable version, because the latter freezes occasionally on my machine, maybe due to the fact that it is shipped with an old Java runtime engine.</p>
<p>The DBN environment has three panes: you write the program on the right pane, press the play button on the top pane, watch the output on the left pane, and press the stop button on the top pane to stop the execution. That’s all!</p>
<p>When the play button is pressed, the DBN environment checks if the program we wrote has some spelling, syntactic or grammar error. If so, the line in the program with the error is highlighted and an error message appears over the right pane. Unfortunately, the message is not always clear about what the error is, and the message only appears if the mouse cursor was left over the play button after pressing it. A slight nuisance&#8230;</p>
<p>This tutorial will show side by side the programs and their resulting output. As said in the previous post, just click on the empty square next to the program’s code to start running it. Feel free to copy and paste the programs into the DBN environment to further tinker with them and produce your own variations. The downloadable DBN environment has buttons to open and save DBN programs, but if you&#8217;re using the applet on the DBN website, to save your changes just select and copy the program as you would do with any other text in your particular browser, and paste it into some text editor, where you can save it to a file.</p>
<p>Without any further ado, here&#8217;s again the program shown in the previous post, now with its code.</p>
<table cellspacing=2>
<td>
<applet codebase="http://michel.wermelinger.ws/digitar-te/wp-content/uploads/dbn" archive="dbn.jar" CODE="DbnApplet.class"  WIDTH=110 HEIGHT=110></p>
<param NAME="mode" VALUE="grid">
<param NAME="program0" VALUE="attached1_origin.dbn"> </applet>
</td>
<td>
<pre>
// attached
// version 1, 9 Nov 2008, Michel Wermelinger
// cursor is attached to origin

forever
{
   set x &lt;mouse 1&gt;
   set y &lt;mouse 2&gt;
   paper x
   pen (100-x)
   line 0 0 x y
}
</pre>
</td>
</table>
<p>The program will only make sense after a few of these tutorial lessons, but for the moment let&#8217;s use it to try out the environment. Paste the above code into the right edit pane of the environment, run the code to make sure everything&#8217;s fine, and then stop execution. Then change the two zeros to two y&#8217;s, so that it reads</p>
<pre>
line y y x y
</pre>
<p>Run the program again. You should obtain the following (click within the square):<br />
<applet codebase="http://michel.wermelinger.ws/digitar-te/wp-content/uploads/dbn" archive="dbn.jar" CODE="DbnApplet.class"  WIDTH=105 HEIGHT=105></p>
<param NAME="mode" VALUE="grid">
<param NAME="program0" VALUE="attached2_diagonal.dbn"> </applet></p>
<p>The program&#8217;s title hasn&#8217;t been changed. This begs the question: what is the mouse cursor now attached to? It may not be immediately apparent, but part of the appeal of interactive computational art is exactly the trial and error exploration to formulate a hypothesis about the program&#8217;s logic. After a while, it should dawn on everyone that the cursor is &#8216;attached&#8217; to the diagonal that goes from the bottom left corner to the top right corner.</p>
<p>In the next lesson we&#8217;ll look more closely at the <code>line</code> command that appears in the program above.</p>
]]></content:encoded>
			<wfw:commentRss>http://michel.wermelinger.ws/chezmichel/2008/11/dbn-tutorial-getting-started/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>DBN tutorial: Introduction</title>
		<link>http://michel.wermelinger.ws/chezmichel/2008/11/dbn-tutorial-introduction/</link>
		<comments>http://michel.wermelinger.ws/chezmichel/2008/11/dbn-tutorial-introduction/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 19:44:14 +0000</pubDate>
		<dc:creator>mw</dc:creator>
				<category><![CDATA[Design by Numbers]]></category>

		<guid isPermaLink="false">http://michel.wermelinger.ws/digitar-te/?p=42</guid>
		<description><![CDATA[DBN (Design by Numbers) is a very  simple language to program small, non-trivial, interactive, and animated computer art works. DBN can also be used as a language to introduce fundamental computing concepts (like variable, iteration, selection) because the immediate visual feedback obtained by executing a DBN program helps one to understand the program’s instructions [...]]]></description>
			<content:encoded><![CDATA[<p class="vspace">DBN (Design by Numbers) is a very  simple language to program small, non-trivial, interactive, and animated computer art works. DBN can also be used as a language to introduce fundamental computing concepts (like variable, iteration, selection) because the immediate visual feedback obtained by executing a DBN program helps one to understand the program’s instructions and structure (e.g. how nested loops are executed). The DBN website explains in more detail <a href="http://dbn.media.mit.edu/whatisdbn.html">what DBN is</a>.</p>
<p class="vspace">Here&#8217;s a simple example of what can be done with a handful of lines of DBN code. Click within the white square to start running the program, and then move the mouse around. To be able to scroll further down the page, click again outside the square.</p>
<p class="vspace">
<applet codebase="http://michel.wermelinger.ws/digitar-te/wp-content/uploads/dbn" archive="dbn.jar" CODE="DbnApplet.class"  WIDTH=105 HEIGHT=105></p>
<param NAME="mode" VALUE="grid">
<param NAME="program0" VALUE="attached1_origin.dbn"> </applet>
</p>
<p class="vspace">DBN was initially developed by <a href="http://plw.media.mit.edu/people/maeda">John Maeda</a> and then further improved by his team of the Aesthetics + Computation group at MIT, in particular by PhD student <a href="http://benfry.com/">Ben Fry</a>, who then went on to create <a href="http://www.processing.org/">Processing</a>.</p>
<p class="vspace">DBN is described in Maeda’s book <a href="http://books.google.com/books/mitpress?id=cptXSf5kS_IC"><em>Design by Numbers</em></a>, which is a 260 page long, very gentle introduction to computation for absolute beginners. It contains hundreds of examples of what one can do with DBN and it explains Maeda’s rationale for creating DBN and some of his ideas about design. There is a short introduction to the language available on the DBN website, but it omits all the interactive features and doesn’t contain any real examples. Furthermore, the language has evolved since the book was published. New constructs were added and existing ones behave differently: for example, variables have now to be explicitly initialized and command names can be used as identifiers.</p>
<p class="vspace">This tutorial therefore aims to be the first complete and up-to-date, yet brief, introduction to DBN. In the next post we&#8217;ll have a look at the DBN programming environment.</p>
]]></content:encoded>
			<wfw:commentRss>http://michel.wermelinger.ws/chezmichel/2008/11/dbn-tutorial-introduction/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
