title: Trying to check color patch ahead and make decision based on patch color of patch ahead
body: <p>I am trying to have a turtle check the color of the patch ahead and make a decision on where to move. If the patch ahead isn't white then the turtle to rotate left or right and moves. I am getting an error in my If decision construct that says "Expected a TRUE?FALSE here, rather than a list of block". Any idea what might be causing it? I used the same logic for my while loops which seem to work fine. Below is my code and the error occurs in the first line of the code "ifelse [[pcolor] of patch-ahead 1 != white]".</p>
  
  <pre><code> ifelse [[pcolor] of patch-ahead 1 != white][
       ifelse(tempx &lt; xcor)[
         set heading 270
         jump 1
         ]
       [ 
         set heading 90
         jump 1
       ]
   ]
  </code></pre>
  
  <p>Thanks in advance!</p>