- 1
https://github.com/pascalabcnet/pascalabcnet
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+6
https://github.com/pascalabcnet/pascalabcnet
ШОК! Говном компилируется говно. Это рекорд
+5
//Collisions
static float collisionradius;
if(numplayers>1)
for(k=0;k<numplayers;k++){
for(i=k;i<numplayers;i++){
if(i==k)i++;
if(i<numplayers)
if((animation[player[i].targetanimation].attack!=reversed&&animation[player[i].targetanimation].attack!=reversal&&animation[player[k].targetanimation].attack!=reversed&&animation[player[k].targetanimation].attack!=reversal)||(i!=0&&k!=0))
if((animation[player[i].currentanimation].attack!=reversed&&animation[player[i].currentanimation].attack!=reversal&&animation[player[k].currentanimation].attack!=reversed&&animation[player[k].currentanimation].attack!=reversal)||(i!=0&&k!=0))
if(player[i].howactive<=typesleeping&&player[k].howactive<=typesleeping)
if(player[i].howactive!=typesittingwall&&player[k].howactive!=typesittingwall)
if(i!=k&&player[i].whichpatchx==player[k].whichpatchx&&player[i].whichpatchz==player[k].whichpatchz&&player[k].skeleton.oldfree==player[k].skeleton.free&&player[i].skeleton.oldfree==player[i].skeleton.free&&player[i].targetanimation!=climbanim&&player[i].targetanimation!=hanganim&&player[k].targetanimation!=climbanim&&player[k].targetanimation!=hanganim)
if(player[i].coords.y>player[k].coords.y-3)
if(player[i].coords.y<player[k].coords.y+3)
if(player[i].coords.x>player[k].coords.x-3)
if(player[i].coords.x<player[k].coords.x+3)
if(player[i].coords.z>player[k].coords.z-3)
if(player[i].coords.z<player[k].coords.z+3){
if(findDistancefast(&player[i].coords,&player[k].coords)<3*((player[i].scale+player[k].scale)*2.5)*((player[i].scale+player[k].scale)*2.5)){
if(player[i].onfire||player[k].onfire){
if(!player[i].onfire)player[i].CatchFire();
if(!player[k].onfire)player[k].CatchFire();
}
}
...
http://hg.icculus.org/icculus/lugaru/file/97b303e79826/Source/GameTick.cpp#l7276
+9
#define GetLastError rand /* optimize API work */
#define struct union /* saves memory */
#define while if /* saves cpu time */
+4
/*не знаю, почему на массиве не сработал concat()*/
function arrPusher (arr) {
_.forEach(arr, function (i) {
saveParams.push(i);
});
}
−1
handleNewConfigRuleLoaded: function(
this.handleConfigRuleLoaded0({rule: event.configRule}, true, false);
},
handleConfigRuleLoaded: function(event) {
this.handleConfigRuleLoaded0(event.configRule, false, false);
},
Старый добрый бэкбон и не знания карринга
0
$.get( '/scripts/ajax/popup/add_to_favorite.php', { id: productID, ajax_call: 'Y' }, function ( data ) {
data = JSON.parse( data );
$.getJSON
http://www.sapato.ru/js/ajax/widgets/baseAjaxes.js?bust=208
+4
public class tcMoveDirection
{
public enum tcDirection { R, L, N };
static public tcDirection fromstring(string expression)
{
switch (expression)
{
case "R":
return tcDirection.R;
case "L":
return tcDirection.L;
case "N":
return tcDirection.N;
default: throw new InvalidCastException();
}
}
}
+6
if (selectedGroup == null)
return null;
return selectedGroup;
зачем if то?
0
using Microsoft.VisualBasic.CompilerServices;
using System;
namespace ConsoleApplication2
{
[StandardModule]
internal sealed class Module1
{
[STAThread]
public static void Main()
{
label_0:
int num1;
int num2;
try
{
ProjectData.ClearProjectError();
num1 = 1;
label_1:
int num3 = 2;
Test.TTT();
goto label_8;
label_3:
num2 = num3;
switch (num1)
{
case 1:
int num4 = num2 + 1;
num2 = 0;
switch (num4)
{
case 1:
goto label_0;
case 2:
goto label_1;
case 3:
case 4:
goto label_8;
}
}
}
catch (Exception ex) when (ex is Exception & (uint) num1 > 0U & num2 == 0)
{
ProjectData.SetProjectError(ex);
goto label_3;
}
throw ProjectData.CreateProjectError(-2146828237);
label_8:
if (num2 == 0)
return;
ProjectData.ClearProjectError();
}
}
}
Вот какая жуть получилась при декомпиляции старого доброго On Error Resume Next из VB.
Исходный код:
Sub Main()
On Error Resume Next
TTT() 'определен в модуле Test
Exit Sub
End Sub
+4
string TRASETXT::trace(string &a // получаемая строка )
{
string b; // возвращаемая строка
stringstream s; // строковый поток
// переводит в втооом словосочетании все большие буквы в маленькие
for (unsigned int i = 0; i < a.size(); i++) // а - получаемая строка
{
int key = a[i];
if ((key <= -33) && (key >= -64)) // от А до Я
key += 32;
if (key == -88) // только буква Ё
key = -72;
if ((key >= 65) && (key <= 90)) // от A до Z
key += 32;
s << (char)key;
}
getline(s, b); // получаем строку только из маленьких букв во временную переменную
s.clear(); // очищаем поток
return b;
}
Увидел в курсаче у чувака, лучший метод преобразования строки в lowercase, везде буду использовать теперь и вам рекомендую