<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="et">
	<id>http://www.lambda.ee/w/index.php?action=history&amp;feed=atom&amp;title=RecursiveBush.txt</id>
	<title>RecursiveBush.txt - Redigeerimiste ajalugu</title>
	<link rel="self" type="application/atom+xml" href="http://www.lambda.ee/w/index.php?action=history&amp;feed=atom&amp;title=RecursiveBush.txt"/>
	<link rel="alternate" type="text/html" href="http://www.lambda.ee/w/index.php?title=RecursiveBush.txt&amp;action=history"/>
	<updated>2026-11-07T01:31:28Z</updated>
	<subtitle>Selle lehekülje redigeerimiste ajalugu</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>http://www.lambda.ee/w/index.php?title=RecursiveBush.txt&amp;diff=11083&amp;oldid=prev</id>
		<title>Tammet: Uus lehekülg: &#039;&lt;pre&gt;  { This program defines a recursive subroutine that   draws bush-like pictures.  A second subroutine,   TestBush, is defined to call bush with   reasonable parameters.  The...&#039;</title>
		<link rel="alternate" type="text/html" href="http://www.lambda.ee/w/index.php?title=RecursiveBush.txt&amp;diff=11083&amp;oldid=prev"/>
		<updated>2013-11-22T11:10:45Z</updated>

		<summary type="html">&lt;p&gt;Uus lehekülg: &amp;#039;&amp;lt;pre&amp;gt;  { This program defines a recursive subroutine that   draws bush-like pictures.  A second subroutine,   TestBush, is defined to call bush with   reasonable parameters.  The...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Uus lehekülg&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{ This program defines a recursive subroutine that&lt;br /&gt;
  draws bush-like pictures.  A second subroutine,&lt;br /&gt;
  TestBush, is defined to call bush with&lt;br /&gt;
  reasonable parameters.  The TestBush subroutine&lt;br /&gt;
  is called at the end the program. }&lt;br /&gt;
   &lt;br /&gt;
SUB bush(size,depth)&lt;br /&gt;
   declare ct,angle,branchCt,length&lt;br /&gt;
   IF depth = 0 then&lt;br /&gt;
       green&lt;br /&gt;
       forward(size) back(size)&lt;br /&gt;
   OR IF depth &amp;gt; 0 then&lt;br /&gt;
       bush(2*size/3,depth-2)&lt;br /&gt;
       rgb(0.4,0.3,0.1)&lt;br /&gt;
       forward(size/2)&lt;br /&gt;
       branchCt := 1+randomInt(2)&lt;br /&gt;
       angle := (30 + randomInt(70))/(branchCt - 1)&lt;br /&gt;
       turn(-angle*(branchCt-1)/2)&lt;br /&gt;
       length := size/4 + size/2*random&lt;br /&gt;
       bush(length,depth-1)&lt;br /&gt;
       ct := 1&lt;br /&gt;
       LOOP&lt;br /&gt;
           turn(angle)&lt;br /&gt;
           length := size/4 + size/2*random&lt;br /&gt;
           bush(length,depth-1) &lt;br /&gt;
           ct := ct + 1&lt;br /&gt;
           EXIT IF branchCt = ct&lt;br /&gt;
       END LOOP&lt;br /&gt;
       turn(-angle*(branchCt-1)/2)&lt;br /&gt;
       PenUp&lt;br /&gt;
       back(size/2)&lt;br /&gt;
       PenDown&lt;br /&gt;
   END IF&lt;br /&gt;
END SUB&lt;br /&gt;
&lt;br /&gt;
SUB TestBush&lt;br /&gt;
  clear&lt;br /&gt;
  penUp&lt;br /&gt;
  moveTo(0,-8)&lt;br /&gt;
  penDown&lt;br /&gt;
  face(90)&lt;br /&gt;
  bush(14,5)&lt;br /&gt;
END SUB&lt;br /&gt;
&lt;br /&gt;
{ The preceding SUB definitions only&lt;br /&gt;
  defined the subroutines.  To actually&lt;br /&gt;
  see them, you have to call them.&lt;br /&gt;
  The following will draw a sample bush. }&lt;br /&gt;
&lt;br /&gt;
TestBush&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tammet</name></author>
	</entry>
</feed>