Hide one message inside another
Ruby, (69+35)/2-10 = 42

a=gets
$&gt;&lt;&lt;gets.gsub(/./){a[0]!=$&amp;?$&amp;:a.slice!(0).upcase}
1/0if a&gt;?\n


Takes input on STDIN, first line is the message to hide, second line is the text block.  Assumes the secret message is lower-case.  Example input:

codegolf
You'll get -10 points for writing a second program that recovers the hidden message from a block of text. In this eventuality your score is the average of the two, minus the 10 bonus points.


Example output:

You'll get -10 points for writing a seCOnD program that rEcovers the hidden messaGe frOm a bLock oF text. In this eventuality your score is the average of the two, minus the 10 bonus points.


Here's the program to obtain the secret back from the output (again, provided on STDIN):

$&gt;&lt;&lt;gets.scan(/(?&lt;!^|\. )[A-Z]/)*''


One caveat here is that Ruby's lookbehind expressions have to be fixed width, so this code only works for text where the periods are followed by exactly one space.  Suggestions welcome!