title: Fill ship battle game board C
body: <p>i was told to make a project of the shipbattle game with a 10x10 field. For now i need to know how to generate the ship's positions randomly in the field(which is a 10x10 array). The fields cannot be on top of each other and they cant be next to each other. they can also be in horizontal or vertical.</p>
  
  <p>i need to place the following ships: 
  1 ship of five fields
  1 ship of four fields
  2 ships of three fields
  3 ships of two
  4 ships of one</p>
  
  <p>i'm not really seeing how i can do this. this is what i have so far:</p>
  
  <pre><code>void generateField(int field[][dim])
  {
      int i,j;
      for (i=0; i&lt;dim; i++)
      {
          for (j=0; j&lt;dim; j++)
          {
              field[i][j] = 0;
          }
      }
  }
  </code></pre>
  
  <p>this makes the field be all zeros. i want to generate the boats like i said before</p>