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.
- Host: GitHub
- URL: https://github.com/px7nn/random-walk
- Owner: px7nn
- Created: 2026-02-15T18:32:00.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-02-28T13:17:18.000Z (5 months ago)
- Last Synced: 2026-02-28T17:01:50.452Z (5 months ago)
- Topics: random-walk, random-walk-problems
- Language: C
- Homepage:
- Size: 2.61 MB
- Stars: 7
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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

## 🧠 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**.