[Omaha.pm] Code Golf

Jay Hannah jay at jays.net
Sat Dec 31 10:02:36 PST 2011


Code golf lives on!

   http://codegolf.stackexchange.com/

Just last night a Java purist was complaining to me about unreadable Perl.  

   http://codegolf.stackexchange.com/questions/189/drawing-a-cube-in-ascii-art

$ perl -E '$d=<>/2;$s=$"x$d;$H=$s x4;$f="|$H|";$t.=$"x$d--."/$H/".$"x$_."|\n",$m.="$f$s|\n",$b=$f.$"x$_."/\n$b"for 0..$d-1;$_="+$H+";y/ /-/;say" $s$_\n$t$_$s|\n$m$f$s+\n$b$_"'
3
  +----+
 /    /|
+----+ |
|    | |
|    | +
|    |/
+----+

Yet Python, Ruby, and PowerShell won this contest?

Perl? Unreadable?

pshh! 

:)

j





More information about the Omaha-pm mailing list