mw2.0 Englishprojectsize[744 426]turtles-have[]globals[]globals-list[globals-vars] shapesprocedurestext{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fswiss\fprq2 System;}{\f3\fswiss Arial;}{\f4\fmodern\fprq1 Courier New;}} {\colortbl\red0\green0\blue0;\red0\green128\blue128;} \deflang1033\pard\plain\f4\fs20\cf1 ; Purpose: To demonstrate the use of sliders \par ; Copyright \plain\lang3081\f4\fs20\cf1 \'a9\plain\f4\fs20\cf1 2004 by Rupert Russell \par ; e-mail: r.russell@ballarat.edu.au \par ; URL: http://velorum.ballarat.edu.au/~rrussell/microworlds/index.html \par ; Created: April 20, 2004 \par ; \par ; Based BASIC code from Jeff Fox \par ; jfox@airmail.net \par ; http://smallbasic.sourceforge.net/scode/vsrc.php?show=33 \par ; \par ; This program is free software; you can redistribute it and/or modify \par ; it under the terms of the GNU General Public License as published by \par ; the Free Software Foundation; either version 2 of the License, or \par ; (at your option) any later version. \par ; \par ; This program is distributed in the hope that it will be useful, \par ; but WITHOUT ANY WARRANTY; without even the implied warranty of \par ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \par ; GNU General Public License for more details. \par ; \par ; You should have received a copy of the GNU General Public License \par ; along with this program; if not, write to the Free Software \par ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. \par ; ----------------------------------------------------------------------\plain\f4\fs20\cf0 \par \plain\f4\fs20 \par \plain\f4\fs20\cf1 ; Please note this is a work in progress \par ; This version is much faster than version 0.1 \par ; it uses recursion to iterate the main loop \par ; version 0.1 checked each point up to :max_iteration \par ; version 0.2 only checks a point up to :max_iteration if it is \par ; inside the set. This makes checking points outside the set much \par ; faster. \par \plain\f4\fs20 \par \plain\f4\fs20\b to go \par \plain\f4\fs20 cc \par cg \par ht \par make "max_iteration 200\plain\f4\fs20\cf1 \tab \tab \tab ; less iterations \par \tab \tab \tab \tab \tab \tab \tab ; give less detail but \par \tab \tab \tab \tab \tab \tab \tab ; calculate faster \par \plain\f4\fs20 \par make "left_side -3\tab \tab \tab \plain\f4\fs20\cf1 \tab ; change to pan fractal\plain\f4\fs20 \tab \par make "top 1.25\tab \tab \tab \tab \tab \par make "x_side 2.5\tab \tab \tab \tab \par make "y_side -2.5\tab \tab \tab \tab \par \par make "x 0 \par make "y 0 \par \par make "x_max (first projectsize) - 1 \par make "y_max (last projectsize) - 1 \par \par make "x_scale :x_side / :y_max \par make "y_scale :y_side / :y_max \par \par repeat :y_max [ \par make "y :y + 1 \par make "x 0 \par \par repeat :x_max [ \par make "x :x + 1 \par make "cx :x * :x_scale + :left_side \par make "cy :y * :y_scale + :top \par make "zx 0 \par make "zy 0 \par make "c_counter 0 \par recurse :zx :zy :c_counter \plain\f4\fs20\cf1 \plain\f4\fs20 \par ] \par ] \par \par \plain\f4\fs20\b end\plain\f4\fs20 \par \par \plain\f4\fs20\b \par to recurse :zx :zy :c_counter \par \plain\f4\fs20\cf1 ; This is the heart of the program \par ; In programs like XaoS that can generate a full screen \par ; Mandelbrot in a fraction of a second this inner iterative \par ; process is writen in machine code. \par ; \plain\f4\fs20 \par \plain\f4\fs20\cf1 ; If the magnitude of the current point is less than 4 then \par ; the point could be inside the Mandelbrot set \par ; therefore we still have to keep checking it. \par ; \par ; If the magnitude goes over 4 or we reach the maximum number of \par ; iterations we plot the point in a colour according to the value of \par ; c_counter \par \plain\f4\fs20 \par ifelse(and(:zx * :zx + :zy * :zy < 4)(:c_counter < :max_iteration )) \par [ \par make "temp_x :zx * :zx - :zy * :zy + :cx \par make "zy 2 * :zx * :zy + :cy \par make "zx :temp_x \par make "c_counter :c_counter + 1 \par recurse :zx :zy :c_counter \plain\f4\fs20\cf1 \tab \tab ; recursive call \plain\f4\fs20 \par ] \par [ \par setc (\plain\f4\fs20\b sqrt\plain\f4\fs20 :c_counter ) + offset \tab \tab \plain\f4\fs20\cf1 ; try: log tan sqrt \par \tab \tab \tab \tab \tab \tab \tab \tab ; arctan \par \plain\f4\fs20 if :c_counter = :max_iteration [setc "black] \plain\f4\fs20\cf1 ; set inner colour \par \plain\f4\fs20 pu \par setx :x - :x_max / 2 \par sety :y - :y_max / 2 \par pd \par fd 0 \par pu \par stop\tab \plain\f4\fs20\cf1 \tab \tab \tab \tab \tab \tab ; stop the recursion\plain\f4\fs20 \par ] \par \par \plain\f4\fs20\b end\plain\f4\fs20 \par \par } pagenamepage1curturtlet4curtext||transition0Dturtle-deamons[[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []]Cmouse-deamons[[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []]bg0buffer)@Wn&@Zt.T5rWBcS f o  ] < % y 4 tI*:[W6Re |/59 _R^ !"#$q%F&''(l)%**+6,,[--D../~//D001f11922'334455 666a77188 99 ::,;;d< ==a>>?1@@AABBCvD2EEF^G HHI[JKKZLLMMxNOO PPQQ RRRiSSJTT:UU(VVWWXXYYYxZZx[[m\\\]]k^__`ua)bb]cc]ddIee=ff>gg9hh7ii&jjkklylldmmFnn/oo&pp1qq:rrAssDtt}u$vvw`xyyzK{||}<~~h ?ق-քt-/ rىH-!qԏ4XaߓhYΗSɛܠۢt*/W] bxժ5As[߮o]Ʋ5hdIݶ)z˷"xԸ.3׺%p5rSȽ>} 2Rrƿ+BYppxxpppppxxpppppxxpppppxxpppppxxpppppxxpppppxxpppppxxpppppxxpppppxxpppppxxpppppxxpppppxxpplpppxxpplpppxxpplpppxxpplpppxxpplpppxxpplhlpppxxpplhlpppxxpplhlpppxxpplhdhlpppxxpplhdhlpppxxpplhd`Tdhlpppxxpplhd\HX`d`dhlpppxxpplhd`\X`d`\`dhlpppxxpplhd`X`\T\dhlpppxxpplhd`HTP\D\`dhlpppxxpplhd`\XDXT`dhlpppxxpplhd`\XDX\`dhlpppxxpplhd`X<X\`dhlpppxxpplhd`\PL\`dhlpppxxpplhd`\T\`dhlpppxxpplhd`XTX\`dhlpppxxpplhd`\XPTX\`dhlpppxxpplhd`\XT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