PWC 251
PWC 251 This time I tried both challenges using antique software on DOSBOX: Perl 4.019 for DOS, and for comparison Python 1.4 beta for DOS. My solutions also run on the current versions of Perl 5 (5.38) and Python 2 (2.7.18). Hooray for backward compatibility! Challenge 1 (Concatenation Value) Links to solution: Perl Python We are given a list of positive integers, say ints . We are asked to follow the following procedure: Concatenate ints[0] and ints[-1] (last element). Store the result in retval say. Concatenate ints[1] and ints[-2] (second-last element), and add the result to retval . Concatenate ints[2] and ints[-3] .... etc. until we have reached the middle of the list. Return retval . Here is the Perl 4.019 subroutine (it also works fine on the latest Perl 5.38). sub concatenation_value { local(@ints)=@_; local($x,$retval)=(0,0); foreach $x (0 .. @ints/2-1) { $retval += $ints[$x] . $ints[$#ints-$x]; } (@ints % 2) && ($retva...