Sizecoding / Code golf

About

Art of creating very small computer programs which are usually 256 bytes or less in size. (also less common : 512 bytes) The size of these tiny programs is measured by their total size in opcode bytes and are usually presented as an executable binary.

Those programs usually come with many technical tricks and are mostly written in assembly language for a specifically chosen target platform.

Some programs below are programmed with C language and run under Linux with a 32 bits framebuffer setup (fbdev), small amount of assembly is only used for platform dependent setup such as Linux ELF header and framebuffer setup to obtain a minimal drawing framework.

Some programs run on the TIC-80 fantasy computer / virtual machine, those programs (written in JS or LUA) can be ported easily and may be smaller on other systems, a 128 bytes TIC-80 program may be 64 bytes on x86 platform when they use few library functions.

Some programs are 100% x86 assembly, those started as C programs which were shrinked down with handwritten assembly.

Some programs are ARM2 assembly, they were made for RISC OS and works on modern hardware supported by RISC OS (Raspberry PI etc.) but also works on 1987 Acorn hardware !

Most programs produce high resolution images, some are animated in real-time.

Note: The size include OS metadata and platform dependent code to write to the display, Linux programs below are in fact much smaller (about 50 to 70 bytes smaller) if all the OS metadata is ignored.

512 bytes

Twigs - 512 bytes Linux procedural graphics

Twigs (Linux)

Iterated Function System fractals composited together with symmetry. My first codegolfing program which demonstrated that my engraving-like IFS fractals can be reduced down to a small program. It was released at inérciaDemoparty 2020.

Use fixed-point arithmetic, draw with saturated arithmetics using SSE2 instructions and use RDRAND instruction. Binary size is 426 bytes of x86 code.

links: youtube github pouet party code (no OS metadata) image

Agrippa Vanities - 512 bytes TIC-80 intro

Agrippa Vanities (TIC-80)

Released in december at Inércia 2023, started in early 2023 from some star polygon algorithm with thickness.

Theme is a tribute to black metal.

LUA code packed with pakettic.

links: youtube online pouet

256 bytes

TrueSpace - 256 bytes Linux procedural graphics

TrueSpace (Linux)

Integer circle algorithm. My first 256 bytes procedural graphics intro which just show some background stars and vertical bars. Did not have time to do more. It was released at Lovebyte 2021.

It only use integers and simple arithmetic operations but does not draw with saturated arithmetics thus the image accumulate noise.

links: youtube github pouet

Flagship - 256 bytes Linux framebuffer procedural graphics

Flagship (Linux)

Integer circle algorithm with symmetry and saturated arithmetic. Improved version. This show some kind of Mandelbrot like fractal shadow at the center. It was released at Revision demoparty 2021.

It only use integers and simple arithmetic operations (add, sub, AND, shift), SIMD instructions for saturated arithmetic.

links: youtube github pouet

Campers - 256 bytes Linux procedural graphics

Campers (Linux)

Integer circle algorithm with symmetry and saturated arithmetic. A variation of Flagship. The symmetry create some kind of face (animal ?) at the center. It was released at Outline Online demoparty 2021.

It only use integers and simple arithmetic operations (add, sub, AND, shift), SIMD instructions for saturated arithmetic.

links: youtube pouet

Calculating Space - 256 bytes Linux procedural graphics

Calculating Space (Linux)

Integer circle algorithm and saturated arithmetic. The many improvements from previous intros allowed more colors variation. It show abstract lines with blurry background. It was released at Outline Online demoparty 2021.

It only use integers and simple arithmetic operations (add, sub, AND, shift), SIMD instructions for saturated arithmetic.

links: youtube pouet

Apollonian - 256 bytes Linux procedural graphics

Apollonian (Linux)

Integer circle algorithm. The many improvements in size from the previous intros allowed more colors variation. It show some kind of Apollonian gasket fractal patterns. It was released at Shadow demoparty 2021.

It only use integers and simple arithmetic operations (add, sub, AND, shift), SIMD instructions for saturated arithmetic.

links: youtube pouet

Mmrnmhrm - 256 bytes Linux framebuffer procedural graphics

Mmrnmhrm (Linux)

Blend of feedback and automata. My first procedural graphics with handwritten x86 assembly, it use SSE2 and AVX2 instructions. 51 bytes of ELF headers and 205 bytes of code. It was released at Lovebyte demoparty 2022.

Main seed shape (arcs) is made with the integer circle algorithm, it use SIMD instructions for saturated arithmetic.

links: youtube pouet

Mmrnmhrm - 256 bytes TIC-80 intro

Chmmr (TIC-80)

Result of playing with harmonic oscillators which produce some kind of autonomous pixels art with euler spiral patterns. It was released at Flash party 2021.

Has simple sound. The code is JavaScript (which use special functions provided by the TIC-80 such as 'poke' and 'cls'). Both binary and code is 256 bytes.

links: youtube online pouet

Eclipse - 256 bytes TIC-80 procedural graphics

Eclipse (TIC-80)

Procedural graphics for CAFePARTY 2022.

Packed with tic-tool.

Combination of ellipse / circle / pix calls. Lua code.

links: youtube online pouet

From below - 256 bytes TIC-80 procedural graphics

From below (TIC-80)

Procedural graphics for LOVEBYTE 2023.

Packed with pakettic.

Layered minsky circle. Lua code.

links: online pouet

Mrityuloka - 256 bytes TIC-80 procedural graphics

Mrityuloka (TIC-80)

Procedural graphics for LOVEBYTE 2023.

Packed with pakettic.

Layered ellipses, mostly. Lua code.

links: online pouet

The light - 256 bytes Linux framebuffer procedural graphics

The light (Linux)

Handwritten x86 assembly, use the stack heavily and AVX/AVX2 instructions. It was released at Outline 2023.

AVX2 instruction vpsravd is used to shift parameters in batch. 51 bytes of ELF headers and 205 bytes of code.

3 layers minsky circle based algorithm.

links: youtube pouet extra (2 layers)

Acetaminophen - 256 bytes real-time intro for RISC OS

Acetaminophen (RISC OS / RPI Zero / Acorn Archimedes)

Handwritten ARM2 assembly, compatible with 1987 hardware up to modern ones. It was released at @party 2023.

Real-time Moiré pattern effect. Archimedes version is slightly different for speed.

Minsky circle based algorithm for the animation and circles.

links: pouet youtube (RPI Zero) youtube (Archimedes)

Moirisc - 256 bytes real-time intro for RISC OS

Moirisc (RISC OS / RPI Zero / Acorn Archimedes)

Handwritten ARM2 assembly, compatible with 1987 hardware up to modern ones. It was released at Nova 2023.

Real-time Moiré pattern effect with precalc buffers.

Minsky circle based algorithm for the animation.

links: pouet youtube

Halite - 256 bytes procedural graphics for DOS, 386+

Halite (DOS, 386+)

Handwritten x86 assembly, all integers. It was released at LOVEBYTE 2024.

Mode 13h (VGA), 320x200 procedural graphics, may works with minor adaptation on 1982 CPU (80186+).

Isometric octree-like cube with drop shadow and wavy gradient.

links: pouet youtube

128 bytes

QuasiSpace - 128 bytes Linux framebuffer intro

QuasiSpace (Linux)

Integer circle algorithm. The many improvements in size from the previous intros allowed me to reach 128 bytes. It show some kind of cheese / craters fractal patterns. It was released at Outline Online demoparty 2021.

Integers and simple arithmetic operations but does not draw with saturated arithmetics thus the image accumulate noise.

links: youtube pouet

Crimson - 128 bytes Linux procedural graphics / intro

Crimson (Linux)

Integer circle algorithm. Port of one of my procedural graphics sketch. Handwritten x86 assembly, 50 bytes of ELF headers and 72 bytes of graphics code. It was released at Lovebyte demoparty 2022.

Integers and simple arithmetic operations but does not draw with saturated arithmetics thus the image accumulate noise.

links: youtube

HyperSpace - 128 bytes TIC-80 intro

HyperSpace (TIC-80)

Integer Circle algorithm. One of the idea was to do sounds with structure and variations. It is simple enough to reach 64 byte (without sounds probably) on other platforms like DOS. It was released at Lovebyte Battlegrounds 2021.

The code is LUA and is 157 characters, final binary is 128b and was packed with pactic.

links: youtube online pouet

64 bytes

Zeta - 64 bytes Linux intro

Zeta (Linux)

XOR / logical patterns. Handwritten x86 assembly, Technically not a 64 bytes but the party didn't count the OS metadata. The binary is 50 bytes of ELF headers and 64 bytes of graphics code. The first iteration was greyscale and patterns focused, this one was chosen because it remind me of the sea. It was released at Lovebyte demoparty 2021.

Integers and simple arithmetic operations.

links: youtube

Links


back

11/02/2024