title: prolog - BFS algorithm to solve rubik cube issue
body: <p>I'm wondering how to run BFS algorithm for rubik cube that is an input parameter of my function. So far I have created functions <code>rotateUp(cubeIn, cubeOut), rotateDown(cubeIn, cubeOut2), rotateFront(cubeIn, cubeOut), rotateBack(cubeIn, cubeOut), rotateLeft(cubeIn, cubeOut), rotateRight(cubeIn, cubeOut)</code> to rotate every single side of rubik cube.</p>
  
  <p>Now I'm about to run some recursive function, where I can rotate my cube every possible way and then chceck if rubik cube is solved.</p>
  
  <p>I already tried this solution but its going only deeper and deeper:</p>
  
  <pre><code>bfs(cubeIn) :-
          rotateUp(cubeIn, cubeOut1), bfs(cubeOut1),
          rotateDown(cubeIn, cubeOut2), bfs(cubeOut2),
          rotateFront(cubeIn, cubeOut3), bfs(cubeOut3),
          rotateBack(cubeIn, cubeOut4), bfs(cubeOut4),
          rotateLeft(cubeIn, cubeOut5), bfs(cubeOut5),
          rotateRight(cubeIn, cubeOut6), bfs(cubeOut6).
  </code></pre>
  
  <p>So I wanted to implement BFS algorithm for my rubik cube issue and I made this one:</p>
  
  <pre><code>bfs(cubeIn) :-
          rotateUp(cubeIn, cubeOut1),
          rotateDown(cubeIn, cubeOut2),
          rotateFront(cubeIn, cubeOut3),
          rotateBack(cubeIn, cubeOut4),
          rotateLeft(cubeIn, cubeOut5),
          rotateRight(cubeIn, cubeOut6),
          bfs(cubeOut1),bfs(cubeOut2),bfs(cubeOut3),
          bfs(cubeOut4),bfs(cubeOut5),bfs(cubeOut6).
  </code></pre>
  
  <p>But in the end it is still not working like BFS.
  Don't you have any idea what I'm doing wrong there?</p>