title: Exhausting a prolog tree without prompting the user, and without returning false. Is it possible?
body: <p>I would like to exhaust a Prolog "tree" without prompting the user to press ; (to see every option). </p>
  
  <p>I do this with the following code:</p>
  
  <pre><code>testLocation(room1).
  
  testItem(number,room1).
  testItem(number2,room1).
  testItem(number3,room1).
  
  test2(Location) :- testItem(X,Location), write(X), nl, fail.
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>?- test2(room1).
  
  number
  number2
  number3
  false.
  </code></pre>
  
  <p>Is there anyway to have it not print false at the end? I have a feeling you might be able to do it with cuts. Or perhaps me using fail to write everything at once isn't the write solution.</p>
  
  <p>Any Ideas?</p>