From: Roy Sutton Date: 2006-05-03T12:17:25+09:00 Subject: Re: Golfing a signature. Dave Burt wrote: > I've taken it down by 15 (to 347 not including newlines) trivially: > * -7: inline values of L and s > * -3: add a var, N, which is nil, and replace all () with u > * -3: remove redundant ,() from initialization sequence (a,b,c=1,2; c > #=> nil) > * -2: replace " " with f on line 2 > * 0: uppercase constants O and F > > O,F,N,c="#"," > ";b=([N]*20).map{(0..20).map{(rand<0.3)?O:F}};$><<"\e[2J";until > c==b;$><<"\e[H"< > |e|n=(q,z=-1..1,[];q.map{|x|q.map{|y|z<<[x,y]}};(z-=[[0,0]]).map{|x|c[i+x[0]][e+x[1]]rescue > > N}-[F,N]).size;(b[i][e]==O)?(n>3||n<2)?b[i][e]=F:N:(n==3)?b[i][e]=O:N}};sleep > > 0.2;end > This doesn't work with my Ruby one-click 1.8.2: SyntaxError: compile error (irb):1: syntax error O,F,N,c="#"," ";b=([N]*20).map{(0..20).map{(rand<0.3)?O:F}};$><<"\e[2J";until ^ (irb):4: syntax error N}-[F,N]).size;(b[i][e]==O)?(n>3||n<2)?b[i][e]=F:N:(n==3)?b[i][e]=O:N}};sleep ^ (irb):4: syntax error N}-[F,N]).size;(b[i][e]==O)?(n>3||n<2)?b[i][e]=F:N:(n==3)?b[i][e]=O:N}};sleep ^ from (irb):5