Post by Admin on Feb 26, 2020 1:36:31 GMT
FEBRUARY 25, 2020 --------------------------
This library has a added angle command
"a" is commanding the image to be on angle r - which is a variable (0-360)
PROCt("a",r) allows you to rotate your construct *Isn't inside the TURTLE IDE, as it isn't needed until you rotate the finished object in your program.
NOTE: I will be copying the library that is here and replacing the old one shortly so it is up to date
This library has a added angle command
"a" is commanding the image to be on angle r - which is a variable (0-360)
PROCt("a",r) allows you to rotate your construct *Isn't inside the TURTLE IDE, as it isn't needed until you rotate the finished object in your program.
NOTE: I will be copying the library that is here and replacing the old one shortly so it is up to date
REM and the answer is >>>>>
REM Copy and paste in BBCSDL and run :
MODE 8
GCOL 15
r=1:REM this is your rotation
REPEAT
PROCt("m",500)
PROCt("a",r) :REM this is your angle
PROCt("d",1)
PROCt("c",15)
PROCt("f",25)
PROCt("r",90)
PROCt("f",5)
PROCt("l",135)
PROCt("f",25)
PROCt("l",90)
PROCt("f",25)
PROCt("l",135)
PROCt("f",5)
PROCt("r",90)
PROCt("f",25)
PROCt("l",90)
PROCt("f",10)
PROCt("f",10)
PROCt("f",5)
WAIT 10
r+=1:IF r>360 THEN r=0
CLG
UNTIL FALSE
END
DEFPROCt(mess$,amt)
PRIVATE angle,x,y,pen$,dracol,sz
IF sz<1 THEN sz=1
GCOL dracol
IF pen$="" THEN pen$="down"
IF mess$="a" THEN angle=amt
IF mess$= "r" THEN angle=angle - amt
IF mess$= "l" THEN angle=angle + amt
IF mess$= "f" THEN VDU 23,23,sz|:PROC_turtle(amt,angle,pen$,x,y)
IF mess$= "u" THEN pen$="up"
IF mess$= "d" THEN pen$="down"
IF mess$= "p" THEN FILL x,y
IF mess$= "c" THEN IF amt=16 THEN amt=0
IF mess$= "c" THEN GCOL amt:dracol=amt
IF mess$= "s" THEN sz=amt
VDU 23,23,sz|
IF mess$= "m" THEN
x=amt:y=amt
pen$="move"
ENDIF
PROC_turtle(0,angle,pen$,x,y)
ENDPROC
DEFPROC_turtle(coun,angle,pen$,RETURN x,RETURN y)
PRIVATE sx,sy
IF pen$="move" THEN sx=x:sy=y
IF pen$="up" OR pen$="down" THEN
sx+=coun*COS(RAD(angle))
sy+=coun*SIN(RAD(angle))
IF pen$="down" THEN LINE x,y,sx,sy
ENDIF
x=sx:y=sy
ENDPROC