Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Golf: ROT-n

by dragonchild (Archbishop)
on Nov 09, 2004 at 16:46 UTC ( [id://406386]=note: print w/replies, xml ) Need Help??


in reply to Golf: ROT-n

# 1 2 3 4 5 # 3456789 123456789 123456789 123456789 123456789 1234567890 $n=shift;print chr(($n-97+ord)%26+97)for split//,pop
52 strokes

Update:
# 1 2 3 4 5 # 3456789 123456789 123456789 123456789 123456789 1234567890 print chr 97+($ARGV[0]-97+ord)%26for pop=~/./g
46 strokes

Update:
# 1 2 3 4 5 # 3456789 123456789 123456789 123456789 123456789 1234567890 print chr 97+($ARGV[0]+7+ord)%26for pop=~/./g
45 strokes, thanks to cLive_;-)

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Replies are listed 'Best First'.
Re^2: Golf: ROT-n
by cLive ;-) (Prior) on Nov 09, 2004 at 20:07 UTC
    Ah, but -97%26 == 7%26 - so there's another character ;-)

    cLive ;-)

      What do you mean?

      Update: Duh! :-)

      Being right, does not endow the right to be rude; politeness costs nothing.
      Being unknowing, is not the same as being stupid.
      Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
      Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://406386]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-03-29 14:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found