qmw2.0 Englishprojectsize[744 426]turtles-have[]globals[]globals-list[globals-vars]VshapesK[0 moon]((2 '6ETcx(@R^jv/>M\kz%procedurestext{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fmodern\fprq1\fcharset0 Courier New;}} {\colortbl ;\red0\green128\blue128;\red0\green0\blue0;} \viewkind4\uc1\pard\cf1\f0\fs20 ; Purpose: To have some fun with MicroWorlds \par ; Copyright \lang3081\'a9\lang1033 2004 by Rupert Russell \par ; e-mail: r.russell@ballarat.edu.au \par ; URL: http://velorum.ballarat.edu.au/~rrussell/microworlds/index.html \par ; Modified: April 17, 2003 \par ; Modified: August 19, 2004 \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 ; ---------------------------------------------------------------------------\cf0 \par \par \cf1 ; Requires a slider named sz value 14 - 20\cf0 \par \par \b to house \par \par \b0 \par \b \par \b0 talkto "t1 \par ht \par cg \par setbg "white \par \par \cf1 ; remember the current position\cf0 \par here \par reset \par st \par \par \cf1 ; draw house body\cf0 \par sq 4 0 "white \par \par \cf1 ; draw the roof\cf0 \par tri \par \par \cf1 ; draw the chimney\cf0 \par chimney \par \par \cf1 ; draw the windows\cf0 \par \cf1 ; 0 = light off \par ; 1 = light on\cf0 \par windows 1 "green \par \par reset \par \cf1 ; put in the door\cf0 \par door \par \par \cf1 ; light the fire\cf0 \par smoke \par \par \cf1 ; tell the sun to rise\cf0 \par sun.rise \par \par night.time \par \par \cf1 ; draw the windows\cf0 \par ; 0 = light off \par ; 1 = light on \par windows 1 "yellow \par \par ht \par \b end \par \par to here\b0 \par \cf1 ; record the current position of the turtle\cf0 \par make "xx xcor \par make "yy ycor \par make "hh heading \par \b end \par \par to go-here\b0 \par \cf1 ; go back to the original turtle position\cf0 \par setx :xx \par sety :yy \par seth :hh \par \b end \par \par to tri\b0 \par \cf1 ; draw a roof\cf0 \par reset \par seth 90 \par pd \par repeat 3 [fd sz * 4 left 120] \par pu \par \par \cf1 ; fill the roof with red paint\cf0 \par setc "red \par fd sz * 0.25 \par left 90 \par fd sz * 0.25 \par fill \par setc "black \par \b end \par \par to sq size fill colour\b0 \par \cf1 ; used to draw a square \par ; used as the body of the house \par ; and used for the basis of each window\cf0 \par pd \par repeat 4 [fd sz * :size right 90] \par \par if :fill = 1 \par [ \par pu \par fd 1 \par right 90 \par fd 1 \par setc :colour \par fill \par setc "black \par bk 1 \par left 90 \par bk 1 \par ] \par \par pu \par \b end \par \par to window light colour\b0 \par \cf1 ; each windows is made up of 4 squares\cf0 \par seth 90 \par repeat 4 [sq 0.5 :light :colour right 90] \par \b end \par \par to door\b0 \par \cf1 ; draw a door compleate with door knob\cf0 \par reset \par pu \par fd sz * 1.5 \par seth 180 \par fd sz * 4 \par \par seth 0 \par pd \par fd sz * 1.5 \par right 90 \par fd sz * 0.8 \par right 90 \par fd sz * 1.5 \par pu \par reset \par \par \cf1 ; draw door knob\cf0 \par reset \par pu \par fd sz * 1.8 \par right 90 \par fd sz * 3 \par pd \par circle 0.05 \par pu \par reset \par \b end \par \par \par to smoke\b0 \par \cf1 ; draws smoke \par ; requires a slider called smoke? with a range of 0 - 10 \cf0 \par repeat smoke? [ \par reset \par pu \par seth 0 \par fd sz * 3 \par seth 90 \par fd sz * 0.1 \par pd \par repeat smoke? * 40 [fd ( random 5 ) + ( sz / 10 ) seth heading - random 50] \par ] \par reset \par \b end \par \par to chimney\b0 \par reset \par seth 0 \par fd sz * 3 \par right 90 \par fd sz / 2 \par right 90 \par fd sz * 2.1 \par reset \par \b end \par \par to reset\b0 \par pu \par go-here \par seth 90 \par pd \par \b end \par \par to circle size\b0 \par pd \par repeat 360 [fd :size right 1] \par \b end \par \par to windows light colour \par \b0 \par \cf1 ; draw 2 windows \par \cf2 talkto "t1 \par ht\cf0 \par reset \par pu \par fd sz \par right 90 \par fd sz \par pd \par window :light :colour \par pu \par \par reset \par pu \par right 90 \par fd sz \par left 90 \par fd sz * 3 \par pd \par window :light :colour \par reset \par \b end \par \par to sun.rise\b0 \par talkto "the.sun \par setsh "sun \par pu \par reset \par pu \par setsize 40 \par seth 300 \par fd sz * 3.5 \par st \par seth 30 \par repeat 60 [fd sz / 5.6 seth heading + 2 wait 1 ] \par \b end \par \par to moon.rise\b0 \par talkto "the.sun \par setsh "moon \par pu \par reset \par pu \par setsize 40 \par seth 300 \par fd sz * 3.5 \par st \par seth 30 \par repeat 60 [fd sz / 5.6 seth heading + 2 wait 1 ] \par \b end \par \par to night.time \par \b0 make "sky_colour 100 \par launch [moon.rise] \par \cf1 ; while the moon is rising the sky gets darker\cf0 \par repeat 9 [ \par make "sky_colour :sky_colour + 1 \par setbg :sky_colour \par wait 2 \par ] \par \b end \par \par \par \b0 \par \par } Upagenamepage1curturtlethe.suncurtext||transition0Dturtle-deamons[[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []]Cmouse-deamons[[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []] bgwhiteHQbuffer1Q$6Kf/T{H+m;t?} Z cQ [ - " h  v $ s |5Z?) Z1\T0!a)l8F|Ax& M t !7!^!!!!!!"H"o"""" #2#Y#####$@$d$$$$$%<%`%%%%%&8&\&&&&&'4'X'|'''' (0(T(x((((),)P)t))))**<*Z*x*****+,+J+j+++++,0,Q,r,,,,,-8-Y-z-----.>.].x......///J/e//////0"0=0X0s0000 1E111152q222%3a3334Q4445A5e5556U666 7E777758q888%9a9999:3:N:i:::::: ;&;A;\;w;;;;;;<4<O<j<<<<<< ='=B=]=x======>8>\>>>>>?4?X?|???? @0@T@x@@@A2AbAAAAB(BLBpBBBBC$CHClCCCCC DDDhDDDDDE@EdEEEEEF