L-system: Handle case of 'f' string (use axiom)

db4
Eduardo Cavazos 2009-01-06 16:31:11 -06:00
parent 6416cb78b0
commit 7c6b3e6278
1 changed files with 5 additions and 11 deletions

View File

@ -254,9 +254,7 @@ DEFER: default-L-parser-values
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
TUPLE: <L-system> < gadget TUPLE: <L-system> < gadget camera display-list commands axiom rules string ;
camera display-list
commands axiom rules string ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@ -332,7 +330,7 @@ TUPLE: <L-system> < gadget
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
:: iterate-L-system-string ( L-SYSTEM -- ) :: iterate-L-system-string ( L-SYSTEM -- )
L-SYSTEM string>> L-SYSTEM string>> L-SYSTEM axiom>> or
L-SYSTEM rules>> L-SYSTEM rules>>
iterate-string iterate-string
L-SYSTEM (>>string) ; L-SYSTEM (>>string) ;
@ -357,7 +355,7 @@ TUPLE: <L-system> < gadget
L-SYSTEM display-list>> GL_COMPILE glNewList L-SYSTEM display-list>> GL_COMPILE glNewList
turtle turtle
L-SYSTEM string>> L-SYSTEM string>> L-SYSTEM axiom>> or
L-SYSTEM commands>> L-SYSTEM commands>>
interpret-string interpret-string
drop drop
@ -403,16 +401,12 @@ M:: <L-system> pref-dim* ( L-SYSTEM -- dim ) { 400 400 } ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
:: camera-left ( L-SYSTEM -- )
L-SYSTEM camera>> 5 turn-left drop
L-SYSTEM relayout-1 ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
:: with-camera ( L-SYSTEM QUOT -- ) :: with-camera ( L-SYSTEM QUOT -- )
L-SYSTEM camera>> QUOT call drop L-SYSTEM camera>> QUOT call drop
L-SYSTEM relayout-1 ; L-SYSTEM relayout-1 ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<L-system> <L-system>
H{ H{
{ T{ key-down f f "LEFT" } [ [ 5 turn-left ] with-camera ] } { T{ key-down f f "LEFT" } [ [ 5 turn-left ] with-camera ] }