This is really my first JAPH: The last one, my first JAPH which was not in fact, technically a JAPH, wasn't a JAPH, merely obfuscated. errr...

I'm afraid it isn't hugely obfuscated but I am mildly happy with it. As always, all comments welcome.

#! /usr/bin/perl -w use strict; my @zxa; my $zax = ' aac aaa ata tac gtt taa aaa aat ggg ggt taa gca gac gtg aaa cag gac gtg gga aaa agg ctc ctt gct gac gtg aag ';;$zax =~ s/\s//g;;$zax=~ tr/acgt/0123/;;;my $xza;;while ($zax =~ s/^(...)//){ $xza = $1;;push @zxa, $xza;}my $ixz;;my $axz;foreach $zax(@zxa){$axz = 0;;; for ($ixz=2;$ixz >=0; --$ixz) {$zax =~ s/^(.)//;$axz+= $1*(4**$ixz);}$zax = $axz; }foreach $xza(@zxa){if ($xza == 0){$xza+=32;;;}elsif ($xza == 1){$xza += 44;}elsif ($xza == 2){$xza+= 44; }elsif ($xza >=3 && $xza <=28){$xza+=62;}elsif ($xza >=29 && $xza <=54){$xza += 68;}}@zxa = map chr, @zxa ;;print "\n";;print join "",@zxa;print "\n\n";

I hope there are no typos: I'll be around tonight so if there are any problems, I'll rectify them. (I'm not allowed to network my laptop here at Uni :-| and the network is WinNT and I'm not allowed to install Perl Win32 :-( which is annoying.)

Elgon

Replies are listed 'Best First'.
Re: First (real) JAPH
by Anonymous Monk on Jan 21, 2001 at 08:03 UTC
    Very good. You used alot of math in this I see. It's pretty easy to follow though, so maybe try to...confuse the reader more next time. ++!
Re: First (real) JAPH
by a (Friar) on Jan 21, 2001 at 11:26 UTC
    Maybe one; line 7 '))' s/b ')', after which I get (winx 5.6.0 b623)
    /n- Just Another Perl Hacker./n/n

    a

      Strange,

      it works fine on my laptop (Versa 4080H running Debian 'potato') and I've looked over the code and the newline characters are in interpolative (double) quotes, so it should work: I thought the interpreter would 'realise' that your system is Win32 and alter the output accordingly.

      Thanks for the typo spotting, I removed the extra bracket.

      Anyone got any ideas?

      Elgon

        The code you posted here has forward-slash n instead of backslash n. Perl doesn't do what you mean in that case, because maybe you really did want to output "/n". :)