Function to print a diamond shape

Ali Çehreli acehreli at yahoo.com
Thu Mar 20 14:25:02 PDT 2014


This is a somewhat common little exercise: Write a function that takes 
the size of a diamond and produces a diamond of that size.

When printed, here is the output for size 11:

      *
     ***
    *****
   *******
  *********
***********
  *********
   *******
    *****
     ***
      *

What interesting, boring, efficient, slow, etc. ways are there?

Ali


More information about the Digitalmars-d-learn mailing list