News:

Pretty crazy that we're closer to 2030, than we are 2005. Where did the time go!

Main Menu

Write a rot13 program in one line

Started by Ender, August 15, 2006, 04:06:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ender

Newby, this is the code:

tr/A-Za-z/N-ZA-Mn-za-m/;


Put that in a file and perl -p it. Less than 25 characters.

Newby

I realize what the code is. But you gave that entire line like the line itself was the solution. :P

How about this shell script for the win?

tr A-Za-z N-ZA-Mn-za-m

Quotenewby@impaler:~/Downloads/vmware-server$ perl -p -e "tr/A-Za-z/N-ZA-Mn-za-m/;"
Testing!
Grfgvat!

newby@impaler:~/Downloads/vmware-server$ tr A-Za-z N-ZA-Mn-za-m
Testing!
Grfgvat!

Mine requires less resources I wager. :)
- Newby
http://www.x86labs.org

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote from: Rule on June 30, 2008, 01:13:20 PM
Quote from: CrAz3D on June 30, 2008, 10:38:22 AM
I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT. 

Ender

haha that's neat :D I didn't know there was a tr command.

I don't really care about the resources but it is less to type ^.^