- 1
- 2
- 3
- 4
- 5
for i:=1 to n do
begin
j:=i;
a:=b*exp((j-1)*ln(r));
end;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−29.2
for i:=1 to n do
begin
j:=i;
a:=b*exp((j-1)*ln(r));
end;
Задание геометрической прогрессии. Из решения школьной задачки.
+71
<?
if ($_SESSION['UsersPermission'] != 'admin') {?>
<script type = "text/javascript">
location.href = "index.php";
</script>
<?}
Мега безопасная проверка на права админа
−452.5
z=1;
b1.onRelease = function() {
if(xo1._alpha!=100){
z+=1;
if(z>2){z=1}
xo1._alpha=100;
xo1.gotoAndStop(z);}
};
b2.onRelease = function() {
if(xo2._alpha!=100){
z+=1;
if(z>2){z=1}
xo2._alpha=100;
xo2.gotoAndStop(z);}
};
b3.onRelease = function() {
if(xo3._alpha!=100){
z+=1;
if(z>2){z=1}
xo3._alpha=100;
xo3.gotoAndStop(z);}
};
b4.onRelease = function() {
if(xo4._alpha!=100){
z+=1;
if(z>2){z=1}
xo4._alpha=100;
xo4.gotoAndStop(z);}
};
b5.onRelease = function() {
if(xo5._alpha!=100){
z+=1;
if(z>2){z=1}
xo5._alpha=100;
xo5.gotoAndStop(z);}
};
b6.onRelease = function() {
if(xo6._alpha!=100){
z+=1;
if(z>2){z=1}
xo6._alpha=100;
xo6.gotoAndStop(z);}
};
b7.onRelease = function() {
if(xo7._alpha!=100){
z+=1;
if(z>2){z=1}
xo7._alpha=100;
xo7.gotoAndStop(z);}
};
b8.onRelease = function() {
if(xo8._alpha!=100){
z+=1;
if(z>2){z=1}
xo8._alpha=100;
xo8.gotoAndStop(z);}
};
b9.onRelease = function() {
if(xo9._alpha!=100){
z+=1;
if(z>2){z=1}
xo9._alpha=100;
xo9.gotoAndStop(z);}
};
Интерфейс крестиков-ноликов на флеше, AS.
−593.8
Dim cr
Private Function click()
If cr = 0 Then
cr = 1
click = "X"
Else
cr = 0
click = "O"
End If
End Function
Private Sub CommandButton1_Click()
If CommandButton1.Caption = "" Then CommandButton1.Caption = click()
End Sub
Private Sub CommandButton10_Click()
cr = 0
CommandButton1.Caption = ""
CommandButton2.Caption = ""
CommandButton3.Caption = ""
CommandButton4.Caption = ""
CommandButton5.Caption = ""
CommandButton6.Caption = ""
CommandButton7.Caption = ""
CommandButton8.Caption = ""
CommandButton9.Caption = ""
End Sub
Private Sub CommandButton2_Click()
If CommandButton2.Caption = "" Then CommandButton2.Caption = click()
End Sub
Private Sub CommandButton3_Click()
If CommandButton3.Caption = "" Then CommandButton3.Caption = click()
End Sub
Private Sub CommandButton4_Click()
If CommandButton4.Caption = "" Then CommandButton4.Caption = click()
End Sub
Private Sub CommandButton5_Click()
If CommandButton5.Caption = "" Then CommandButton5.Caption = click()
End Sub
Private Sub CommandButton6_Click()
If CommandButton6.Caption = "" Then CommandButton6.Caption = click()
End Sub
Private Sub CommandButton7_Click()
If CommandButton7.Caption = "" Then CommandButton7.Caption = click()
End Sub
Private Sub CommandButton8_Click()
If CommandButton8.Caption = "" Then CommandButton8.Caption = click()
End Sub
Private Sub CommandButton9_Click()
If CommandButton9.Caption = "" Then CommandButton9.Caption = click()
End Sub
Крестики-нолики на Power Point за 2 минуты.
−32
#define NULL 1
:) Из той же оперы, что и http://govnokod.ru/62
−53.9
$g_db->q("SELECT * FROM {$GLOBAL['db']['pref']}_volumes
WHERE `visible` != 0 AND `owner_id`={$duser['u_id']}
AND (`parent_volume`=0 OR `parent_volume`!=0)"); //<-- Чёрная магия! Не редактировать!
Без ТАКОГО последнего AND возвращает 0 строк :(
+25.9
if(dOper1p->Caption == "-0")
dOper1p->Caption = "+0";
if(dOper2p->Caption == "-0")
dOper2p->Caption = "+0";
if(dOper1m->Caption == "-0.0")
dOper1m->Caption = "+0.0";
if(dOper2m->Caption == "-0.0")
dOper2m->Caption = "+0.0";
типичный представитель говнокода
−10.5
this.SelectedDate = this.SelectedDate;
Проверяем дату на корректность...
+52.3
//разметка матрицы
while ((founded==1)&&(mat[nx][ny]<=0)) {
founded=0;
iii=y-i;
while (((i==0)&&(iii==y))||((iii<=y+i))){
ii=x-i;
while ((ii<=x+i)){
if ((mat[ii][iii]==i)&&((ii<70)&&(ii>=0))&&((iii<70)&&(iii>=0))) {
bii=ii;
biii=iii;
if ((mat[bii+1][biii]==-1)&&(bii+1<70)&&(bii+1>=0)) {
mat[bii+1][biii]=i+1;
founded=1;
}
if ((mat[bii-1][biii]==-1)&&(bii-1<70)&&(bii-1>=0)) {
mat[bii-1][biii]=i+1;
founded=1;
}
if ((mat[bii][biii+1]==-1)&&(biii+1<70)&&(biii+1>=0)) {
mat[bii][biii+1]=i+1;
founded=1;
}
if ((mat[bii][biii-1]==-1)&&(biii-1<70)&&(biii-1>=0)) {
mat[bii][biii-1]=i+1;
founded=1;
}
}
ii++;
}
iii++;
}
i++;
}
if (mat[nx][ny]>=0) {
if ((nx==40)&&(ny==57)) {
nx=nx;
}
ik=i;
ii=nx;
iii=ny;
//поиск пути
while (ik>1) {
if ((mat[ii-1][iii]==ik-1)&&(ii-1<70)&&(ii-1>=0)) {
ii--;
mat[ii][iii]=-3;
}
if ((mat[ii][iii-1]==ik-1)&&(iii-1<70)&&(iii-1>=0)) {
iii--;
mat[ii][iii]=-3;
}
if ((mat[ii+1][iii]==ik-1)&&(ii+1<70)&&(ii+1>=0)) {
ii++;
mat[ii][iii]=-3;
}
if ((mat[ii][iii+1]==ik-1)&&(iii+1<70)&&(iii+1>=0)) {
iii++;
mat[ii][iii]=-3;
}
ik--;
}
ax=ii*10+5;
ay=iii*10+5;
//out_to_file(mat,"d:\\out.txt");
i++;
ii=0;
iii=0;
while ((iii>-1)&&(iii<70)){
ii=0;
while ((ii>-1)&&(ii<70)){
if ((mat[ii][iii]>-1)||(mat[ii][iii]==-3)) {
mat[ii][iii]=-1;
}
ii++;
}
iii++;
}
nx=ax;
ny=ay;
} else ...
}
Разметка матрицы, Поиск Пути.
+24
/**
* Getter for billbackAdjustmentType
*
* @return the billbackAdjustmentType instance
*/
public BillbackAdjustmentType getBillbackAdjustmentType() {
return billbackAdjustmentType != null ? billbackAdjustmentType : BillbackAdjustmentType.PlusBillbackAdjustment;
}
...и попробуй такое найди под дебагом :)