Victory has been declared...

Gathen, Bill bgathen at usxchange.com
Tue Oct 5 11:39:58 CDT 1999


Well, Bill Ott got the answer about ten minutes after I sent out the hint.
The correct command-line argument was -9.

THE CODE:
#
# What is the correct command-line argument?
#
@w = qw(w3t51tlt512 hshln43hnnv 1_2ts_f23d2 t__3w_2_v_r ___m2_,_2_y
        ___1r___r_t ___t____s_h ___2____2_3 __________n __________g);

for ( @w ) { for (split(//)) { $question[$i++] .= $_; } undef $i; }
($question = join(' ', at question)) =~ s/_//g;
for (split(//,$question)) { /[123456]/ ? $answer += $_ : $variance-- ; }
$question =~ tr/123456/aeiouy/;
print "Question: $question\nAnswer:   " . ($answer + $ARGV[0]) . "\n";

THE OUTPUT:
$question = "what is the ultimate answer to life, the universe and
everything";
$answer = 51;
$answer + $ARGV[0] = 42;	# Correct command-line argument was -9

THE DESCRIPTION (courtesy of Bill Ott):
1. You loop through each element in @w and cat the 'ith character of
each element, to 'ith character of elements in a list called 'question'
(does that make any sense?) (kinda cool really, it makes each column a
row)
2. You strip out the underscores from each element in @question and
assign it to a simple scalar, $question.
3. You sum the numerals contained in $question and assign it to $answer
(51), consonants (and a 'y') are counted negatively by $variance, but
never used (don't run this with '-w').
4. You replace each numeral with a corresponding vowel (no "Y's", thank
you very much).
5. You print the Question and Answer where $answer is added to the first
command line argument that is given.



Marching orders for the next skirmish in The Spaghetti Wars will be posted
by General Ott in the near future, I imagine.



More information about the grand-rapids-pm-list mailing list