Follow

I've wanted to learn (more) C for a while and @neauoire's growing collection of small SDL based tools gave me the final push.

Not exactly what I was going for but still pretty

· · Web · 2 · 7 · 26

Always remember to rename variables everywhere they are used...

Show thread

Implemented a drag-and-drop rule editor, similar to the one in "Desert of the Real".

Here I'm dragging patterns and references to rules from the top menu into slots of the first rules.

Each rule has slots for each quadrant and one fallback pattern (on the left) that's used when the squares get too small.

Show thread

Found and imported bitmap files of all the default fill patterns in HyperCard

Show thread

The remaining space on the left had the perfect size to fit in four more rules and now there are hotkeys to invert the colors and to change the rendering resolution.

Show thread

Back to square one, I removed fill patterns because they don't work well when zooming the image.

Combining editor and drawing area was confusing, now the color/rule selector is drawn on top of the quadrant that was clicked in the editor.

Show thread

@neauoire @l3kn
WoW
I really want to learn about it in C. Any source code?
I tried Sierpinski's triangle for genetic signature in python
mamot.fr/@XavCC/99943951669962

and failed
mamot.fr/@XavCC/10380464164466

@XavCC

You can find @neauoire's tools at git.sr.ht/~rabbits/

I put up my code here: git.sr.ht/~l3kn/quad

There are many ways of drawing a Sierpinski triangle, I'm using a technique I call "quadtree grammars".

Let me know if you run into any problems

@neauoire I couldn't have done it without your code as a starting point, especially the drag-and-drop part.

You can clone it from git.sr.ht/~l3kn/quad and run it with `make`

Sign in to participate in the conversation
Merveilles

Merveilles is a community project aimed at the establishment of new ways of speaking, seeing and organizing information — A culture that seeks augmentation through the arts of engineering and design. A warm welcome to any like-minded people who feel these ideals resonate with them.