title: I don't understand how to initial the linked list of the game(Snake)
body: <p>I can't figure out how to link the tail into the head in order to initialize the list.
  I understand how to link new nodes and everything after they are linked, but I can't figure out how to initialize the snake properly. It's written in C. </p>
  
  <pre><code>typedef struct node {
      int x;
      int y;
      struct node* next;
      struct node* prev;
  } NODE;
  
  typedef struct SNAKE {
      NODE* head;
      NODE* tail;
  } SNAKE;
  
  void initialSnaKE(SNAKE* snake) {
  
      snake-&gt;tail-&gt;next=snake-&gt;head;
  
      snake-&gt;head-&gt;next = NULL;
  
      snake-&gt;tail-&gt;prev = snake-&gt;tail-&gt;next;
  
      snake-&gt;tail-&gt;x = (ROWS / 2);
  
      snake-&gt;tail-&gt;y = (COLS / 2);
  
      snake-&gt;head-&gt;x = (ROWS / 2);
  
      snake-&gt;head-&gt;y = (COLS / 2);
  
  }
  </code></pre>