title: How to make the turtle do a certain task after a specific patch is reached?
body: <p>Here in my code, I want the turtle( car) while moving when it reaches the patch with green color, to change the variable uncharged_solar_battery and take an U-turn.</p>
  
  <pre><code>ask cars
    [ if [pcolor] of patch-ahead 1 = green
      [set  uncharged_solar_battery uncharged_solar_battery + 10]
       [lt 180]]
  </code></pre>
  
  <p>After the car reaches the certain patch, no change in value of uncharged_solar_battery occurs.</p>