=()= / Говнокод #704 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  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
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 62
  63. 63
  64. 64
  65. 65
  66. 66
  67. 67
  68. 68
  69. 69
  70. 70
  71. 71
  72. 72
  73. 73
  74. 74
  75. 75
  76. 76
  77. 77
  78. 78
  79. 79
  80. 80
  81. 81
  82. 82
  83. 83
  84. 84
  85. 85
  86. 86
  87. 87
  88. 88
  89. 89
  90. 90
  91. 91
  92. 92
  93. 93
  94. 94
  95. 95
  96. 96
  97. 97
  98. 98
  99. 99
  100. 100
my ($_bonus1_l, $_bonus1_y, $_bonus2_l, $_bonus2_y) = ($l1*10 > rand(100) ? 1 : 0, $y1*10 > rand(100) ? 1 : 0, $l2*10 > rand(100) ? 1 : 0, $y2*10 > rand(100) ? 1 : 0);
      ($_bonus1_l, $_bonus2_l) = (0, 0) if $_bonus1_l == 1 and $_bonus2_l == 1;
      ($_bonus1_y, $_bonus2_y) = (0, 0) if $_bonus1_y == 1 and $_bonus2_y == 1;
if($turn > 12){
      my ($_a1_def, $_b1_def, $_c1_def) = mass($pl1_mov, $User1, "def");
      my ($_a1_att, $_b1_att, $_c1_att) = mass($pl1_att, $User1, "att");
      my ($_a2_def, $_b2_def, $_c2_def) = mass($pl2_mov, $User2, "def");
      my ($_a2_att, $_b2_att, $_c2_att) = mass($pl2_att, $User2, "att");

$N1 += $_a1_att if $_a2_def < 1000000;
$N1 += $_b1_att if $_b2_def < 1000000;
$N1 += $_c1_att if $_c2_def < 1000000;
$N2 += $_a2_att if $_a1_def < 1000000;
$N2 += $_b2_att if $_b1_def < 1000000;
$N2 += $_c2_att if $_c1_def < 1000000;

      if($_bonus1_l){
       	 my $l = int(rand(3));
	 ## сБНПНР
         if($l == 0){
         	my $r = 0;
	 	($_a2_att, $r) = (0, 1) if $_a2_att > 0 and $_a1_def < 1000000;
      	 	($_b2_att, $r) = (0, 1) if $_b2_att > 0 and $_a1_def < 1000000 and $r == 0;
		($_c2_att, $r) = (0, 1) if $_c2_att > 0 and $_a1_def < 1000000 and $r == 0;
                $U1 = $r;
         } elsif($l == 1){
                my $r = 0;
                ($_a1_att, $r, $K2) = (int($_a1_att * 1.5), 1, int($_a1_att/2)) if $_a1_att > 0  and $_a2_def < 1000000;
                ($_b1_att, $r, $K2) = (int($_b1_att * 1.5), 1, int($_b1_att/2)) if $_b1_att > 0  and $_b2_def < 1000000 and $r == 0;
                ($_c1_att, $r, $K2) = (int($_c1_att * 1.5), 1, int($_c1_att/2)) if $_c1_att > 0  and $_c2_def < 1000000 and $r == 0;
         } elsif($l == 2){
                my ($r, $ov, $v) = (0, 0, int(rand(3)));
                ($_a1_att, $r, $ov) = (0, 1, (int($_a2_att/2))) if $_a2_att > 0 and $_a1_def > 1000000;
                ($_b1_att, $r, $ov) = (0, 1, (int($_b2_att/2))) if $_b2_att > 0 and $_b1_def > 1000000 and $r == 0;
                ($_c1_att, $r, $ov) = (0, 1, (int($_c2_att/2))) if $_c2_att > 0 and $_c1_def > 1000000 and $r == 0;
                $_a1_att += $ov if $v == 0;
                $_b1_att += $ov if $v == 1;
                $_c1_att += $ov if $v == 2;
                $O1 = $ov;
         }
      }
      if($_bonus2_l){
       	 my $l = int(rand(100));
         if($l == 0){
         	my $r = 0;
	 	($_a1_att, $r) = (0, 1) if $_a1_att > 0 and $_a2_def < 1000000;
      	 	($_b1_att, $r) = (0, 1) if $_b1_att > 0 and $_a2_def < 1000000 and $r == 0;
		($_c1_att, $r) = (0, 1) if $_c1_att > 0 and $_a2_def < 1000000 and $r == 0;
                 $U2 = $r;
         } elsif($l == 1){
                my $r = 0;
                ($_a2_att, $r, $K1) = (int($_a2_att * 1.5), 1, int($_a2_att/2)) if $_a2_att > 0  and $_a1_def < 1000000;
                ($_b2_att, $r, $K1) = (int($_b2_att * 1.5), 1, int($_b2_att/2)) if $_b2_att > 0  and $_b1_def < 1000000 and $r == 0;
                ($_c2_att, $r, $K1) = (int($_c2_att * 1.5), 1, int($_c2_att/2)) if $_c2_att > 0  and $_c1_def < 1000000 and $r == 0;
         } elsif($l == 2){
         	my ($r, $ov, $v) = (0, 0, int(rand(3)));
                ($_a2_att, $r, $ov) = (0, 1, (int($_a1_att/2))) if $_a1_att > 0 and $_a2_def > 1000000;
                ($_b2_att, $r, $ov) = (0, 1, (int($_b1_att/2))) if $_b1_att > 0 and $_b2_def > 1000000 and $r == 0;
                ($_c2_att, $r, $ov) = (0, 1, (int($_c1_att/2))) if $_c1_att > 0 and $_c2_def > 1000000 and $r == 0;
                $_a2_att += $ov if $v == 0;
                $_b2_att += $ov if $v == 1;
                $_c2_att += $ov if $v == 2;
                $O2 = $ov;
         }
      }
      if($_bonus1_y){
          my $l = int(rand(2));
         if($l == 0){
            my ($r, $rik, $V1) = (0, 0, int(rand(3)) + 1);
            ($r, $rik) = (1, (int($_a1_att/2))) if $_a1_att > 0 and $_a2_def < 1000000 and $V1 == 1;
            ($r, $rik) = (1, (int($_b1_att/2))) if $_b1_att > 0 and $_b2_def < 1000000 and $r == 0 and $V1 == 2;
            ($r, $rik) = (1, (int($_c1_att/2))) if $_c1_att > 0 and $_c2_def < 1000000 and $r == 0 and $V1 == 3;
            $R2 = $rik;
            $db->query("UPDATE duel set pl1_rik = CONCAT(pl1_rik, $V1) where sid = \"$dsid\"") if $R2 > 0;

         } elsif($l == 1){
            my $r = 0;
            ($_a2_def, $r) = ($_a2_def - 1000000, 1) if $_a1_att > 0 and $_a2_def > 1000000;
            ($_b2_def, $r) = ($_b2_def - 1000000, 2) if $_b1_att > 0 and $_b2_def > 1000000 and $r == 0;
            ($_c2_def, $r) = ($_c2_def - 1000000, 3) if $_c1_att > 0 and $_c2_def > 1000000 and $r == 0;
            $T2 = $r;
         }
      }
      if($_bonus2_y){
          my $l = int(rand(2));
         if($l == 0){
            my ($r, $rik, $V2) = (0, 0, int(rand(3)) + 1);
            ($r, $rik) = (1, (int($_a2_att/2))) if $_a2_att > 0 and $_a1_def < 1000000 and $V2 == 1;
            ($r, $rik) = (1, (int($_b2_att/2))) if $_b2_att > 0 and $_b1_def < 1000000 and $r == 0 and $V2 == 2;
            ($r, $rik) = (1, (int($_c2_att/2))) if $_c2_att > 0 and $_c1_def < 1000000 and $r == 0 and $V2 == 3;

            #$_a2_att += $rik if $V2 == 1;
            #$_b2_att += $rik if $V2 == 2;
            #$_c2_att += $rik if $V2 == 3;
            $R1 = $rik;
            $db->query("UPDATE duel set pl2_rik = CONCAT(pl2_rik, $V2) where sid = \"$dsid\"") if $R1 > 0;
         } elsif($l == 1){
            my $r = 0;
            ($_a1_def, $r) = ($_a1_def - 1000000, 1) if $_a2_att > 0 and $_a1_def > 1000000;
            ($_b1_def, $r) = ($_b1_def - 1000000, 2) if $_b2_att > 0 and $_b1_def > 1000000 and $r == 0;

Из браузерной игрушки на mod_perl/mysql. Код наглядно демонстрирует, что говнокод зависит не от языка, а от программиста.

Запостил: guest guest, (Updated )

Комментарии (1) RSS

Добавить комментарий

Помни, guest, за тобой могут следить!

    А не использовать ли нам bbcode?


    8