Random line of code thread
category: code [glöplog]
POKE 56334, PEEK(56334) AND 254
lda #<($10 | (checkchars / $0400))
;mknormal,yyy,timey,refperiod=[1881,1940]
;
; Apply a VERY ARTIFICAL correction for decline!!
;
yrloc=[1400,findgen(19)*5.+1904]
valadj=[0.,0.,0.,0.,0.,-0.1,-0.25,-0.3,0.,-0.1,0.3,0.8,1.2,1.7,2.5,2.6,2.6,$
2.6,2.6,2.6]*0.75 ; fudge factor
(...)
;
; APPLY ARTIFICIAL CORRECTION
;
yearlyadj=interpol(valadj,yrloc,x)
densall=densall+yearlyadj
;
; Apply a VERY ARTIFICAL correction for decline!!
;
yrloc=[1400,findgen(19)*5.+1904]
valadj=[0.,0.,0.,0.,0.,-0.1,-0.25,-0.3,0.,-0.1,0.3,0.8,1.2,1.7,2.5,2.6,2.6,$
2.6,2.6,2.6]*0.75 ; fudge factor
(...)
;
; APPLY ARTIFICIAL CORRECTION
;
yearlyadj=interpol(valadj,yrloc,x)
densall=densall+yearlyadj
Code:
$pointer =& self::$dstMatrix[self::$srcTables[$i]][self::$dstTables[self::$srcTables[$i]][$k]];
...yea ... no democoding ATM :(
Quote:
for(int i=start; i<start+amount; i++) {
tempPos=i-start;
if(creeps[nextAvailableCreep]==null) {
creeps[nextAvailableCreep]=new Creep(type, difficulty, nextAvailableCreep);
}
else
creeps[nextAvailableCreep].reset(type, difficulty, nextAvailableCreep);
creeps[nextAvailableCreep].currentPath=path[i%2];
creeps[nextAvailableCreep].posFixedX=(((int[])path[0].elementAt(path[0].size()-1))[0]*tileHeight+(tileHeight>>1)-((tempPos+1)*tileHeight))<<8;
creeps[nextAvailableCreep].posFixedY=(((int[])path[0].elementAt(path[0].size()-1))[1]*tileHeight+(tileHeight>>1))<<8;
creepGroups[currentCreepGroup].addElement(creeps[nextAvailableCreep]);
nextAvailableCreep++;
nextAvailableCreep%=creeps.length;
livingCreeps++;
}
//
// gs_awScreen is assumed to be 256 x 192 x 16-bpp (RGB555) which
// is the screen res of the nintendo DSi.... which is what I might be coding
// on these days! :)
// gs_awScreen is assumed to be 256 x 192 x 16-bpp (RGB555) which
// is the screen res of the nintendo DSi.... which is what I might be coding
// on these days! :)
Code:
void DrawRect(s32 nX1, s32 nY1, s32 nX2, s32 nY2, u16 wColor)
{
u16* pwDest = gs_awScreen;
//
// clip, swap, dwaaaaaappp poopadaaap!
if (nX1 > nX2)
{
Swap32(&nX1, &nX2);
}
if (nY1 > nY2)
{
Swap32(&nY1, &nY2);
}
nX1 = MAX(0, nX1);
nY1 = MAX(0, nY1);
nX2 = MIN(255, nX2);
nY2 = MIN(191, nY2);
//
// render horizontals
u16* pwDest1 = pwDest + (nY1 << 8) + nX1;
u16* pwDest2 = pwDest + (nY2 << 8) + nX1;
s32 nCount = nX2 - nX1;
while (nCount--)
{
*pwDest1++ = wColor;
*pwDest2++ = wColor;
}
//
// render verticals
pwDest1 = pwDest + (nY1 << 8) + nX1;
pwDest2 = pwDest + (nY1 << 8) + nX2;
nCount = nY2 - nY1;
while (nCount--)
{
*pwDest1 = wColor;
*pwDest2 = wColor;
pwDest1 += 256;
pwDest2 += 256;
}
}
Code:
move.w #COOKI,$40(a6)
I prefer to stick to the topic
switch (a[i].getActionType()) {
StateContainer::AT_INSERT:
//ok. look if this is a double insertion
break;
}
StateContainer::AT_INSERT:
//ok. look if this is a double insertion
break;
}
Reminds me of this abomination:
Code:
switch (foo) {
case A:
doit();
break;
case B:
doit();
break;
case C:
dosomethingelse();
break;
case D:
doit();
break;
default:
break;
}
Code:
void (*FunctionArray[4])() = {&doit,&doit,&dosomethingelse,&doit}; (*FunctionArray[foo])();
//assuming "case" A,B,C,D consecutive
Code:
lea (CLIP_YMAX).w,a1 ; meh!
Dunno which one is worse...
Quote:
You forgot the most interesting part: Code:void (*FunctionArray[4])() = {&doit,&doit,&dosomethingelse,&doit}; (*FunctionArray[foo])(); //assuming "case" A,B,C,D consecutive
Code:
default: break;
Code:
If IsNumeric(SolveEquation(sParamLine)) Then Throw New Exception("Line " & iLine & ": pop <imm> is unsupported")
Code:
virtual getInfoString() {
return "64-style snaredrum using (pitch-independent) timed loops";
}
(only 3 more dayz until the real coding recontinues :) )
Code:
hPutStrLn stderr "fuck everything"
unsafe
{
for (int y = 0; y < bmData.Height; y++)
{
byte* ps = (byte*)bmData.Scan0.ToPointer() + bmData.Stride*y;
byte* pd = (byte*)gs.InternalData.ToPointer() + pitch*y;
for (int x = 0; x < bmData.Width; x++)
{
*pd = *ps;
pd++;
ps++;
*pd = *ps;
pd++;
ps++;
*pd = *ps;
pd++;
ps++;
*pd = 0;
pd++;
}
}
}
And fuck you, microsoft.
{
for (int y = 0; y < bmData.Height; y++)
{
byte* ps = (byte*)bmData.Scan0.ToPointer() + bmData.Stride*y;
byte* pd = (byte*)gs.InternalData.ToPointer() + pitch*y;
for (int x = 0; x < bmData.Width; x++)
{
*pd = *ps;
pd++;
ps++;
*pd = *ps;
pd++;
ps++;
*pd = *ps;
pd++;
ps++;
*pd = 0;
pd++;
}
}
}
And fuck you, microsoft.
Code:
moveq #-$80,d2 ; ze pickzel
Code:
moveq #32-1,d6 ; Whole Wave !
Code:
$encSkip = self::convertLanguageEntities(self::$dstData[$tPtr][$k]['lang_id'],$s);
...work... *yawn*
pan: doesn't the x86 have hardware (index registers) designed to work with arrays? the optimization guides I read from AMD suggest avoiding heavy use of pointer arithmetic
void tiredeness()
{
int quarashee = 1;
for (int i=0; i<gamaton; i++)
phdaton(quarashee * sapila);
endcli(jump);
}
{
int quarashee = 1;
for (int i=0; i<gamaton; i++)
phdaton(quarashee * sapila);
endcli(jump);
}
for (int x = 31; x != -1; x--) { outp += (((uint)1 << x) & input) == ((uint)1 << x) ? "|" : "-"; if ((x % 8) == 0 ) { outp += " "; }; }
Code:
float random(int x) {
int s = 71 * x; s = s * 8192 ^ s;
return 1.0 - ((s*(s*s*15731+789221)+1376312589)&0x7fffffff)/1073741824.0;
}
Code:
short rnd(int * seed) {
return ((*seed = *seed * 214013L + 2531011L) >> 16) & 0x7fff;
}