An open API service indexing awesome lists of open source software.

https://github.com/px7nn/random-walk

Multiple colored lines start from the center of the screen and perform a bounded random walk, creating evolving abstract patterns.
https://github.com/px7nn/random-walk

random-walk random-walk-problems

Last synced: about 2 months ago
JSON representation

Multiple colored lines start from the center of the screen and perform a bounded random walk, creating evolving abstract patterns.

Awesome Lists containing this project

README

          

# 🎨 SDL3 Random Walk Lines
A simple generative art experiment built with **SDL3** in C.
Multiple colored lines start from the center of the screen and perform a bounded random walk, creating evolving abstract patterns.

## 📸 Preview
* Independent lines
* Random colors
* Bounded movement (no going outside window)
* Persistent drawing using a texture as canvas

### Screenshots
image
image

## 🧠 How It Works

Each frame:
1. A random direction is chosen (X or Y axis)
2. The line moves either positive or negative
3. Boundary checks prevent leaving the screen
4. A line is drawn from old position to new position
5. Drawing accumulates over time on a texture

This creates a **generative art random-walk effect**.

## 📁 Project Structure
```
random-walk/

├── SDL/ # SDL3 headers and library files
├── src/ # Source files (main.c)
├── .gitignore
├── Makefile # Build configuration (MinGW)
└── SDL3.dll # Required runtime DLL
```

## 🛠 Requirements

* **MinGW (GCC)** – for compiling the project
* **SDL3 development library** – included inside this repository (SDL/ folder)

## 🔨 Build

From project root:
```
mingw32-make
```
Or manually:
```
gcc src/main.c -ISDL/include -LSDL/lib -lmingw32 -lSDL3 -o main.exe
```

## ▶ Run
Make sure `SDL3.dll` is in the same directory as `main.exe`, then:
```
./main.exe
```

## 💡 Author
Built as part of learning **SDL3 graphics programming in C**.