On Thursday, 20 March 2014 at 21:25:03 UTC, Ali Çehreli wrote:
What interesting, boring, efficient, slow, etc. ways are there?

Ali

I'd be interested in seeing a solution using "iota", and the currently proposed "each" or "tee". A quick protype to draw a triangle would be:

iota(0, n).each!(a=>q{%(*%)}.writefln(a.iota()))();
or
iota(0, n).each!(a=>'*'.repeat(a).writeln())();

Adapting that to do a diamond should be straight forward? It would be a good benchmark of functional vs imperative code, and the usability of "each".

Reply via email to