NetLogo Help: uphill uphill4

### uphill1.0 uphill41.0

#### uphill patch-variable uphill4 patch-variable

Moves the turtle to the neighboring patch with the highest value for patch-variable. If no neighboring patch has a higher value than the current patch, the turtle stays put. If there are multiple patches with the same highest value, the turtle picks one randomly. Non-numeric values are ignored.

uphill considers the eight neighboring patches; uphill4 only considers the four neighbors.

Equivalent to the following code (assumes variable values are numeric):

              move-to patch-here  ;; go to patch center
              let p max-one-of neighbors [patch-variable]  ;; or neighbors4
              if [patch-variable] of p > patch-variable [
              face p
              move-to p
              ]

Note that the turtle always ends up on a patch center and has a heading that is a multiple of 45 (uphill) or 90 (uphill4).

See also downhill, downhill4.

Take me to the full NetLogo Dictionary