pouët.net

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
Code:drawtext -r @dm.buffer.glowballs.text.render $calc(%dm.colour.white / 4) $dmTextCenter(a soft shimmer in the darkness, terminal, 26, 320, 180)
added on the 2018-05-29 18:10:02 by lynn lynn
Code:bool EqualEnough(double a, double b) => Math.Abs(a - b) < epsilon;
added on the 2018-06-14 17:34:55 by kb_ kb_
Code:projektbeschreibung_nextPage = GetCompleteProjektbeschreibung_Page2(out projektbeschreibung_nextPage_part2);
added on the 2018-06-14 17:51:29 by keops keops
Code:dc.w "R",.togglexrot-.TAB ; toggle x-rotation (scroller), blessed are the blind
added on the 2018-06-15 10:27:08 by StingRay StingRay
I'm getting really sick of seeing this one everywhere in the codebase:

Code:// Add 0.5 to place on edge of pixel
added on the 2018-06-19 00:54:28 by Guybrush Guybrush
Code:; kludge! for some weird reason it can happen that the level 6 vector ; is trashed on exit, this workaround should do... moveq #($78-$64)/4-1,d7
added on the 2018-06-20 20:09:26 by StingRay StingRay
Code:float t = vk/float(44095); // antilag
added on the 2018-06-28 13:41:21 by wbc\\bz7 wbc\\bz7
Random line of Thread-Code, just choose one yourself from here:
Code: int main() { std::thread first (foo); // spawn new thread that calls foo() std::thread second (bar,0); // spawn new thread that calls bar(0) std::cout << "main, foo and bar now execute concurrently...\n"; // synchronize threads: first.join(); // pauses until first finishes second.join(); // pauses until second finishes std::cout << "foo and bar completed.\n"; return 0; }
Quote:
Code:float t = vk/float(44095); // antilag
this is sooooo wrong
added on the 2018-06-28 23:46:04 by xTr1m xTr1m

login