title: Rotating a list to the right (Prolog)
body: <p>I have an assignment where I need to rotate a list once to the right. I also have a constraint where I can only use one predicate. It seems that shifting to the left is very easy:</p>
  
  <pre><code>([H|T], R) :- append(T, [H], R).
  </code></pre>
  
  <p>Though, it seems to be harder to rotate right AND keep the constraint. This is my attempt:</p>
  
  <pre><code>rotate([H], H).
  rotate([H|T], F) :- rotate(T,F1), append(F1,T,F).
  </code></pre>
  
  <p>In my head, it works perfectly, though I only get <code>false</code> as an output. Any help solving this would be much appreciated!</p>