2 USING: kernel math arrays math.vectors math.matrices generic.lib pos ori ;
6 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10 : <turtle> ( -- turtle )
13 3 identity-matrix <ori>
17 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
19 : reset-turtle ( -- ) { 0 0 0 } >pos 3 identity-matrix >ori ;
21 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
23 : step-vector ( length -- array ) { 0 0 1 } n*v ;
25 : step-turtle ( length -- ) step-vector ori> swap m.v pos> v+ >pos ;
27 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
29 : strafe-up ( length -- )
34 : strafe-down ( length -- )
39 : strafe-left ( length -- )
44 : strafe-right ( length -- )