in reply to (Challenge) Rotateable numbers

534

sub is_rotatable{ #23456789 123456789 123456789 123456789 123456789 1234 (local$_=$_[0])=~y/0125689347/0152968/;reverse eq$_[0] }

I transposed two digits in posting above.

P:\test>type junk.pl sub is_rotatable{ #23456789 123456789 123456789 123456789 123456789 1234 (local$_=$_[0])=~y/0125689347/0152986/;reverse eq$_[0] } printf "%s %s rotatable\n", $_, is_rotatable( $_ ) ? 'is' : 'not' for 33, 131, 141, 171, 25696925, 101, 88; P:\test>junk 33 not rotatable 131 not rotatable 141 not rotatable 171 not rotatable 25696925 is rotatable 101 is rotatable 88 is rotatable

48

P:\test>type junk.pl sub is_rotatable{ #23456789 123456789 123456789 123456789 12345678 (local$_=$_[0])=~y/2569347/5296/;reverse eq$_[0] } printf "%s %s rotatable\n", $_, is_rotatable( $_ ) ? 'is' : 'not' for 33, 131, 141, 171, 25696925, 101, 88; P:\test>junk 33 not rotatable 131 not rotatable 141 not rotatable 171 not rotatable 25696925 is rotatable 101 is rotatable 88 is rotatable

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon