in reply to Re: Symetrical Numbers (GOLF)
in thread Symmetrical Numbers (GOLF)

Well done this is actually only 97 chars!! In golf all that counts is the bit within the curlies of the GOLF sub as noted. There are always inaccuracies in the counts thus the little scoring app:

use strict; my $code = <<'CODE'; sub sym { for(1..shift) { sub s{$_[0]==join"",reverse split//,$_[0]} if(&s($_)&&&s($_**2)){$s{$_}=$_**2} } \%s; } CODE $code =~ s/^\s+|\s+$//gm; $code =~ s/\n//g; $code =~ s/^sub\s+(\w+)\s*{//; $code =~ s/}$//; printf "Length of sub '$1' => %d chars", length $code; __END__

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print