square pattern problem

How do I generate a square pattern below given a parameter N (possibly using if statements)? I've been cracking my head over this problem for a week now, to no avail. :(

example: Parameter N=7

1
2
3
4
5
6
7
*******
**   **
* * * *
*  *  *
* * * *
**   **
*******
Last edited on
Topic archived. No new replies allowed.