[Issue 10042] std.range.inits and tails
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Oct 16 15:58:17 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10042
--- Comment #1 from bearophile_hugs at eml.cc 2013-10-16 15:58:15 PDT ---
Another usage example:
sequence!q{n}.inits.map!sum.take(20).writeln;
Should generate the the triangle number sequence (http://oeis.org/A000217 ),
with an extra leading zero:
[0, 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153,
171]
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list