1. Perl / Говнокод #138

    −379.3

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    sub pfexec { args "pfexec", @_ unless $1.$2 eq "pfexec";
      local ( $_, $lp, @rep ) = @_; $lp ||= 1;
      die 'Command string must not contain $$ sequences' if m/\$\$/o;
      1 while s/\(([^()]*)\)/'$$'.push(@rep,$1)/eo;
    # print $_,"REP:\n","=>",join( "\n=>", @rep),"\n";
      unshift @rep, ""; s/\s+/ /g;
    
    LOOP: while ( $lp-- ) {
            foreach ( split ";" ){
              my @cmd = split " "; $_ = shift @cmd; last unless m/^(\w{2})(\w+)/o;
    CMD:  foreach (@cmd){
                    1 while s/\$\$(\d+)/'('.$rep[$1].')'/eo; s/^\(\s*(.*?)\s*\)$/$1/so;
                    s/^\%(\d+)->(\w+)=//    and ${$HASH[$1]} ->{$2} = $_ and next;
                    /^\%(\d+)->(\w+)/               and $_ = ${$HASH[$1]} ->{$2} and redo CMD;
    
                    /^%%(\d+)/      and $_ = $HASH[$1] || ( $HASH[$1] = \{} ) and next;
                    /^\%(\d+)/      and $_ = ${$HASH[$1]} and next;
                    /^\#\#(\d+)/ and $_ = $CHAN[$1] || ( $CHAN[$1] = \{} ) and next;
                    /^\#(\d+)/      and $_ = ${$CHAN[$1]} and next;
              }
              $_ = $::control{$1} && $::control{$1}{$2};
              s/\^(\d+)/$cmd[$1-1]/geo and print "Expanded to: $_\n"
                    and pfexec( $_ ) if !ref;
              args $1.$2, @cmd and eval { $_->(@cmd) } if "CODE" eq ref;
              last LOOP if $@;
            }
      }

    Так пишет мой коллега

    guest, 12 Декабря 2008

    Комментарии (11)
  2. Perl / Говнокод #100

    −1006.6

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    @lib_001=('A','G','C','T','A');
    @lib_002=('C','T','A','A','G');		 
    @lib_003=('T','G','C','A','T');
    
    $string=<FILE>;
    @sequence=split("",$string);
    @code=@sequence[-7..-3];
    		
    if((join('',@lib_001) eq join('',@code)) or
        (join('',@lib_001[0..3]) eq join('',@code[0..3])) or
        (join('',@lib_001[1..4]) eq join('',@code[1..4])) or
        (join('',@lib_001[0,1,2,4]) eq join('',@code[0,1,2,4])) or
        (join('',@lib_001[0,2,3,4]) eq join('',@code[0,2,3,4])) or
        (join('',@lib_001[0,1,3,4]) eq join('',@code[0,1,3,4]))) 
    	{$tag=join('',@code);
    	 $closest_tag=join('',@lib_001);}
    			
    elsif((join('',@lib_002) eq join('',@code)) or
         (join('',@lib_002[0..3]) eq join('',@code[0..3])) or
         (join('',@lib_002[1..4]) eq join('',@code[1..4])) or
         (join('',@lib_002[0,1,2,4]) eq join('',@code[0,1,2,4])) or
         (join('',@lib_002[0,2,3,4]) eq join('',@code[0,2,3,4])) or
         (join('',@lib_002[0,1,3,4]) eq join('',@code[0,1,3,4]))) 
    	{$tag=join('',@code);
    	 $closest_tag=join('',@lib_002);}
    		
    elsif((join('',@lib_003) eq join('',@code)) or
         (join('',@lib_003[0..3]) eq join('',@code[0..3])) or
         (join('',@lib_003[1..4]) eq join('',@code[1..4])) or
         (join('',@lib_003[0,1,2,4]) eq join('',@code[0,1,2,4])) or
         (join('',@lib_003[0,2,3,4]) eq join('',@code[0,2,3,4])) or
         (join('',@lib_003[0,1,3,4]) eq join('',@code[0,1,3,4]))) 
    	{$tag=join('',@code);
    	 $closest_tag=join('',@lib_003);}
    
    else
    	{$tag=join('',@code);
    	  $closest_tag='NONE';}

    guest, 10 Декабря 2008

    Комментарии (17)
  3. Perl / Говнокод #60

    −366.4

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    ###
    ### ввод цен на открытки
    ###
    
    if ($p{card}==0) {$o=0}
    if ($p{card}==1) {$o=20}
    if ($p{card}==2) {$o=20}
    if ($p{card}==3) {$o=20}
    if ($p{card}==4) {$o=20}
    if ($p{card}==5) {$o=20}
    if ($p{card}==6) {$o=20}
    if ($p{card}==7) {$o=20}
    if ($p{card}==8) {$o=20}
    if ($p{card}==9) {$o=20}
    if ($p{card}==10) {$o=20}
    if ($p{card}==11) {$o=20}
    if ($p{card}==12) {$o=20}
    if ($p{card}==13) {$o=20}
    if ($p{card}==14) {$o=20}
    if ($p{card}==15) {$o=20}
    if ($p{card}==16) {$o=20}
    if ($p{card}==17) {$o=20}
    if ($p{card}==18) {$o=20}

    guest, 04 Декабря 2008

    Комментарии (15)
  4. Perl / Говнокод #55

    −111.4

    1. 1
    #!/usr/blin/perl

    guest, 04 Декабря 2008

    Комментарии (72)