Screenshot of Small things

Code snippets from my old site: some might actually be useful, some interesting, others really not. Mostly C with SDL.

Elasto

Elasto

A simple physics simulation of a mesh of masses connected by springs. Drag the masses with the mouse; the four corners stay in place. elasto.c, GNU GPL v2.

elasto nbx nby lx ly k m frot

sdlharmo

sdlharmo

Change in real time the harmonics of a constant-pitch sound, to explore the different timbres that result: a basic oscillator for the fundamental, harmonics derived from it, each weighted by a slider. sdlharmo.c, public domain.

Clifford attractor

Clifford attractor

Another Clifford attractor

My attempt to reproduce Paul Bourke’s images. attr.c, using Paul Bourke’s library for the image output. Public domain.

genepic

genepic

Inspired by the evolution of Mona Lisa: approximating a picture with polygons, by steepest slope and with a genetic algorithm. Doesn’t work too well. Public domain.

Ortho

Ortho

A 3D “engine” written from scratch, just for the fun of it: an orthographic camera, points and lines, a z-buffer. The demo shows random lines in a box that you can rotate with the mouse. Ortho.tar.gz, GNU GPL v3.

360

360

A sphere map viewer written from scratch, no 3D engine. Pretty slow too… 360.c, GNU GPL v3.

soli

A Lua script that models the card game of solitaire, and an artificial “intelligence” that plays as I would. It plays many games and counts the ratio of successes. soli2.lua, public domain.

Network thingies

  • TinyChat: a peer-to-peer chatting toy. Public domain.
  • echo: a simple multi-user echo server in Lua. GNU GPL v3.
  • resolve.c: a very basic domain name resolution utility. Public domain.

Free trees

A tree

A script to generate all free trees up to a certain size, as SVG images. It grew into A bunch of dots.