- 1
- 2
- 3
#include <math.h>
result = (use_cos ? cos : sin)(M_PI);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+133.4
#include <math.h>
result = (use_cos ? cos : sin)(M_PI);
Прогрессивно.
−354.7
def _ne_ (self, cmp):
return True if (self < cmp or self > cmp) else False
Сравнение объектов
+151.4
if(Silverlight.isInstalled("2.0"))
logWrite("Падшая женщина!");
// На сервере обработка просто убила (C#):
string blyad = "Падшая женщина!";
...
if (respString == blyad)
GetProfile(userID).isSilverlight = Convert.ToBoolean(blyad.Length.GetHashCode());
+151.3
function Cross(value) {
if (value == 0) document.pole0.src = x.src;
if (value == 1) document.pole1.src = x.src;
if (value == 2) document.pole2.src = x.src;
if (value == 3) document.pole3.src = x.src;
if (value == 4) document.pole4.src = x.src;
if (value == 5) document.pole5.src = x.src;
if (value == 6) document.pole6.src = x.src;
if (value == 7) document.pole7.src = x.src;
if (value == 8) document.pole8.src = x.src;
}
function Zero(value) {
if (value == 0) document.pole0.src = o.src;
if (value == 1) document.pole1.src = o.src;
if (value == 2) document.pole2.src = o.src;
if (value == 3) document.pole3.src = o.src;
if (value == 4) document.pole4.src = o.src;
if (value == 5) document.pole5.src = o.src;
if (value == 6) document.pole6.src = o.src;
if (value == 7) document.pole7.src = o.src;
if (value == 8) document.pole8.src = o.src;
}
function CheckVictory() {
if (cell[0] == cell[1] && cell[1] == cell[2] && cell[2] > 0) return true;
if (cell[3] == cell[4] && cell[4] == cell[5] && cell[5] > 0) return true;
if (cell[6] == cell[7] && cell[7] == cell[8] && cell[8] > 0) return true;
if (cell[6] == cell[3] && cell[3] == cell[0] && cell[0] > 0) return true;
if (cell[7] == cell[4] && cell[4] == cell[1] && cell[1] > 0) return true;
if (cell[8] == cell[5] && cell[5] == cell[2] && cell[2] > 0) return true;
if (cell[6] == cell[4] && cell[4] == cell[2] && cell[2] > 0) return true;
if (cell[0] == cell[4] && cell[4] == cell[8] && cell[8] > 0) return true;
}
function CompTurn() {
for (i=0; i<9; i++) if (cell[i] == 0) PutHere = i;
for (i=0; i<3; i++) {
if (cell[0] == cell[1] && cell[2] == 0 && cell[0] == i) PutHere = 2;
if (cell[0] == cell[2] && cell[1] == 0 && cell[0] == i) PutHere = 1;
if (cell[1] == cell[2] && cell[0] == 0 && cell[2] == i) PutHere = 0;
if (cell[3] == cell[4] && cell[5] == 0 && cell[3] == i) PutHere = 5;
if (cell[3] == cell[5] && cell[4] == 0 && cell[3] == i) PutHere = 4;
if (cell[4] == cell[5] && cell[3] == 0 && cell[5] == i) PutHere = 3;
if (cell[6] == cell[7] && cell[8] == 0 && cell[6] == i) PutHere = 8;
if (cell[6] == cell[8] && cell[7] == 0 && cell[6] == i) PutHere = 7;
if (cell[7] == cell[8] && cell[6] == 0 && cell[8] == i) PutHere = 6;
if (cell[6] == cell[3] && cell[0] == 0 && cell[6] == i) PutHere = 0;
if (cell[6] == cell[0] && cell[3] == 0 && cell[6] == i) PutHere = 3;
if (cell[3] == cell[0] && cell[6] == 0 && cell[3] == i) PutHere = 6;
if (cell[7] == cell[4] && cell[1] == 0 && cell[7] == i) PutHere = 1;
if (cell[7] == cell[1] && cell[4] == 0 && cell[7] == i) PutHere = 4;
if (cell[4] == cell[1] && cell[7] == 0 && cell[4] == i) PutHere = 7;
if (cell[8] == cell[5] && cell[2] == 0 && cell[8] == i) PutHere = 2;
if (cell[8] == cell[2] && cell[5] == 0 && cell[8] == i) PutHere = 5;
if (cell[5] == cell[2] && cell[8] == 0 && cell[5] == i) PutHere = 8;
if (cell[6] == cell[4] && cell[2] == 0 && cell[6] == i) PutHere = 2;
if (cell[6] == cell[2] && cell[4] == 0 && cell[6] == i) PutHere = 4;
if (cell[4] == cell[2] && cell[6] == 0 && cell[4] == i) PutHere = 6;
if (cell[0] == cell[4] && cell[8] == 0 && cell[0] == i) PutHere = 8;
if (cell[0] == cell[8] && cell[4] == 0 && cell[0] == i) PutHere = 4;
if (cell[4] == cell[8] && cell[0] == 0 && cell[4] == i) PutHere = 0;
}
Zero(PutHere);
cell[PutHere] = 2;
if (CheckVictory() == true) {
alert("Выиграл JavaScript =).");
GameOver();
}
}
function GameOver() {
for (i=0; i<9; i++) cell[i] = 0;
document.pole0.src = e.src;
document.pole1.src = e.src;
document.pole2.src = e.src;
document.pole3.src = e.src;
document.pole4.src = e.src;
document.pole5.src = e.src;
document.pole6.src = e.src;
document.pole7.src = e.src;
document.pole8.src = e.src;
}
Найдено тут: http://top.asf.ru/Sgames/xo/. В остальном без комментариев, код говорит сам за себя.
+165
<?
function q($q){
return mysql_query($q);
}
function fa($q){
return mysql_fetch_array($q);
}
function nr($q){
return mysql_num_rows($q);
}
function gr($t,$f,$w,$wf,$def){
$r = ($a = mysql_fetch_array(mysql_query("SELECT $f FROM $t WHERE $wf = '$w' LIMIT 1"))) ? $a[$f] : $def ;
return $r;
}
?>
лень творит чудеса
+81
bool b = false;
while (!b) {
// ...
}
−348.2
if (len(filter(lambda path: path == "../stubs", os.sys.path)) == 0):
os.sys.path.insert(0, '../stubs')
Хитрая провека на то, нет ли уже "../stubs" в sys.path.
+79.5
For Each LVRefWarnItem In Me.ListViewRefWarn.ListItems
For Each LVDiagItem In Me.ListViewDiag.ListItems
For Each LVReqdClassItem In Me.ListViewReqdClass.ListItems
For Each LVReqdPayItem In Me.ListViewReqdPay.ListItems
For Each LVReqdSpecItem In Me.ListViewReqdSpec.ListItems
For Each LVReqingSpecItem In Me.ListViewReqingSpec.ListItems
For Each LVSvcItem In Me.ListViewSvc.ListItems
For Each LVReqdContItem In Me.ListViewReqdCont.ListItems
For Each LVReqingContItem In Me.ListViewReqingCont.ListItems
For Each LVReqingClassItem In ListViewReqingClass.ListItems
For Each LVReqingPayItem In ListViewReqingPay.ListItems
For Each LVHPCodesItem In ListViewHPCodes.ListItems
For Each LVHPOptionCodesItem In ListViewHPOptionCodes.ListItems
For Each LVPOSItem In ListViewPOS.ListItems
For Each LVReqdProvIDItem In ListViewReqdProvID.ListItems
For Each LVReqingProvIDItem In ListViewReqingProvID.ListItems
For Each LVAuthTypeItem In ListViewAuthType.ListItems
For Each LVMembCondItem In ListViewMemberCondition.ListItems
TempDe1.InsertRule _
AdvancedRule, "Advanced", Me.TextGroup, Me.CheckAutoApprove.Value, _
CDate(Me.DTPickerFromDt), CDate(Me.DTPickerToDt), ExpDate, _
LVSvcItem.Text, LVSvcItem.ListSubItems(1).Text, LVDiagItem.Text, _
LVDiagItem.ListSubItems(1).Text, IIf(LVSvcItem.ListSubItems.Count = 1, _
"0", LVSvcItem.ListSubItems(LVSvcItem.ListSubItems.Count).Text), _
LVReqdSpecItem.Text, LVReqdSpecItem.ListSubItems(1).Text, _
LVReqdClassItem.Text, LVReqdClassItem.ListSubItems(1).Text, _
LVReqdContItem.Text, LVReqdContItem.ListSubItems(1).Text, _
LVReqdPayItem.Text, LVReqdPayItem.ListSubItems(1).Text, _
LVReqingSpecItem.Text, LVReqingSpecItem.ListSubItems(1).Text,
LVReqingClassItem.Text, LVReqingClassItem.ListSubItems(1).Text, _
LVReqingContItem.Text, LVReqingContItem.ListSubItems(1).Text, _
LVReqingPayItem.Text, LVReqingPayItem.ListSubItems(1).Text, _
LVHPCodesItem.Text, LVHPCodesItem.ListSubItems(1).Text, _
LVPOSItem.Text, LVPOSItem.ListSubItems(1).Text, _
LVReqdProvIDItem.Text, LVReqdProvIDItem.ListSubItems(1).Text, _
LVReqingProvIDItem.Text, LVReqingProvIDItem.ListSubItems(1).Text, _
TextDesc.Text, TextAgeFrom.Text, TextAgeTo.Text, _
LVAuthTypeItem.Text, LVAuthTypeItem.ListSubItems(1).Text, _
LVMembCondItem.Text, LVMembCondItem.ListSubItems(1).Text, _
Me.cboRuleType.SelectedItem.Key, Me.txtRulePriority.Text, _
Int(LVRefWarnItem.Text), Int(LVRefWarnItem.ListSubItems(1).Text), _
LVHPOptionCodesItem.Text, LVHPOptionCodesItem.ListSubItems(1).Text
Next
Next LVAuthTypeItem
Next LVReqingProvIDItem
Next LVReqdProvIDItem
Next LVPOSItem
Next LVHPOptionCodesItem
Next LVHPCodesItem
Next LVReqingPayItem
Next LVReqingClassItem
Next LVReqingContItem
Next LVReqdContItem
Next LVSvcItem
Next LVReqingSpecItem
Next LVReqdSpecItem
Next LVReqdPayItem
Next LVReqdClassItem
Next LVDiagItem
Next LVRefWarnItem
... ооп во всех позах :)
+138.9
[DataContract]
public class MyDataContract {
string lASTNAME = "";
string nAMESUFFIX = "";
string mIDDLENAME = "";
string fIRSTNAME = "";
[DataMember]
public string LASTNAME {
get { return lASTNAME; }
set { lASTNAME = value; }
}
[DataMember]
public string FIRSTNAME {
get { return fIRSTNAME; }
set { fIRSTNAME = value; }
}
[DataMember]
public string MIDDLENAME {
get { return mIDDLENAME; }
set { mIDDLENAME = value; }
}
[DataMember]
public string NAMESUFFIX {
get { return nAMESUFFIX; }
set { nAMESUFFIX = value; }
}
}
Акуенная конвенция именования переменных
+73.2
/*
* когда-нибудь этот код будет смотреть другой программист
* так вот, если ты есть тот самый программист и надеюсь ты хороший программист,
* то если возникнут какие-то недопонятки, извиняй, старался писать код как-можно качественее
* но если несложно напиши мне(--------) если считаешь что код дерьмовый. я постараюсь его отрефакторить и объяснить тебе)
*
* маразм какой-то конечно написал), но мне просто интересно насколько качествен или дерьмов мой код).
* спс
*/
думаю это надо постить на antigovnokod.ru, но к сожалению такого проекта еще нету. поэтому запостил строчки этого хорошего программиста сюда)