title: Prolog looping though variable results
body: <p>I have a small program wrote in Prolog. At the moment I can print the first result with</p>
  
  <pre><code>test(X, 1, 4, 5).
  write(X).
  </code></pre>
  
  <p>But if there is more than one result for X, How do I print the next ones?</p>
  
  <p>Thanks.</p>