Diamond of Astriks

By Vegito on Mar 02, 2014

Type /diamond sizerange to create the diamond.
Default value is set to 2.

alias diamond {
  var %i $iif($1,$v1,2), %j 1
  while (%i >= 1) {
    /echo -a $str($chr(160),$v1) $str(*,%j)
    inc %j 2 
    dec %i
  }

  %i = 2
  dec %j 2

  while (%i <= $iif($1,$v1,2)) {
    dec %j 2   
    /echo -a $str($chr(160),$v1) $str(*,%j)  
    inc %i 
  }
}

Comments

Sign in to comment.
Arigateaux   -  Mar 02, 2014

It needs a default value.

Vegito  -  Mar 03, 2014

Updated the code.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.