Sierpinski fractal in 28 bytes
Some ages ago there was a competition on #nlcoders doing the Sierpiński triangle in as less bytes as possible.
Of course, I was beaten very bad. Shorter versions exists (22 bytes, 19 bytes, even 10 bytes!). Some using rule 90.
; 28 byte Sierpinski-fractal Joris Zwart (C) 1998.model tiny.codeorg 100hstart:mov al,13hx:cwdy:test cl,dljne skipint 10hmov ah,0chskip:inc dljns yinc cljns xcbwint 16hmov ax,3int 10hretend start
This assembles down to these 28 bytes:
b0 13 99 84 ca 75 04 cd 10 b4 0c fe c2 79 f4 fe c1 79 ef 98 cd 16 b8 03 00 cd 10 c3
Which maps to this list file:
0000: b0 13 mov al,0x13
0002: 99 cwd
0003: 84 ca test dl,cl
0005: 75 04 jne 0x000b
0007: cd 10 int 0x10
0009: b4 0c mov ah,0xc
000b: fe c2 inc dl
000d: 79 f4 jns 0x0003
000f: fe c1 inc cl
0011: 79 ef jns 0x0002
0013: 98 cbw
0014: cd 16 int 0x16
0016: b8 03 00 mov ax,3
0019: cd 10 int 0x10
001b: c3 ret
Pseudocode
For the assembly-impaired here is the pseudocode:
FOR X = 0 TO 127FOR Y = 0 TO 127IF X AND Y THEN PLOT X, YNEXT YNEXT X


