patch-left-and-ahead2.0 patch-right-and-ahead2.0

patch-left-and-ahead angle distance patch-right-and-ahead angle distance Turtle Command

Reports the single patch that is the given distance from this turtle, in the direction turned left or right the given angle (in degrees) from the turtle's current heading. Reports nobody if the patch does not exist because it is outside the world.

(If you want to find a patch in a given absolute heading, rather than one relative to the current turtle's heading, use patch-at-heading-and-distance instead.)

ask patch-right-and-ahead 30 1 [ set pcolor green ]
;; this turtle "looks" 30 degrees right of its
;;   current heading at the patch 1 unit away, and turns
;;   that patch green; note that this might be the same
;;   patch the turtle is standing on

See also patch, patch-at, patch-at-heading-and-distance.

Take me to the full NetLogo Dictionary