Merge branch 'master' of git://factorcode.org/git/factor

db4
Slava Pestov 2009-01-14 01:02:32 -06:00
commit a4db086097
2 changed files with 0 additions and 48 deletions

View File

@ -1 +0,0 @@
Eduardo Cavazos

View File

@ -1,47 +0,0 @@
USING: kernel math arrays math.vectors math.matrices generic.lib pos ori ;
IN: turtle
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
TUPLE: turtle ;
: <turtle> ( -- turtle )
turtle new
{ 0 0 0 } clone <pos>
3 identity-matrix <ori>
rot
3array chain ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: reset-turtle ( -- ) { 0 0 0 } >pos 3 identity-matrix >ori ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: step-vector ( length -- array ) { 0 0 1 } n*v ;
: step-turtle ( length -- ) step-vector ori> swap m.v pos> v+ >pos ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: strafe-up ( length -- )
90 pitch-up
step-turtle
90 pitch-down ;
: strafe-down ( length -- )
90 pitch-down
step-turtle
90 pitch-up ;
: strafe-left ( length -- )
90 turn-left
step-turtle
90 turn-right ;
: strafe-right ( length -- )
90 turn-right
step-turtle
90 turn-left ;