Chris Pine's "Deaf Grandma" I'm a mentor at RubyLearning and one of the exercises we give to our students is the "Deaf Grandma" exercise from Chris Pine's book "Learn to Program". Here's the description:


  Write a Deaf Grandma program. Whatever you say to grandma (whatever
  you type in), she should respond with:
  "Huh?! Speak up, sonny!", unless you
  shout it (type in all capitals). If
  you shout, she can hear you (or at
  least she thinks so) and yells back:
  "No, not since 1938!"
  
  To make your program really believable, have grandma shout a
  different year each time; maybe any
  year at random between 1930 and 1950.
  (This part is optional, and would be
  much easier if you read the section on
  Ruby's random number generator at the
  end of the methods chapter.) You can't
  stop talking to grandma until you
  shout "BYE".


After several course iterations I tried to see how small I can get this and now have it down to 112 characters:

puts (s||='').upcase==s ? "NO, NOT SINCE #{1930+rand(21)}!":"HUH?! SPEAK UP, SONNY!" until(s=gets.chomp)=="BYE"


I'm curious to see in how few characters this can be achieved in the language of your choice, because I think Ruby is already doing really well here.

Edit: The Perl solution posted below led to 

ruby -nle 'puts($_=="BYE"?exit: $_.upcase!? "HUH?! SEPAK UP, SONNY!":"NO, NOT SINCE #{1930+rand(21)}!")'


which is 92 characters for the expression + 2 more for the n and l options.
Perl, 85 91

Run with perl -nE '&lt;code goes there&gt;' (n counted in program size):

$==1930+rand 21;say/^BYE$/?last:uc eq$_?"
NO, NOT SINCE $=!":"HUH?! SPEAK UP, SONNY!"


That trailing exclamation mark is very expensive...

Edits suggested by IK:


Using a regexp instead of a string match spares the -l global option as well as two program characters: -3.
Using an actual variable to save a value and use it later for interpolation (Genius! Who'd have thought of using a variable for that?): 0.
Making that variable $=, constrained to be an integer: -4.


(and it still doesn't add up and I'm too sleepy to find out why.  Oh well, the final count is right at least)