1. ## VisualBasic / Говнокод #25393

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
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
``````sub addleft
for i = 1 to 4
for j = 1 to 3
if a(i,j)<>0 and a(i,j) = a(i,j+1) then
moved = true
a(i,j) = a(i,j)+1
a(i,j+1) = 0
score = score + integer ( 2**a(i,j) )
end if
end for
end for
end sub

sub left
for i = 1 to 4
for k = 1 to 3
for j = 1 to 3
if a(i,j) = 0 and a(i,j+1) <> 0 then
moved = true
a(i,j) = a(i,j+1)
a(i,j+1) = 0
end if
end for
end for
end for
end sub

rem . . .

rem главный суслик
while true
xy = touchdown()
if xy <> -1 then
x = xy/65536&0x0000ffff
y = xy&0x0000ffff
repeat
sleep 10
xy = touchup()
until xy <> -1
x = x - (xy/65536&0x0000ffff)
y = y - (xy&0x0000ffff)
if (abs(x)>100) <> (abs(y)>100) then
moved = false
if abs(x) > 100 then
if x > 0 then
left
left
else
right
right
end if
else
if y > 0 then
up
up
else
down
down
end if
end if
if moved then
rand
end if
end if
else
sleep 10
end if
draw
sleep 50
end while``````

Не визуальный, но всё-таки барсик (могильный).

Комментарии (19)
2. ## Java / Говнокод #25392

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
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
``````/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

/* @test
@bug 4890726
@summary Check the correctness of KOI8_U by comparing to KOI8_R
*/

import java.util.*;
import static java.lang.Character.UnicodeBlock;

public class UkrainianIsNotRussian {
private static String decode(byte[] bytes, String encoding) throws Throwable {
String s = new String(bytes, encoding);
equal(s.length(), 1);
check(Arrays.equals(s.getBytes(encoding), bytes));
return s;
}

private static void realMain(String[] args) throws Throwable {
final byte[] bytes = new byte;
int differences = 0;
for (int i = 0; i < 0xff; i++) {
bytes = (byte) i;
final String r = decode(bytes, "KOI8_R");
final String u = decode(bytes, "KOI8_U");
if (! r.equals(u)) {
differences++;
final char rc = r.charAt(0);
final char uc = u.charAt(0);
final UnicodeBlock rcb = UnicodeBlock.of(rc);
final UnicodeBlock ucb = UnicodeBlock.of(uc);
System.out.printf("%02x => %04x %s, %04x %s%n",
i, (int) rc, rcb, (int) uc, ucb);
check(rcb == UnicodeBlock.BOX_DRAWING &&
ucb == UnicodeBlock.CYRILLIC);
}
}
equal(differences, 8);
}

//--------------------- Infrastructure ---------------------------
static volatile int passed = 0, failed = 0;
static void pass() {passed++;}
static void fail(String msg) {System.out.println(msg); fail();}
static void unexpected(Throwable t) {failed++; t.printStackTrace();}
static void check(boolean cond) {if (cond) pass(); else fail();}
static void equal(Object x, Object y) {
if (x == null ? y == null : x.equals(y)) pass();
else fail(x + " not equal to " + y);}
public static void main(String[] args) throws Throwable {
try {realMain(args);} catch (Throwable t) {unexpected(t);}
System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
if (failed > 0) throw new AssertionError("Some tests failed");}
}``````

``https://github.com/AdoptOpenJDK/openjdk-jdk11/blob/master/test/jdk/sun/nio/cs/UkrainianIsNotRussian.java``

Комментарии (159)
3. ## JavaScript / Говнокод #25391

1. 1
``\$(`.js-filter-panel__radio__pre-tuned-up-settings`).find(`.js-filter-reg-date-radio-item:not(#\${\$input.attr(this._preTunedSelectedPeriod)})`).prop('checked', false);``

Комментарии (0)
4. ## PHP / Говнокод #25390

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
``````protected function validateArguments(array \$argv = null)
{
\$argc = count(\$argv);

if (1 == \$argc && is_array(\$argv)) {
return \$argv;
}

if (2 == \$argc) {
if (is_array(\$argv) && (is_numeric(\$argv) || is_null(\$argv) || is_string(\$argv))) {
\$argv[] = \$argv;

return \$argv;
}

if ((is_numeric(\$argv) || is_string(\$argv)) && (is_numeric(\$argv) || is_string(\$argv))) {
return \$argv;
}
}

if (3 == \$argc) {
if ((is_numeric(\$argv) || is_string(\$argv)) && (is_numeric(\$argv) || is_string(\$argv)) && (is_numeric(\$argv) || is_null(\$argv) || is_string(\$argv))) {
return \$argv;
}
}

array_walk(\$argv, function (&\$value) {
if (is_array(\$value)) {
\$value = 'Array';
} else {
\$value = sprintf('"%s"', \$value);
}
});

throw new InvalidValueException(sprintf('Invalid parameters passed to %s::%s: %s', get_class(\$this), '__construct', implode(', ', \$argv)));
}``````

Комментарии (4)
5. ## JavaScript / Говнокод #25389

1. 1
``this._hideDataLabels = this._filter._accordionSettings._children._children._value;``

Комментарии (5)
6. ## 1C / Говнокод #25388

1. 1
``Мес = ?(Месяц(ДатаДок) > 9 ,Строка(Месяц(ДатаДок)) ,"0"+ Строка(Месяц(ДатаДок)));``

Формат(ДатаДок, "ДФ=MM") придуман для неудачников!

Комментарии (5)
7. ## PHP / Говнокод #25387

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
``````<?php
require_once("JavaScriptPacker.php");
function pack_js(\$input){
return (new \JavaScriptPacker(\$input, 62, TRUE, FALSE))->pack();
}
?>

<script>
<?php ob_start("pack_js"); ?>
//awal penulisan javascript
//akhir penulisan javascript
<?php ob_end_flush(); ?>
</script>``````

Нужно угадать для чего нужен JavaScriptPacker

Комментарии (20)
8. ## C# / Говнокод #25385

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
39. 39
40. 40
41. 41
42. 42
``````using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class SimpleEngine : MonoBehaviour
{
NavMeshAgent main;
Vector3 Pos2;
void Start()
{
main = GetComponent<NavMeshAgent>();
Pos2 = new Vector3(-43, 5, 0);
}
void Update()
{
main.SetDestination(Pos2);
if (GameObject.Find("Planedelete").GetComponent<TriggerDelete>().newDestroy == true)
{
Destroy(gameObject); // Само удаление!!!
}

if (GameObject.Find("PlaneLight").GetComponent<TriggerLight>().Activate == true)
{

if (GameObject.Find("TrafficLight").GetComponent<TrafficLightController>().Logistic == true)
{
main.speed = 80;

}
if (GameObject.Find("TrafficLight").GetComponent<TrafficLightController>().Logistic == false)
{
main.speed = 0;

}
}
if (GameObject.Find("PlaneLight").GetComponent<TriggerLight>().Activate == false)
{
main.speed = 80;
main.acceleration = 8;
}
}
}``````

ШЕДЕВР ДОЛБОГНОМА ВСЕЯ UNITY3D...

Комментарии (36)
9. ## Куча / Говнокод #25384

1. 1
2. 2
3. 3
``````Заметили, что во всех рекламных роликах (всякие fonbet, delivery club, заказ пиццы, и прочие)
используется именно "iPhone"?
Теперь это особо заметно из-за характерной хероты на "iPhone X".``````

Комментарии (37)
10. ## JavaScript / Говнокод #25383

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
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
``````<!DOCTYPE html>
<html>
<meta charset="UTF-8">
<title>Calendar</title>
<body>

<style>
.month, .month.vert .week, .day { display:inline-block; }
.month.vert .day { display:block; }
.day { border:1px solid #ccc; width:30px; line-height:30px; text-align:center; }
</style>

<div class="month"></div>

<script>
var calendar = {
update: function (year, month) {
this.days.length = 7;
var stepDay = new Date(year, month, 1);
stepDay.setDate(1 - stepDay.getDay());
var lastDay = new Date(year, month + 1, 0);
lastDay.setDate(lastDay.getDate() + 6 - lastDay.getDay());
while (stepDay <= lastDay) {
this.days.push(stepDay.getDate());
stepDay.setHours(24);
}
},
render: function () {
var html = '';
for (var i = 0, j = 0; i < this.days.length; j = ++i % 7) {
if (j == 0) html += '<div class="week">';
html += '<div class="day">' +  this.days[i] + '</div>';
if (j == 6) html += '</div>';
}
this.element.innerHTML = html;
},
toggle: function () {
this.element.classList.toggle('vert');
}
};
var today =  new Date, thisYear = today.getFullYear(), thisMonth = today.getMonth();
calendar.days = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
calendar.element = document.querySelector('.month');
calendar.element.addEventListener('click', function () { calendar.toggle() });
calendar.update(thisYear, thisMonth);
calendar.render();
</script>

</body>
</html>``````

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