- 1
- 2
- 3
- 4
status.setCounter(new Number(
Number.nullToZero(
status.getCounter()).add(
value.movePointRight(2))));
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+75
status.setCounter(new Number(
Number.nullToZero(
status.getCounter()).add(
value.movePointRight(2))));
Действительно, кому нужна перегрузка операторов?
+12
if(maxbits<3) x = genrand64_int64() & genrand64_int64() & genrand64_int64() & genrand64_int64() & genrand64_int64();
else
{
if(maxbits<6) x = genrand64_int64() & genrand64_int64() & genrand64_int64() & genrand64_int64();
else x = genrand64_int64() & genrand64_int64() & genrand64_int64();
}
+156
var toggle = function(d){
d = doc.createElement('setting');
return function t(e){
if(this.value){
while(this.nextSibling) d.appendChild(this.nextSibling);
}else{
while(d.firstChild) this.parentNode.appendChild(d.firstChild);
}
return t;
}
};
var auto = doc.getElementsByClassName("toggle"), i = auto.length;
while(i--) auto[i].addEventListener("command", toggle().call(auto[i]) , false );
Честно говоря не могу понять толи ещё ничего, а толи пиздец.
Код скрывает или показывает несколько групп настроек расширения фф в зависимости от первой настройки.
+94
function Dist(dx, dy: integer): integer;
begin
//result := trunc(sqrt(sqr(dx)+sqr(dy)));
dx := abs(dx);
dy := abs(dy);
if dx>dy then begin
dy := dy shr 1 - dx shr 3;
if dy >= 0 then result := dx+dy else result := dx;
end else begin
dx := dx shr 1 - dy shr 3;
if dx >= 0 then result := dx+dy else result := dy;
end;
end;
Ещё по теме приближённых расчётов в игровом движке.
+159
try {
//
if(error)1/0;
} catch (e) {
//
}
+125
if (this.Game.GraphicsDevice != null)
{
DrawBaseTile(sb);
}
DrawBaseTile(sb);
Надо больше спать...
+159
if (($("#menu-main").find("li span").is(".active")) && ($("#nav-wrapper").find("nav").is("#children_for_" + $("#menu-main").find("li span.active").parent("li").attr("id")))) {
...
}
...
+152
if (canvas.cuserStatus == "yes") {
this.changeUserContactByHash.pending = true;
this.changeUserContactByHash.doCall();
} else if (canvas.cuserStatus == "no") {
this.changeUserContactByHash.pending = true;
this.changeUserContactByHash.doCall();
}
Написано это на OpenLaszlo, но так как такого языка в выборе нет, то сойдёт и ЖС, главное подсветка и смысл.
+1
class SumClass
{
int A, B;
public:
void Set_A(int A) {this->A = A;}
void Set_B(int B) {this->B = B;}
int Sum() {return A+B;}
}
class MultiSumClass
{
SumClass Sum;
int count;
public:
void Set_A(int A) {Sum.Set_A(A);}
void Set_B(int B) {Sum.Set_B(B);}
void Set_Count(int count) {this->count = count;}
int GetSum() {return Sum->Sum()*count;}
}
void main()
{
MultiSumClass MSC;
MSC.Set_A(5); MSC.Set_B(10);
MSC.Set_Count(2);
cout << MSC.GetSum();
}
Вот зачем ООП нужно
http://www.gamedev.ru/flame/forum/?id=164035
извените за игрстрй
+52
$Qock = mysql_query("SELECT ...");
$Cock = mysql_num_rows($Qock);
Переменная $Cock - это ж надо так назвать!