pouët.net

Random line of code thread

category: code [glöplog]
@ ptr1 * cosα + c1ms2 @-> ptr1
added on the 2021-11-16 19:37:31 by ltipl ltipl
Code:XMLHttpRequest.prototype.__send = XMLHttpRequest.prototype.send; XMLHttpRequest.prototype.send = function ( _data ) { this.__onreadystatechange = this.onreadystatechange; this.onreadystatechange = function () { console.log( "XMLHttpRequest.onreadystatechange" ); console.log( this ); this.__onreadystatechange(); }; this.__send( _data ); };
added on the 2021-11-19 06:59:35 by Salinga Salinga
Code:console.log("ba"+ +"i’ll be gone anyway"+"a")
added on the 2021-11-19 10:03:25 by netro netro
Code:cmp.b #"""",d0
added on the 2021-11-27 19:01:39 by StingRay StingRay
Silly things of why C doesn't have that?

Code: uchar* int myFunction() { return myCharPointer, anInt; }


I know, make it a struct, use tuples or other.
Assembly function would return things in multiple registers. C only 1. Why not upgrade C++ 23?


Second

Code: for (int y = 0; y < 10; ++y) { for (int x = 0; x < 10; ++x) { if (x > 5 && y > 5) break 2; } }


You want to break twice.
Use a goto and see people screeching.
Yeah, put a boolean that you set and check/escape twice. Or rewrite.
Make this loop into a lambda that escapes it self but not the whole function outside.

Finally

Code: int a = 10; int b = 0xABCD; int c = 01234; // octal? int c = 0b101010101010; // doesn't exist


THE low level language and no binary? We have to use defines with hex or bit shifting. When I change flags in hardware and want to put one by one the bits. Someone said make a function that accepts a string and returns back tha value.

But it has octal. Why no binary? Even basic had binary.
added on the 2021-11-28 09:22:34 by Optimonk Optimonk
They make fun of Basic, but modern scripting languages are like a basic.
added on the 2021-11-28 09:25:28 by Optimonk Optimonk
python and basic do not have much in common except the interpreter ;)
added on the 2021-11-28 12:24:09 by NR4 NR4
Code:ld a,$f0 ldh [rNR12],a ldh [rNR22],a ldh [rNR42],a ld a,$80 ldh [rNR14],a ldh [rNR24],a ldh [rNR44],a ld a,$18 ldh [rNR12],a ldh [rNR22],a ldh [rNR42],a
added on the 2021-11-30 03:58:31 by DevEd DevEd
Code:cmp.l (a7)+,a0
added on the 2021-12-11 20:35:55 by StingRay StingRay
Code:move.l $400+$af50,$dff080 ; "thank you" Rob Northen.... just a few hours of my time wasted
added on the 2021-12-27 22:43:06 by StingRay StingRay
guess the instruction set, ed. 2:

Code: mov x, #0xaa mov c, #0 3: dec c mov a, [hl+c] xor a, x call !!0xeffa1 cmp0 c bnz $3b
added on the 2021-12-30 17:00:56 by porocyon porocyon

login