 ! random-boid and random-boids
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-: random-range ( a b -- n ) 1 + dupd swap - random + ;
+: random-range ( a b -- n ) 1+ over - random + ;
 
 : random-pos ( -- pos ) world-size> [ random ] map ;
 

: random-boids ( n -- boids ) [ drop random-boid ] map ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! : distance ( boid boid -- n ) boid-pos swap boid-pos v- norm ;

: distance ( boid boid -- n ) [ boid-pos ] [ boid-pos ] bi* v- norm ;



! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! : relative-position ( self other -- v ) boid-pos swap boid-pos v- ;

: relative-position ( self other -- v ) swap [ boid-pos ] 2apply v- ;

: relative-angle ( self other -- angle )
over boid-vel -rot relative-position angle-between ;
