Ok. How about you write a rot13 encryption program in python.
The only requirements are that it must rot13 encode whatever the commandline arguments are, and if there are none it takes input from stdin and rot13 encodes that.
If you don't know what rot13 is, it basically means to convert letters into numbers, subtract 13, and convert it back into letters. So a=n, b=o, c=p, etc (and vice versa).
Here's mine:
Have fun!Code:#!/usr/bin/env perl sub rot13 { $string=join(' ',@_); $string=~tr/a-zA-Z/n-za-mN-ZA-M/; print $string; } if (defined(@ARGV)) { rot13(@ARGV); } else { while (<STDIN>) { rot13("$_"); } } print "\n";![]()


Reply With Quote

Bookmarks