REVO2700`Control turtlesP8local angl,penDown,x,y global radPerDeg,degPerRad,noDraw,waittime,x0,y0 local x1,y1,A1,gpoints,tObject,tGraphic,labelCount on drawAndMove if the pPendown of tObject then set the pPoints of tObject to gPoints set the points of graphic tGraphic to the pPoints of tObject --gPoints end if set the loc of tObject to round(x0 +the px of tObject)&comma&round(y0-the py of tObject) Wait 0 millisec --unlock screen end drawAndMove on back temp forward -temp end back on bk temp back temp end bk on centeredCircle r put the tool into savedTool choose the oval tool set the centered to true drag from round(x0+the px of tObject ),round(y0-the py of tObject) to round(x0+the px of tObject+r),round(y0-the py of tObject-r) set the centered to false choose the savedTool end centeredCircle function commaFormat pNum put pNum mod 1 into remainder delete char 1 of remainder put trunc(pNum) into pNum put the number of chars in pNum into n repeat with i = 1 to trunc((n-1)/3) put comma after char n - 3*i of pNum end repeat return pNum& remainder end commaformat function getTheObject who put theControls() into tList put "" into results repeat for each line tLine in tList--with i = 1 to the number of lines in tList if who is in tLine then --line i of tList then put tLine into results--line i of tList into results exit repeat end if end repeat put results into tObject put quote before word 2 of tObject put quote after tObject return tObject end getTheObject function fact n put 1 into results repeat with i = 1 to n multiply results by i end repeat return results end fact on startTurtle temp put round(the width of this stack/2) into x0 put round(the height of this stack/2) into y0 -- ask "Who to tell?" with "Turtle" put getTheObject(temp) into tObject put 1 into i repeat while i <= the number of fields if "fieldLabel" is in the name of field i then delete field i else add 1 to i end repeat if not exists(tObject) then answer "There is no such object." exit to top end if put 0 into labelCount put word 2 of tObject & "grc" into tGraphic replace quote with "" in tGraphic if there is no grc tGraphic then set the style of the templateGraphic to "line" create grc tGraphic end if put "" into gPoints set the px of tObject to 0 set the py of tObject to 0 set the pPenDown of tObject to true set the pAngle of tObject to 0 set the pPoints of tObject to x0,y0 & return drawAndMove end startTurtle on st temp startTurtle temp end st function intersection p1,p2,pp1,pp2 put item 1 of p1 into x1 put item 2 of p1 into y1 put item 1 of p2 into x2 put item 2 of p2 into y2 put item 1 of pp1 into xp1 put item 2 of pp1 into yp1 put item 1 of pp2 into xp2 put item 2 of pp2 into yp2 if x1 = x2 or xp1 = xp2 then if x1 = x2 then return x1&comma&yp2 + (x1-xp2)*(yp2-yp1)/(xp2-xp1) else return xp2&comma& y2 + (xp1-x2)*(y2-y1)/(x2-x1) end if end if put yp2 - y2 + x2*(y2-y1)/(x2 - x1) - xp2*(yp2 - yp1)/(xp2 - xp1) into numerator put ((y2 - y1)/(x2 - x1) -(yp2 - yp1)/(xp2-xp1)) into denom put numerator / denom into x put y2 + (x-x2) *(y2-y1)/(x2-x1) into y return x & comma & y end intersection on setHome xx,yy put (the width of this stack)/2 + xx into x0 put (the height of this stack)/2 - yy into y0 -- drawturtle end setHome on home setxy 0,0 set the pAngle of tObject to 0 end home function log x return ln(x)/ln(10) end log on cleanG who put who into temp get the paramcount if it is 0 then repeat with i = 1 to the number of graphics if "grc" is in the name of grc i then set the points of grc i to "" end repeat else set the pPoints of graphic who to "" put the points of grc who to "" end if end cleanG on cleanT who put who & "grc" into tGraphic if there is a grc tGraphic then set the points of grc tGraphic to "" end cleanT function perpBisector p1,p2 breakpoint pu setXY p1 seth toward( p2) fd .5*distancePt (p2) rt 90 put point into temp1 put item 1 of temp1 into item 1 of temp put item 2 of temp1 into item 2 of temp put heading() into item 3 of temp pd return temp end perpBisector on clean ct lock screen repeat until the number of images is 0 delete image 1 end repeat put 1 into i repeat while i <= the number of fields if "fieldLabel" is in word 2 of the name of field i then delete field i else add 1 to i end repeat unlock screen end clean on incXY dx,dy -- put the px of tObject into x -- put the py of tObject into y put the pPoints of tObject into gPoints if the pPendown of tObject is true then put round (x0 +the px of tObject +dx) &comma &round(y0 -the py of tObject - dy)& return after gPoints else put return & round (x0 +the px of tObject +dx) &comma &round(y0 - the py of tObject - dy)& return after gPoints end if set the px of tObject to the px of tObject + dx set the py of tObject to the py of tObject + dy --set the pPoints of tObject to gPoints --set the points of grc tGraphic to gPoints drawAndMove end incXY on setxy xnew,ynew get the paramCount if it = 1 then put item 2 of xnew into ynew put item 1 of xnew into xnew end if set the px of tObject to xnew set the py of tObject to ynew put the pPoints of tObject into gPoints if the pPendown of tObject is true then put round(the px of tObject +x0)&comma&round(y0 - the py of tObject)& return after gPoints else put return & round(the px of tObject +x0)&comma&round(y0 - the py of tObject)& return after gPoints end if set the pPoints of tObject to gPoints DrawAndMove --set the lockscreen to false end setxy on setRA tRadius, tAngle put tRadius*cosine(tAngle) into tx put tRadius*sine(tAngle) into ty setXY tX,tY end setRA on setHeading temp seth temp end setHeading on drawTurtle end drawTurtle on seth anglnew set the pAngle of tObject to anglnew --drawTurtle end seth on left dangl lt dangl end left on right dangl rt dangl end right on rt dangl set the pAngle of tObject to the pAngle of tObject - dangl --drawTurtle end rt on lt dangl set the pAngle of tObject to the pAngle of tObject + dangl end lt --on forward distance -- put distance * cos(radPerDeg * the pAngle of tObject) into dx -- put distance * sin(radPerDeg * the pAngle of tObject) into dy -- set the px of tObject to the px of tObject + dx -- set the py of tObject to the py of tObject + dy -- put the pPoints of tObject into gPoints -- if the pPenDown of tObject is true then -- put round(the px of tObject +x0)&comma&round(y0- the py of tObject)& return after gPoints -- else -- put return & round(x+x0)&comma&round(-y+y0)& return after gPoints -- end if -- set the points of graphic tGraphic to gPoints -- set the pPoints of tObject to gPoints -- set the loc of tObject to round(x0 +the px of tObject)&comma&round(y0-the py of tObject) --end forward on forward distance put distance * cos(radPerDeg * the pAngle of tObject) into dx put distance * sin(radPerDeg * the pAngle of tObject) into dy set the px of tObject to the px of tObject + dx set the py of tObject to the py of tObject + dy put the pPoints of tObject into gPoints put round(the px of tObject +x0)&comma&round(y0- the py of tObject) into tMouseLoc if the pPenDown of tObject is true then put tMouseLoc &return after gPoints else put return & round(x+x0)&comma&round(-y+y0)& return after gPoints end if -- set the points of graphic tGraphic to gPoints -- set the pPoints of tObject to gPoints -- set the loc of tObject to tMouseLoc drawAndMOve end forward on fd temp forward temp end fd on pu set the pPenDown of tObject to false end pu on penUp pu end penUp on penDown pd end penDown on pd set the pPendown of tObject to true end pd function toward xtemp,ytemp get the paramCount if it is 1 then put item 2 of xtemp into ytemp put item 1 of xtemp into xtemp end if put ytemp - y into dy put xtemp - x into dx if dx = 0 then if dy > 0 then return 90 else return 90 + 180 end if if dy = 0 then if dx > 0 then return 0 else return 180 end if put degPerRad * atan(abs(dy) / abs(dx)) into angl if dy > 0 then if dx > 0 then return angl else return 180 - angl end if if dx > 0 then return 360 - angl else return 180 + angl end if end toward function direction xtemp,ytemp put the px of tObject into x put the py of tObject into y get the paramCount if it is 1 then put item 2 of xtemp into ytemp put item 1 of xtemp into xtemp end if put ytemp - y into dy put xtemp - x into dx if dx = 0 then if dy > 0 then return 90 else return 90 + 180 end if if dy = 0 then if dx > 0 then return 0 else return 180 end if put degPerRad * atan(abs(dy) / abs(dx)) into tAngl if dy > 0 then if dx > 0 then return tAngl else return 180 - tAngl end if if dx > 0 then return 360 - tAngl else return 180 + tAngl end if end direction function direction2 xtemp,ytemp get the paramCount if it is 1 then put item 2 of xtemp into ytemp put item 1 of xtemp into xtemp end if put ytemp - y into dy put xtemp - x into dx put arctangent2(dy,dx) into tAngle if tAngle < 0 then return 360 + tAngle else return tAngle end direction2 function xycor return the px of tObject & comma & the py of tObject end xycor function sci pNum,sigFigures if pNum < 0 then put "-" into sign else put empty into sign put abs(pNum) into pNum if sigFigures is empty then put 3 into sigFigures --Default significant figures. put 0 into count if pNum >= 1 then repeat until pNum < 10 divide pNum by 10 add 1 to count end repeat put round((10^(sigFigures-1))*pNum)/10^(sigFigures-1) into pNum return sign & (char 1 to sigFigures + 1 of pNum) &"*10^" & count end if if pNum < 1 then repeat until pNum >= 1 multiply pNum by 10 add 1 to count end repeat end if return sign & (char 1 to sigFigures + 1 of pNum) & "*10^-" & count end sci function xcor return the px of tObject end xcor function ycor return the py of tObject end ycor function randomInRange b,t return random(t-b+1) + b-1 end randomInRange on setx xnew setxy xnew, the py of tObject end setx on sety ynew setxy the px of tObject, ynew end sety function distance xtemp,ytemp get the paramCount if it = 1 then put item 2 of xtemp into ytemp put item 1 of xtemp into xtemp end if return sqrt ((the px of tObject -xtemp)^2 + (the py of tObject-ytemp)^2) end distance function heading repeat while angl >360 subtract 360 from angl end repeat repeat while angl < 0 add 360 to angl end repeat return angl end heading on label inputText lock screen put the tool into tTool choose the browse tool set the textstyle of the templateField to "bold" set the style of the templateField to "transparent" set the textAlign of templateField to center --set the dontWrap of templateField to true put "fieldLabel" & labelCount into nField create field nField add 1 to labelCount put inputText into field nField set the loc of field nField to turtlePtToMousePt(xycor()) set the width of field nField to the formattedwidth of field nField set the height of field nField to the formattedHeight of field nField set the tool to tTool unlock screen end label function mouseToTurtle pt put round(-x0 + item 1 of pt) into item 1 of temp put round( y0 - item 2 of pt) into item 2 of temp return temp end mouseToTurtle function mousePtToTurtlePt pt return mouseToTurtle(pt) end mousePtToTurtlePt function turtleToMouse pt put round(x0 + item 1 of pt) into item 1 of temp put round(y0 - item 2 of pt) into item 2 of temp return temp end turtleToMouse function turtlePtToMousePt pt return turtleToMouse(pt) end turtlePtToMousePt function clickPoint set the cursor to cross wait until mouseClick() --Wait for the mouse click. return mousePtToTurtlePt(mouseLoc()) --Return the mouse coordinates converted to turtle coordinates. end clickPoint on preopenStack global waittime set the style of this stack to "toplevel" put 0 into waittime --clean set the grid to false put 180/ pi into degPerRad put pi/180 into radPerDeg put (the width of this card)/2 into x0 put (the height of this card)/2 into y0 choose the browse tool end preopenStack function sine a return sin(radPerDeg* a) end sine function cosine a return cos(radPerDeg*a) end cosine function tangent a return tan(radPerDeg*a) end tangent function arcsine a return atan(a/sqrt(1-a*a))/radPerDeg end arcsine function arcTangent a return atan(a)*degPerRad end arcTangent function arcTangent2 y,x return degPerRad*atan2(y,x) end arcTangent2 function sum list put 0 into theResult repeat with i = 1 to the paramcount add param(i) to theResult end repeat return theResult end sum on pr x set the numberformat to "#.00" if there is a field "data" then put x & return after field "data" end pr on functionKey tKey switch tKey case 8 if the tool is "browse tool" then choose the pointer tool else choose the browse tool end if break case 2 edit the script of this stack break case 3 edit the script of this card break case 5 go to next card break case 4 go to previous card break case 6 ct break end switch end functionKey on tell who put getTheObject(who) into tObject put word 2 of tObject &"grc" into tGraphic replace quote with "" in tGraphic -- put the px of tObject into x -- put the py of tObject into y -- put the pPenDown of tObject into pendown -- put the pAngle of tObject into angl -- put the pPoints of tObject into gpoints end tell function theControls repeat with i = 1 to the number of controls put the name of control i into temp replace quote with empty in temp put temp into line i of results end repeat return results end theControls on tabKey if controlkey() = "down" then if the tool = "pointer tool" then choose browse tool else choose pointer tool else pass tabKey end tabKey t~ UGeneva UGeneva WGeneva WLucida Grande ULucida GrandecREVGeometryCachestackID1120 cREVGeneral scriptChecksumqܸRea`^ debugObjectsbutton id 1036 of card id 1002 of stack "Control graphics" card id 1002 of stack "Control graphics" button id 1106 of card id 1002 of stack "Control turtles" button id 1069 of card id 1002 of stack "Control turtles" stack "Control turtles" breakPoints230 handlerListdrawAndMove back bk centeredCircle commaFormat getTheObject fact startTurtle st intersection setHome home log cleanG cleanT perpBisector clean incXY setxy setRA setHeading drawTurtle seth left right rt lt forward fd pu penUp penDown pd toward direction direction2 xycor sci xcor ycor randomInRange setx sety distance heading label mouseToTurtle mousePtToTurtlePt turtleToMouse turtlePtToMousePt clickPoint preopenStack sine cosine tangent arcsine arcTangent arcTangent2 sum pr functionKey tell theControls tabKeyscriptSelection char 1 to 0 bookmarks prevHandlerarcsine tempScriptscript PCon preopencard send "mouseUP" to button "clean" end preopencard 33~revcardfalsecREVGeometryCacheIDs10577863202961062105767916794510401057857061749106910577903022081066105711961391810141057679161377103910577866783561064105710218074210071057235873157106810577857993911060105778579943610611105722860082110910571038091971008105778632032110631057696529030104711057216273031106cREVGeometrycacheorder total23 cREVGeneralscriptChecksum]g GpUM bookmarks handlerList preopencard breakPoints4 142scriptSelection char 1 to 0 prevHandler drawAndMOve tempScriptscriptV

on preopencard

send "mouseUP" to button "clean"

end preopencard

 $%&'(*+,-RU @~ cREVGeneral bookmarks handlerListscriptSelection char 1 to 0 prevHandler tempScriptscriptcREVGeometryCacheIDs100514349907510561005143486413105510691765197941090101464014029110541057770918193105810051435037671057cREVGeometrycachetotal6order  !"BHelpEp- on mouseUP go to next card end mouseUP EuV cREVGeneralscriptChecksumWĿ奷|? bookmarks revUniqueID 1057102180742 handlerListmouseUPscriptSelection char 1 to 0 prevHandlermouseUP tempScriptscript^

on mouseUP

go to next card

end mouseUP

harebB*$%C5px 126.491106py-0Selection Descriptionfalse pPenDownfalsepPoints 581,319 581,319 588,307 595,294 601,280 607,264 611,246 613,228 612,209 606,192 596,178 582,168 565,162 546,161 528,163 510,167 494,173 480,179 467,186 455,193 445,199 435,206 426,212 418,218 411,224 404,230 397,236 391,242 384,248 378,255 372,261 366,268 360,275 354,282 348,290 342,299 335,309 329,319 322,331 315,344 309,358 303,374 299,392 297,410 298,429 304,446 314,460 328,470 345,476 364,477 382,475 400,471 416,465 430,459 443,452 455,445 465,439 475,432 484,426 492,420 499,414 506,408 513,402 519,396 526,390 532,383 538,377 544,370 550,363 556,356 562,348 568,339 575,329 581,319 pAngle0 cREVGeneral bookmarks revUniqueID 1057103809197 handlerListscriptSelection char 1 to 0 prevHandler tempScriptscript foxbB)HI'px 10.295312py -28.302749Selection Descriptionfalse pPenDownfalsepPointspAngle8.485581 cREVGeneral bookmarks revUniqueID 1057119613918 handlerListscriptSelection char 1 to 0 prevHandler tempScriptscript  ChaseEpeon mouseUp startTurtle "hare" set the forecolor of grc "haregrc" to red startTurtle "fox" put 0 into theta put 5 into dTheta tell "hare" pu setRA r(theta,200,100),theta pd repeat until theta > 360 tell "hare" setRA r(theta,200,100),theta add dTheta to theta put xycor() into theHareLocation tell "fox" seth direction(theHareLocation) fd 4 --tell "hare" --wait 0 millisec end repeat end mouseUp function r angl,a,b put cosine(angl) into c put sine(angl) into s return sqrt(1/(c*c/a/a + s*s/b/b))--Equation of an ellipse in radial coordinates end r O{!5 cREVGeneral scriptChecksumQmF`-^ handlerList mouseUp r breakPoints14scriptSelectionchar 266 to 265 revUniqueID 1057235873157 bookmarks tempScript prevHandlermouseUpscript

on mouseUp

startTurtle "hare"

set the forecolor of grc "haregrc" to red

startTurtle "fox"

put 0 into theta

put 5 into dTheta

tell "hare"

pu

setRA r(theta,200,100),theta

pd

repeat until theta > 360

tell "hare"

setRA r(theta,200,100),theta

add dTheta to theta

put xycor() into theHareLocation

tell "fox"

seth direction(theHareLocation)

fd 4

--tell "hare"

--wait 0 millisec

end repeat

end mouseUp

function r angl,a,b

put cosine(angl) into c

put sine(angl) into s

return sqrt(1/(c*c/a/a + s*s/b/b))--Equation of an ellipse in radial coordinates

end r

 rabbit.gif @-60GIF89aHlҭÞ_&'3  WVWFGH79:MPQ`cdNRS[`aإ>DEPVWhoplstsz{_ghcklو{ک𔰲ìվӼѻЊܾ쎥ŞŤˬðǬ«ɮܾշͶ׾ԽӼһꑫy©ǯ٧eqqεsHPPڲōV__[ddnxxҕFLLӀ欹܄V\\Դ受ݚQUU=@@ILLjnndhh355|Z]];==CEE !!)**/00_``˝ۖӽѐչ£خNYXּɷӴ۽SZYDIH!,Hl H2#Ç#vXċ3TP;IhpWuXh ɗ'Npa'h"-׶tٓ٪*6F6a;(e /+ݱóa![Й1.bBĥX[psmR[feF9N5eeNJh 7mcQ(TZj%fCbg~錷ޡr!QE^B"G;[޾K*^2: D)JAFnU!`PN{_~Օ^.yKؠ FlQ qOYCDQ^-2t0ݨG%nd .1t"1*^d 2HF@ =Bt,DPKq0LP1QB,DB?#xP4 Q7HDh:Q .̰ ,߼q%nd>4,J@3 bJ$*DH$>$#ͬ T@G ww6@ C2B#>0+=(F(PmB$MB=$CGwnAGGx ,,QX B7g@BτArJ ha C%@<e.+|`I,\A4.r?$Ȳ0I/ 221'ˆ4xt3)Π0,#vp /`70.A t40'c8?9`ݧ0C<&xP) | >9 ;hB 3-t %Bi Q- !A$zdW\A +괢%h z-?zqp T`$B 0@14#,?@&A/Q d,` G?F@R4pA_" <`AT `DdtF1&P d#h( dD/t ތ D,b  x hEg/IC d 6 6q^81vQ9b02Ga!Dc5(`t`w.hH" X]HF\#`C< e(! H jSL\$\a Blf0 aYĠ2.Hg ̢K @a M4Al0D. + 1Bc^3l 3=衞h6@q.q LRX4ZgZCԩ *h@5jT( S#vЁV0 5ClU<ZX212j b{جn?LB p!, 6HZ>#Z d95u<-Jd!.0rZRZB.n PvB=uKvg~UxRem3l`+̂li6 !5 L` 1HZJcg4ʰA߆EH1F] JHY=d"&biLi<+Db@D30}0Co `8@X p5P*=. &tC#M0]30ye!("A^,'3VA+c18\ۨ@..38PGxPzI]^/ @:_c  DDLw e!P}5@q%ra$t6Ϻ `@*NxF` l)+P@6@ N r.8 Y6r)Y8h(Dn&z@ 0PYh"EB.^6p$>"$H#0 bӓ읿:8="4a  @P&Tԡ7h8CV(: \?"r&RLA @FqZ8 "f}t6PB~`TăQ{oI884OX!+Dq8(Tx̡>@" 'XA"f}v N(XN(>(qv`BD& $GpF%@@I xieRK ЁƗp  K J0B Yp S "0$Z[ee$E0Xw"0 ` O T ?p{9G?K M P iX `Ip `VH Ơakhq`   *P@ @I0 g` *[ش$Z(pP`#@ , RM  p0 U0a . PࠈaT;,Ar$ @ %` { 0S`|Qa0~ubgp0@d h0O[{[c @K`| VpAqb0|0j_g&c*H BP G3 P 1bFEDj  &ppCW p`| E`o!d0nW\b= P9` [_`bh rI |e p oІ qE`|05%v s0oh A3 " bigֳHb@@PMѽ`#tL+` 됪  Z+߰L  ` #g  ` p *@ >  + k0=X@ F` 7՚hk:L@p 0bkF Yʭ+M { s ` P'  0Ԁ ; cREVGeneral revUniqueID 1057679161377fox.gif@(H"Selection DescriptionfalseXGIF89aH"l@ANQokngrqtnutvy}{}ޜx}暑δŮiEڃW]߇\݈[܇[_^ۇ[ވ]݉]܈\ۈ\ׅZa_qNea`ߋ_މ_ac׆^zUjiedjjihgsQomglLnmkji[Ammlkkkjfpnnmmll܍erpolroo}ZsrlӊcfJrq`FwvsxwqYBoJ6vv}|zyt{]|x`D6򭋧~iwӿ~T׃Zۆ]|VvTtQnOρ]nӅ`}ZS=؉dgKȀ]zZvVjmQyZvXX:,qեaHߎkw[jQpWI1'hS̋p㵣۸nR\DcKy_τghNR?WCyH9ƃmݒ{ΧpYۉpWEbPoZk\wf}izk`PncTKD<`UWMh92i_ta2-mbbY]U׀ug_tpS,)b[TPOLIIt98F((Ϗww!,H" H*$oÇ#&,3J 4i0F$:KN*FV>|"W|"QEl!y D$#V'%Au$cIqFl0gC P+ڐp>t #& Јz@! h0#S}Ԣ'x+q Wа525,3ak*QZ`mkAujaJC4lD#R|q,; cREVGeneral revUniqueID 1057679167945CleanEpqon mouseUP cleanG if there is a grc "haregrc" then set the forecolor of grc "haregrc" to black end mouseUP ;"7 cREVGeneralscriptChecksumzʋ^)M revUniqueID 1057696529030 bookmarks handlerListmouseUP tempScript prevHandlermouseUPscriptSelectionchar 100 to 99script

on mouseUP

cleanG

if there is a grc "haregrc" then set the forecolor of grc "haregrc" to black

end mouseUP

 Bunny hopEp: on mouseUp put 5 into tCycles put 2 into vx put 4 into vy startTurtle "hare" tell "hare" pu setHome -400,0 home pd repeat until tCycles = 0 incXY vx,vy subtract .1 from vy if ycor() < 0 then put -vy into vy subtract 1 from tCycles end if end repeat end mouseUp u{!1 cREVGeneral scriptChecksumiˏ&N breakPoints14 handlerListmouseUpscriptSelectionchar 135 to 134 bookmarks revUniqueID 1057235873157 prevHandlermouseUp tempScriptscript

on mouseUp

put 5 into tCycles

put 2 into vx

put 4 into vy

startTurtle "hare"

tell "hare"

pu

setHome -400,0

home

pd

repeat until tCycles = 0

incXY vx,vy

subtract .1 from vy

if ycor() < 0 then

put -vy into vy

subtract 1 from tCycles

end if

end repeat

end mouseUp

 Chase pen upEpon mouseUp startTurtle "hare" startTurtle "fox" put 0 into theta put 5 into dTheta tell "hare" pu setRA r(theta,200,100),theta repeat until theta > 360 --pd setRA r(theta,200,100),theta add dTheta to theta put xycor() into theHareLocation tell "fox" pu seth direction(theHareLocation) fd 4 tell "hare" end repeat end mouseUp function r angl,a,b put cosine(angl) into c put sine(angl) into s return sqrt(1/(c*c/a/a + s*s/b/b)) end r P{!1 cREVGeneral scriptChecksum1qm"u'-P breakPoints14 handlerList mouseUp rscriptSelectionchar 292 to 291 bookmarks revUniqueID 1057235873157 prevHandlermouseUp tempScriptscript

on mouseUp

startTurtle "hare"

startTurtle "fox"

put 0 into theta

put 5 into dTheta

tell "hare"

pu

setRA r(theta,200,100),theta

repeat until theta > 360

--pd

setRA r(theta,200,100),theta

add dTheta to theta

put xycor() into theHareLocation

tell "fox"

pu

seth direction(theHareLocation)

fd 4

tell "hare"

end repeat

end mouseUp

function r angl,a,b

put cosine(angl) into c

put sine(angl) into s

return sqrt(1/(c*c/a/a + s*s/b/b))

end r

Bunny hop pen upEp3on mouseUp put 5 into tCycles put 2 into vx put 4 into vy startTurtle "hare" setHome -400,0 pu home tell "hare" repeat until tCycles = 0 incXY vx,vy subtract .1 from vy if ycor() < 0 then put -vy into vy subtract 1 from tCycles end if end repeat end mouseUp u{!3 cREVGeneral scriptChecksum7 b0bh handlerListmouseUp breakPoints14scriptSelectionchar 294 to 293 revUniqueID 1057235873157 bookmarks tempScript prevHandlermouseUpscript

on mouseUp

put 5 into tCycles

put 2 into vx

put 4 into vy

startTurtle "hare"

setHome -400,0

pu

home

tell "hare"

repeat until tCycles = 0

incXY vx,vy

subtract .1 from vy

if ycor() < 0 then

put -vy into vy

subtract 1 from tCycles

end if

end repeat

end mouseUp

 Bunny onlyEplocal phi on mouseUp startTurtle "hare" put 0 into theta -- Polar coordinate put 5 into dTheta put 45 into phi-- Rotation of axes tell "hare" pu setRA r(theta,200,100),theta -- Move out to start of ellipse pd repeat until theta > 360 -- Draw ellipse setRA r(theta,200,100),theta add dTheta to theta end repeat end mouseUp function r angl,a,b put cosine(angl-phi) into c put sine(angl-phi) into s return sqrt(1/(c*c/a/a + s*s/b/b))-- Ellipse at angle phi end r *{!3 cREVGeneral scriptChecksum5\{=Z} breakPoints6 handlerList mouseUp rscriptSelectionchar 343 to 342 bookmarks revUniqueID 1057235873157 prevHandlermouseUp tempScriptscript

local phi

on mouseUp

startTurtle "hare"

put 0 into theta -- Polar coordinate

put 5 into dTheta

put 45 into phi-- Rotation of axes

tell "hare"

pu

setRA r(theta,200,100),theta -- Move out to start of ellipse

pd

repeat until theta > 360 -- Draw ellipse

setRA r(theta,200,100),theta

add dTheta to theta

end repeat

end mouseUp

function r angl,a,b

put cosine(angl-phi) into c

put sine(angl-phi) into s

return sqrt(1/(c*c/a/a + s*s/b/b))-- Ellipse at angle phi

end r

Bunny only pen upEplocal phi on mouseUp startTurtle "hare" put 0 into theta put 5 into dTheta put 45 into phi tell "hare" pu setRA r(theta,200,100),theta --pd repeat until theta > 360 setRA r(theta,200,100),theta add dTheta to theta end repeat end mouseUp function r angl,a,b put cosine(angl-phi) into c put sine(angl-phi) into s return sqrt(1/(c*c/a/a + s*s/b/b)) end r ,{!5 cREVGeneral scriptChecksumK;/` handlerList mouseUp r breakPoints14scriptSelectionchar 241 to 240 revUniqueID 1057235873157 bookmarks tempScript prevHandlermouseUpscript%

local phi

on mouseUp

startTurtle "hare"

put 0 into theta

put 5 into dTheta

put 45 into phi

tell "hare"

pu

setRA r(theta,200,100),theta

--pd

repeat until theta > 360

setRA r(theta,200,100),theta

add dTheta to theta

end repeat

end mouseUp

function r angl,a,b

put cosine(angl-phi) into c

put sine(angl-phi) into s

return sqrt(1/(c*c/a/a + s*s/b/b))

end r

 New Field 2 @h cREVGeneral revUniqueID 1014640140291  GThis card defines the main elements in the turtle graphic vocabulary. F  (For "Turtle" read "Control" throughout. '  New Field 1)`,` cREVGeneral revUniqueID 1005143486413  0 Commands [and their abreviations]  !  forward 100 [fd 100]   4Moves the turtle 100 pixels at the current heading. 3 back 100 [bk 100]   9Moves the turtle back 100 pixels at the current heading. 8 right 30 [rt 30]   8Rotates the turtle clockwise through a 30 degree angle. 7 left 30 [lt 30]   ?Rotates the turtle counterclockwise through a 30 degree angle. > setHeading 45 [seth 45]   Directs the turtle to an angle of 45 degrees. (All angles are measured in the usual Cartesian manner, that is counterclockwise from 3 O'clock.)  setX 30   8Moves the turtle horizontally to the coordinate x = 30. 7 setY 40   6Moves the turtle vertically to the coordinate y = 40. 5 setXY 30,40   +Moves the turtle to the coordinates 30,40. * incXY 3,4   IIncreases the x coordinate of the turtle by 3 and the y coordinate by 4. H       New Field 3)`* cREVGeneral revUniqueID 1005143499075 bookmarks handlerList tempScript prevHandlerscript  % Functions   xcor ( )   #Returns the turtles x coordinate. ycor ( )   #Returns the turtles y coordinate. xyCor ( )   4Returns a list of the turtles x and y coordinates. heading ( )   Returns the turtle's heading. #direction (30,40) or toward(30,40)     qReturns the direction of the point 30,40 from the current location of the turtle. It does not rotate the turtle. distance (30,40)   QReturns the distance from the current location of the turtle to the point 30,40. clickPoint ( )    jReturns the x and y coordinates of the point of the mouse click--useful in importing data into a program. Intersection(ax,ay,bx,by)   MReturns the intersection of two lines whose endpoints are ax, ay and bx, by. L ! New Field 4)`j% cREVGeneral revUniqueID 1005143503767 bookmarks handlerList tempScript prevHandlerscript  8 Miscellaneous * * StartTurtle [st] tName   Initiates the turtle (control) with the name tName, giving the control the custom properties of x, y coordinates, heading, pen state (up or down) and graphic points. The associated graphic (trace)is {tName} &"grc"  Tell tName   &Tell the turtle who he is talking to. % home  ;Moves the turtle at the origin and pointing to the right. : setHome 30,40   Sets the home position of the turtle a distance 30 to the right of screen-center, and a distance 40 above screen-center. (It does not move the turtle home.)  cleanG tName   bClears the graphic points but not the graphic. If tName is omitted, it clears all graphic points. a penUp [pu]   MRaises the drawing pen. The turtle will no longer leave a track as he moves. L penDown [pd]   Lowers the drawing pen.  TurtlePtToMousePt  tConverts turtle coordinates, measured from the screen's center, to mouse coordinates, measured from the upper left. s MousePtToTurtlePt  See above.  centeredCircle 5   IDraws a circle, centered about the current turtle position, of radius 5. H Label "x"   TPrints an x (or whatever you place within quotes) at the current turtle location. S sci (num,sig)   xReturns the input num in scientific notation with "sig" significant figures, e.g. sci(312345.67, 3) becomes 3.12*10^5. w commaFormat(num)    bReturns the num with commas delimiting each triplet, i.e. commaFormat(9999999) returns 9,999,999. a "ReturnEp+on mouseUP go to first card end mouseUP +( cREVGeneralscriptChecksumZE5,9 4/ys bookmarks revUniqueID 1057770918193 handlerListmouseUPscriptSelection char 30 to 29 prevHandler tempScriptscript>

on mouseUP

go to first card

end mouseUP

$ button "fox"KF/  cREVGeneral revUniqueID 1057785799391%button "hare"KF/  cREVGeneral revUniqueID 1057785799436&"fox"KF/  cREVGeneral revUniqueID 1057786320296'"hare"KF/  cREVGeneral revUniqueID 1057786320321(foxgrcKFad cREVGeneral revUniqueID 1057786678356 bookmarks handlerList tempScript prevHandlerscriptSelection char 1 to 0script*haregrcKFblack(>> cREVGeneral revUniqueID 1057790302208 bookmarks handlerList tempScript prevHandlerscriptSelection char 1 to 0script+Hop and chaseEpon mouseUp put 5 into tCycles put 2 into vx put 4 into vy startTurtle "hare" startTurtle "fox" tell "fox" pu setHome -400,0 home pd tell "hare" pu setHome -400,0 home tell "hare" pd repeat until tCycles = 0 incXY vx,vy subtract .1 from vy if ycor() < 0 then put -vy into vy subtract 1 from tCycles put xycor() into theBunnyLoc tell "fox" fd distance(theBunnyLoc)-60 --wait 30 ticks tell "hare" end if end repeat end mouseUp {! cREVGeneral scriptChecksum~(ctB breakPoints14 handlerListmouseUpscriptSelectionchar 212 to 211 bookmarks revUniqueID 1057235873157 prevHandlermouseUp tempScriptscriptL

on mouseUp

put 5 into tCycles

put 2 into vx

put 4 into vy

startTurtle "hare"

startTurtle "fox"

tell "fox"

pu

setHome -400,0

home

pd

tell "hare"

pu

setHome -400,0

home

tell "hare"

pd

repeat until tCycles = 0

incXY vx,vy

subtract .1 from vy

if ycor() < 0 then

put -vy into vy

subtract 1 from tCycles

put xycor() into theBunnyLoc

tell "fox"

fd distance(theBunnyLoc)-60

--wait 30 ticks

tell "hare"

end if

end repeat

end mouseUp

,Role reversalEp on mouseUp put 5 into tCycles put 2 into vx put 4 into vy startTurtle "hare" startTurtle "fox" tell "hare" pu setHome -400,0 home -- pd tell "fox" pu setHome -400,0 home tell "fox" -- pd repeat until tCycles = 0 incXY vx,vy subtract .1 from vy if ycor() < 0 then put -vy into vy subtract 1 from tCycles put xycor() into theBunnyLoc tell "hare" fd distance(theBunnyLoc)-80 --wait 20 ticks tell "fox" end if end repeat end mouseUp {! cREVGeneral scriptChecksum,R:sz@Kؘz handlerListmouseUp breakPoints14scriptSelectionchar 455 to 454 revUniqueID 1057235873157 bookmarks tempScript prevHandlermouseUpscriptO

on mouseUp

put 5 into tCycles

put 2 into vx

put 4 into vy

startTurtle "hare"

startTurtle "fox"

tell "hare"

pu

setHome -400,0

home

-- pd

tell "fox"

pu

setHome -400,0

home

tell "fox"

-- pd

repeat until tCycles = 0

incXY vx,vy

subtract .1 from vy

if ycor() < 0 then

put -vy into vy

subtract 1 from tCycles

put xycor() into theBunnyLoc

tell "hare"

fd distance(theBunnyLoc)-80

--wait 20 ticks

tell "fox"

end if

end repeat

end mouseUp

-Follow the dotsEp5on mouseUP answer "Click at several points. Shift click to end." cleanG put "" into results st "fox" repeat put clickpoint() into temp setxy temp put temp & return after results if shiftkey() is down then exit repeat end repeat hide button "fox" repeat with i = 1 to the number of lines in results move button "hare" to turtlePtToMousePt(line i of results) in 20 ticks end repeat show button "fox" seth 0 pu bk 100 label "The better to eat you my dear." send "choose the browse tool" to me in 1 tick end mouseUP Gr" cREVGeneral scriptChecksumaMIӥ+mM breakPoints8 handlerListmouseUPscriptSelectionchar 123 to 122 bookmarks revUniqueID 1057857061749 prevHandlermouseUP tempScriptscript 

on mouseUP

answer "Click at several points. Shift click to end."

cleanG

put "" into results

st "fox"

repeat

put clickpoint() into temp

setxy temp

put temp & return after results

if shiftkey() is down then exit repeat

end repeat

hide button "fox"

repeat with i = 1 to the number of lines in results

move button "hare" to turtlePtToMousePt(line i of results) in 20 ticks

end repeat

show button "fox"

seth 0

pu

bk 100

label "The better to eat you my dear."

send "choose the browse tool" to me in 1 tick

end mouseUP

BField 1)` cREVGeneral revUniqueID 1069176519794  This turtle has two functions. One is to talk to RunRev's controls, buttons, fields, graphics, images. The second function is to create a line graphic which follows the motion of the control, but only if the pen is down. The turtle has four custom properties: . x and y coordinates, heading, and pen state The x and y Cartesian coordinates are measured relative to the center of the screen, the heading is the traditional polar angle, i.e. due east is 0 degrees and due north 90 degrees. The pen state is either up or down--drawing or not. To make the control receptive to the Turtle Graphic vocabulary you must first initiate the turtle with say: startTurtle "fox" where there is some control, perhaps a button, named "fox." To address the control "fox" you must let the multitude of control which one you are speaking to. The is done with say: Tell "fox" JSo if you have two controls "fox" and "hare" you would do something like: startTurtle "fox" startTurtle "hare" tell "fox" {do some stuff with the fox} tell "hare" {so some stuff with the hare} tell "fox" {do some more fox stuff} etc. You may only speak to one turtle at a time. Do not start talking to a second turtle until you have finished with the previous turtle. That is:  Tell "redLine" doStuff Tell "blueLine" dostuff Since the turtle represents a line graphic, you may set the color, line size, and end/start arrow. For example if the turtle's name is "redLine" then you would: . set the forecolor of grc "redLine" to "red" ) set the lineSize of grc "redLine" to 2 , set the endArrow of grc "redLine" to true C `RFixed for OS XEpon mouseUP put the script of this stack into tScript if "-- Wait 0 millisec" is in tScript then replace "-- Wait 0 millisec" with "Wait 0 millisec" in tScript set the name of the target to "Fixed for OS X" else replace "Wait 0 millisec" with "-- Wait 0 millisec" in tScript set the name of the target to "Not fixed for OS X" end if set the script of this stack to tScript end mouseUP -#s cREVGeneral scriptChecksum5642!: handlerListmouseUP breakPoints2scriptSelectionchar 214 to 213 revUniqueID 1105721627303 bookmarks tempScript prevHandlermouseUPscript

on mouseUP

put the script of this stack into tScript

if "-- Wait 0 millisec" is in tScript then

replace "-- Wait 0 millisec" with "Wait 0 millisec" in tScript

set the name of the target to "Fixed for OS X"

else

replace "Wait 0 millisec" with "-- Wait 0 millisec" in tScript

set the name of the target to "Not fixed for OS X"

end if

set the script of this stack to tScript

end mouseUP

UField 1'(P cREVGeneral revUniqueID 1105722860082  Toggle me