Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Golf: ROT-n

by dragonchild (Archbishop)
on Nov 09, 2004 at 16:46 UTC ( #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.


Comment on Re: Golf: ROT-n
Select or Download Code
Re^2: Golf: ROT-n
by cLive ;-) (Parson) 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
Node Status?
node history
Node Type: note [id://406386]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2014-08-23 20:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (178 votes), past polls