drawing ASCII art in java
<p>hi i would like to draw a square with * as an outline and dot in the middle with size range 4 -20.</p>

<pre><code>*****
*...*
*...*
*...*
*****
</code></pre>

<p>i'm having a trouble to make the height equal with the length.
this is my code, could you please help.. thanks</p>

<pre><code>class Main
{
  public static void printSquare( int size )
  {
    if ( size &gt;= 20 &amp;&amp; size &gt;= 4) 
    { size = 4; }

    int squareLenght = size;
    int i = 1; 
    int p = 1;

    if ( p &lt;= size )
    {
       int t = 1;

       while ( t &lt;= squareLenght  )
       {
        System.out.print( "*" );
        t = t + 1;
       }
    }
       System.out.println();           //  Newline
       i = i + 1;


    while ( i &lt;= squareLenght )
    {

       int d = 1; 
       int s = 1;


       if ( s &lt; squareLenght  );{
       System.out.print( "*" ); 
       s = s + 1;
       }

       while ( d &lt; size-1  )
       {
        System.out.print( "." );
        d = d + 1;

       }


       System.out.println( "*" );
        i = i + 1;


    }

    if ( p &lt;= size )
    {
       int t = 1;

       while ( t &lt;= squareLenght  )
       {
        System.out.print( "*" );
        t = t + 1;
       }
    }

    System.out.println();           
       i = i + 1;

}
}
</code></pre>
