Post by Admin on Jan 12, 2020 5:04:44 GMT
* NOTE: although this tool has roots within RETROLIB, it is no longer the same (check RETROLIB 10 demo in TOOLS section)
* this program is CASE sensitive.
PROCturtle(mess$,cmd$)--- mess$- is the message command and cmd$ is the amount
mess$ commands:
PROCturtle("up","0") - pen up
PROCturtle("down","0")- pen down
"f" - forward in current direction example: PROCturtle("f","100") -move 100 pixels on current angle
PROCturtle("l","25") - rotate counterclockwise 25 degrees
PROCturtle("r","90") - rotate clockwise 90 degrees
PROCturtle("move","200") - move drawing location to 200,200 on graphics screen
PROCturtle("paint,"0") - fill current location with the current color
PROCturtle("color","15") -set foreground drawing color to 15 (white)
* NOTE: this version will paint with current color that is active.
* If you are looking for the advanced version, it is currently being worked on for code art section complex images
* this is the basic version
* The advanced version will use abbreviations and is meant for complex data image information management
* this program is CASE sensitive.
PROCturtle(mess$,cmd$)--- mess$- is the message command and cmd$ is the amount
mess$ commands:
PROCturtle("up","0") - pen up
PROCturtle("down","0")- pen down
"f" - forward in current direction example: PROCturtle("f","100") -move 100 pixels on current angle
PROCturtle("l","25") - rotate counterclockwise 25 degrees
PROCturtle("r","90") - rotate clockwise 90 degrees
PROCturtle("move","200") - move drawing location to 200,200 on graphics screen
PROCturtle("paint,"0") - fill current location with the current color
PROCturtle("color","15") -set foreground drawing color to 15 (white)
* NOTE: this version will paint with current color that is active.
* If you are looking for the advanced version, it is currently being worked on for code art section complex images
* this is the basic version
* The advanced version will use abbreviations and is meant for complex data image information management
MODE 8
REM modified January 11, 2020
GCOL 15
PROCturtle("move","100"):REM place start location at 100,100
PROCturtle("down","0")
PROCturtle("f","100")
PROCturtle("l","20")
PROCturtle("f","100")
PROCturtle("l","20")
PROCturtle("f","100")
PROCturtle("l","20")
PROCturtle("f","100")
END
DEFPROCturtle(mess$,cmd$)
PRIVATE angle,x%,y%,pen$
IF mess$= "r" THEN angle=angle - VAL(cmd$)
IF mess$= "l" THEN angle=angle + VAL(cmd$)
IF mess$= "f" THEN PROC_turtle(VAL(cmd$),angle,pen$,x%,y%)
IF mess$= "up" THEN pen$="up"
IF mess$= "down" THEN pen$="down"
IF mess$= "paint" THEN FILL x%,y%
IF mess$= "color" THEN GCOL VAL(cmd$)
IF mess$= "move" THEN
x$=cmd$:y$=cmd$
lx%= VAL(x$)
ly%= VAL(y$)
x%=lx%:y%=ly%
ENDIF
PROC_turtle(0,angle,"move",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