title: List consisting of each element of another List repeated twice Prolog
body: <p>I have to write a predicate: double(X,Y) to be true when Y is the list consisting of each element of X
   repeated twice (e.g. double([a,b],[a,a,b,b]) is true). </p>
  
  <p>I ended with sth like this:</p>
  
  <pre><code>double([],[]).
  double([T],List) :- double([H|T],List).
  double([H|T],List) :- count(H, List, 2).
  </code></pre>
  
  <p>Its working fine for lists like [a,a,b] but it shouldnt... please help.</p>
  
  <p>And i need help with another predicate: repeat(X,Y,N) to be true when Y is the list consisting of each element of X
  repeated N times (e.g. repeat([a,b], [a,a,a,b,b,b],3) is true). </p>