2 ms·
Yeah, punctuation, wow. I mean, here's a sierpinski triangle generator: 32.times{|i|i.upto(31){|k|putc~k&i>0?32:35};puts} Oh, wait. That's Ruby. I meant to
by bellaire 16y ago
Yeah, punctuation, wow. I mean, here's a sierpinski triangle generator:
32.times{|i|i.upto(31){|k|putc~k&i>0?32:35};puts}
Oh, wait. That's Ruby. I meant to say:
<?for($n=33;$k=--$n;print~\xf5)for(;$k;)echo-$n&--$k?~\xdf:~\xdc;
Oh, sorry! That's PHP. My bad... here we go:
print map($%&$_?$":'#',0..~($%=$_)),$/for-32..1
There we go... You're right, Perl is so much worse!
The point is, of course, you can write ugly code in any language, or you can write beautiful code in any language. Python actually is fairly legible nearly all the time...
n=32
while n:print''.join('# '[-n&k>0]for k in range(n));n-=1
but that comes at the cost of added verbosity and reduced flexibility . Whether that's better is a matter of taste, not of fact.