- 1
- 2
- 3
- 4
- 5
- 6
<script>
var x = [];
var y = [];
x = [<?php foreach ($chart as $word => $f) echo "'$word', " ?>];
y = [<?php foreach ($chart as $f) echo "$f, " ?>];
</script>
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+2
<script>
var x = [];
var y = [];
x = [<?php foreach ($chart as $word => $f) echo "'$word', " ?>];
y = [<?php foreach ($chart as $f) echo "$f, " ?>];
</script>
JS
+4
if(((player[i].targetanimation!=getupfrombackanim&&player[i].targetanimation!=getupfromfrontanim)||player[i].skeleton.free)&&((player[k].targetanimation!=getupfrombackanim&&player[k].targetanimation!=getupfromfrontanim)||player[k].skeleton.free))
if(((((findLengthfast(&rotatetarget)>150&&(i!=0&&k!=0))||(findLengthfast(&rotatetarget)>50&&player[0].rabbitkickragdoll/*currentanimation==rabbitkickanim*/&&(i==0||k==0)))&&normaldotproduct(rotatetarget,player[k].coords-player[i].coords)>0)&&((i==0||k==0)||((player[i].skeleton.oldfree==1&&k!=0&&animation[player[k].currentanimation].attack==neutral)||(player[k].skeleton.oldfree==1&&i!=0&&animation[player[i].currentanimation].attack==neutral)||(player[i].isFlip()&&!player[i].skeleton.oldfree&&(i==0||k==0))||(player[k].isFlip()&&!player[k].skeleton.oldfree&&(i==0||k==0))||(i==0||k==0))))||((player[i].targetanimation==jumpupanim||player[i].targetanimation==jumpdownanim||player[i].isFlip())&&(player[k].targetanimation==jumpupanim||player[k].targetanimation==jumpdownanim||player[k].isFlip())&&(i==0||k==0)&&(!player[i].skeleton.oldfree&&!player[k].skeleton.oldfree))){
//If hit by body
if((i!=0||player[i].skeleton.free)&&(k!=0||player[k].skeleton.free)||(animation[player[i].targetanimation].height==highheight&&animation[player[k].targetanimation].height==highheight)){
static float gLoc[3];
// ...
Не могу не запостить. Кажется, это самый длинный говнокод, что я видел.
По мотиву #20073, из http://hg.icculus.org/icculus/lugaru/file/97b303e79826/Source/GameTick.cpp .
PS, на всякий случай поставлю C++ - где-то в недрах второй строчки он наверняка есть.
+6
for(int i = 0; i < codes.size(); ++i) {
switch(i) {
case 0: ret.code0 = codes[i]; break;
case 1: ret.code1 = codes[i]; break;
case 2: ret.code2 = codes[i]; break;
case 3: ret.code3 = codes[i]; break;
case 4: ret.code4 = codes[i]; break;
case 5: ret.code5 = codes[i]; break;
}
}
А всё потому, что ret.code[0-5] - битовые поля. Эх.
+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();
}
}
}