title: Prolog four of a kind poker
body: <p>I am trying to code a poker game using Prolog.
  I understand how to code the royal flush but my four of a kind code won't work.</p>
  
  <p>I have the following code:</p>
  
  <pre><code>four_of_a_kind(R):-
  member(card(V, T1), R),
  member(card(V, T2), R),
  member(card(V, T3), R),
  member(card(V, T4), R).
  </code></pre>
  
  <p>where V is the rank which I want to be the same and T1,T2,T3,T4 are the suits. R is my list of cards.</p>
  
  <p>Can anyone explain how to code the four of a kind in prolog please and explain what I am doing wrong please?</p>