- 1
db "Ассемблер язык настолько суровый, что для него нет понятия говнокода!"
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+4
db "Ассемблер язык настолько суровый, что для него нет понятия говнокода!"
+12
BuildRotateMatrix_:
mov edi,offset _RotateM
fld [esi]._x
fsincos
fld [esi]._y
fsincos
fld [esi]._z
fsincos
fld st(0)
fmul st(0),st(3)
fstp [edi]._E00
fld st(2)
fmul st(0),st(2)
fstp [edi]._E01
fld st(3)
fchs
fstp [edi]._E02
fld st(5)
fmul st(0),st(4)
fmul st(0),st(1)
fld st(5)
fmul st(0),st(3)
fsubp st(1),st(0)
fstp [edi]._E10
fld st(5)
fmul st(0),st(3)
fmul st(0),st(1)
fld st(5)
fmul st(0),st(4)
faddp st(1),st(0)
fstp [edi]._E11
fld st(5)
fmul st(0),st(3)
fstp [edi]._E12
fld st(4)
fmul st(0),st(4)
fmul st(0),st(1)
fld st(6)
fmul st(0),st(3)
faddp st(1),st(0)
fstp [edi]._E20
fld st(4)
fmul st(0),st(4)
fmul st(0),st(2)
fld st(6)
fmul st(0),st(2)
fsubp st(1),st(0)
fstp [edi]._E21
fld st(4)
fmul st(0),st(3)
fstp [edi]._E22
finit
fld1
fstp [edi]._E33
xor eax,eax
mov [edi]._E03,eax
mov [edi]._E13,eax
mov [edi]._E23,eax
mov [edi]._E30,eax
mov [edi]._E31,eax
mov [edi]._E32,eax
ret
На самом деле это не говнокод, но на осомблере всё выглядит как кусок говна :3
+48
$rand = rand ( 100, 1000000000 );
$sess = md5 ( $rand );
echo "<form method=\"post\" action=\"?sid=" . $sess . ">";
echo "Введите код с картинки: " . $rand . "<br>";
echo "<input name=\"cod\"><br>";
echo "<input type=\"submit\" value=\"Отправить\">
сильнейшая капча
+40.5
$price = round(100*$price*$selected_currency_details[1])/100;
if (round($price*10) == $price*10 && round($price)!=$price)
$price = "$price"."0"; //to avoid prices like 17.5 - write 17.50 instead
Shop-Script PREMIUM
+22.3
if ($_POST['id']) {
$id = $_POST['id'];
} elseif ($_GET['id']) {
$id = $_GET['id'];
}
if (isset($_POST['password'])) {
$password = md5($_POST['password']);
} elseif (isset($_GET['password'])) {
$password = md5($_GET['password']);
}
+15.2
BOOL ConvertDays(UINT32 days, SYSTEMTIME* lpTime)
{
int dayofweek, month, year;
UINT8 *month_tab;
//Calculate current day of the week
dayofweek = GetDayOfWeek(days);
year = ORIGINYEAR;
while (days > 365)
{
if (IsLeapYear(year))
{
if (days > 366)
{
days -= 366;
year += 1;
}
}
else
{
days -= 365;
year += 1;
}
}
// Determine whether it is a leap year
month_tab = (UINT8 *)((IsLeapYear(year))? monthtable_leap : monthtable);
for (month=0; month<12; month++)
{
if (days <= month_tab[month])
break;
days -= month_tab[month];
}
month += 1;
lpTime->wDay = days;
lpTime->wDayOfWeek = dayofweek;
lpTime->wMonth = month;
lpTime->wYear = year;
return TRUE;
}
То что вызвало зависание всех MS Zune 30Gb по всему миру.
+23.1
<?php
function is_featured($word_id) {
$sql = "SELECT * FROM `featured` WHERE `featured_id` = '$word_id'";
$results = mysql_query($sql);
if (mysql_num_rows($results)) {
return true;
} else {
return false;
}
}
Классический говнокод, встречаю очень часто
+32.7
if(count($a)>0)
{
for($i=0; $i<count($a); $i++)
{
//код код код
}
}
что-то подобное)
+19
<?php
function word_filter($str) {
$filtered = '';
for ($i = 0; $i <= strlen($str) - 1; $i++) {
$char = substr($str, $i, 1);
if (ctype_alpha($char)) {
$filtered .= $char;
}
}
return $filtered;
}
как делают дебилы: $i <= strlen($str) - 1;
кто знает, так - $j = strlen($str), $i < $j
+20.2
year = ORIGINYEAR; /* = 1980 */
while (days > 365)
{
if (IsLeapYear(year))
{
if (days > 366)
{
days -= 366;
year += 1;
}
}
else
{
days -= 365;
year += 1;
}
}
Код часов в M$ Zune 30GB.