From: Michael Neumann Date: 2004-12-06T22:15:42+09:00 Subject: Re: Ruby 2.0 Gavin Sinclair wrote: > On Monday, December 6, 2004, 10:43:50 PM, Michael wrote: > > >>ruby -rcomplex >>-e'c,m,w,h=Complex(-0.75,0.136),50,200,100;puts"P6\n"+\ >>"#{w} >>#{h}\n255";(0...h).each{|j|(0...w).each{|i|n,z=0,Complex(0.9*i/w,\ >>0.9*j/h);while n<=m&&(z-c).abs<=2;z=z*z+c;n+=1 end;print [20+n*10,0,\ >>rand*99].pack("C*")}}'|display > > > Running that on Cygwin, I get > > display: unable to open X server `'. > -e:4:in `write': Broken pipe (Errno::EPIPE) > from -e:4:in `print' > from -e:4 > from -e:2:in `each' > from -e:2 > from -e:2:in `each' > from -e:2 > > Probably a platform issue, but I gotta say I'm a bit surprised. Probably due to 'display'. The ruby code generates a .pnm image, which is then displayed using 'display' (ImageMagick). Regards, Michael