[chuug] CD rippers

Jeff Uphoff juphoff at kjsl.com
Wed Sep 20 17:13:27 EDT 2006


"S" == SeanMike  <highway at cstone.net> writes:

>> --Up, who hasn't a prayer maintaining that (c.

S> Not going to convert it into Intercal?

Nah.

Better would be my convert-arbitrary-base-numbers-to-base-Julie-Andrews
utility:

#!/usr/bin/perl
$_ = 'echo \'(let ((awk (quote ("Do" "Re" "Mi" "Fa" "So" "La" "Ti"))) (cat (quote ()))) (defun sed (expr) (setq cat (format "%s%s" (car (list (nth (% expr 7) awk))) (or cat "")) expr (string-to-int (shell-command-to-string (format "expr \\\( %d - \\\( %d %% %d \\\) \\\) / %d" expr expr (length awk) (length awk))))) (and (> expr 0) (sed expr))) (sed (string-to-int "---" (or -- 10))) (message "%s" cat))\' | xemacs -q -no-site-file -batch -l /dev/stdin';
s/---/$ARGV[0]/;
s/--/$ARGV[1]/;
system $_

Or its slightly more concise, line-noise cousin what only handles
base-10 input:

#!/usr/bin/perl
($\, at _)=("\n","Do","Re","Mi","Fa","So","La","Ti",shift);
do{$_=$_[$_[$#_]%$#_].$_;$_[$#_]=($_[$#_]-$_[$#_]%$#_)/$#_}while($_[$#_]);
print

Come to think of it, those might be more readable in INTERCAL!  :)~

--Up.

--
         \\//////      ________________________
         \\    |      /                        \
         \(_  x|     /  Bloooeeahhh----Perl!!! |
         \    __)  _/__________________________/
       __/   _\ ,. .
      /     /  .%:. * .
     |  |   |   . ;>, $  '
     |  |   |    .=.~@ .  &
     UUUU---|   :?. ;. .^#  .   ^
     |      |    < * '   .   ,  *
      \     |      .  " .   ^


More information about the Chuug mailing list