pouët.net

Go to bottom

Random line of code thread

category: code [glöplog]
Code:While S!=95 30->G While G!=33 Pxl-Change(G,S G+1->G End S+1->S End
added on the 2018-05-02 16:54:03 by Parzival Parzival
@Parzival: you can try the "IS>(" (and "DS>(") commands, those do the inc/dec and jumping for you, but are faster because of less tokenisation overhead. ("For(" might be a little faster as well, but YMMV.)

(Secondly, you can also abuse the function plotter...)
added on the 2018-05-03 12:55:01 by porocyon porocyon
Code: ; push random lines ld e, 12 .lines ld a, r ; R FOR RANDOM. FUCK YOU ld h, high sintabofs : rlca : ld l, a ld l, [hl] : ld a, [hl] : ld a, r : add d ld d, a : rlca : and 0x3E : push af call dma_stats
added on the 2018-05-04 17:13:44 by wbc\\bz7 wbc\\bz7
@porocyon: I mainly used that method so as to make the code more readable. I can't really use the function plotter as it's part of a loading bar and i hate having to mess with the plotter to get it to work right.

Long story short: i'm a bad coder with a preference of direct plotting. xD
added on the 2018-05-04 19:42:28 by Parzival Parzival
Code:*cPos++ = in.coords[c][l][z][i][xy];

a.k.a. "who needs three dimensions when you can have five for just ten times the headache"
added on the 2018-05-18 13:52:21 by KeyJ KeyJ
Code:XMLNode* node = cascades.FirstChild()->NextSibling()->NextSibling()->FirstChild()->F irstChild()->NextSibling()->NextSibling();
added on the 2018-05-18 17:42:56 by svo svo
Code: PutString(pixel, fonts, string("[") + to_string(mouseCoord.x) + string(",") + to_string(mouseCoord.y) + string("]"), 150, 332, 0x000000, 0xffffff);
added on the 2018-05-18 22:24:18 by rudi rudi
Code: ;; font size based on resolution/screenmode. if less than 5, clip it back to 5. if ($1 == size) { var %size $calc(%dm.screenH / 27) return $iif(%size < 5, 5, %size) }
added on the 2018-05-24 16:20:57 by lynn lynn
Code:static inline const DMC64EncDecOp * fmtGetEncDecOp(const DMC64ImageFormat *fmt, const int index) { // Ooh .. look at that beaauuuutiful deref .. return fmt->encdecOpsRef != NULL ? &(* (fmt->encdecOpsRef))[index] : &fmt->encdecOps[index]; }
added on the 2018-05-24 22:06:57 by ccr ccr
Code:noop $findfile($scriptdir..\gfx\patterns\, *.gif, 0, 0, var %patternList $addtok(%patternList, $gettok($nopath($1-), 1, 46), 32))
added on the 2018-05-26 19:12:42 by lynn lynn
Code:double fsinc = (x != 0.0) ? sin( x*kPi ) * iZero( alpha * sqrt( 1 - x*x*(1.0 / firCenterQuad) ) ) / (izeroAlpha * x * kPi) : 1.0;
added on the 2018-05-26 19:46:59 by jco jco
Code: static const uint8 OPLChannelToOperator[] = { 0, 1, 2, 8, 9, 10, 16, 17, 18 }; if(oplCh < 9) return OPLChannelToOperator[oplCh]; else return OPLChannelToOperator[oplCh - 9] | 0x100;
lol opl
added on the 2018-05-27 01:15:09 by jco jco
Code: ;; for whatever reason, when tiling a buffer to another buffer, "transparency" no longer works. ;; this makes no sense. I've tripple checked that the colours are identical to the ones chosen ;; as transparent colours, to no avail. The above is the old method, commented out. Below this ;; is a workaround that physically caused Alpha C to cringe so hard he nearly vomited. var %patternInverted $dmGetGfx($+(patterns\,%input,_inverted.bmp)) drawsave -b1 @dm.buffer.patternTemp %patternInverted window -c @dm.buffer.patternTemp dmTileTexture %buffer %patternInverted
added on the 2018-05-27 01:44:24 by lynn lynn
Code: const uchar baconLayer = 0; const uchar eggsLayer = 0;
added on the 2018-05-27 10:44:35 by Optimus Optimus
Oh, found a bug by posting this, just realized eggsLayer should be 1 :)
added on the 2018-05-27 10:45:20 by Optimus Optimus

login

Go to top