Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
A simple program to simulate artificial life using attraction/reuplsion forces between many particles
| Date | Stars |
|---|---|
| 2026-07-24 | 3344 |
| 2026-07-25 | 3344 |
| 2026-07-28 | 3344 |
| 2026-07-30 | 3344 |
| 2026-08-06 | 3344 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day


# Particle Life Simulation
A simple program to simulate primitive Artificial Life using simple rules of attraction or repulsion among atom-like particles, producing complex self-organzing life-like patterns. Excluding the GUI elements, the code is less than a page. The video tutorial and walkthrough are available below.
Learn More Here (YouTube video tutorial):
-----------------------------------------------
https://youtu.be/0Kx4Y9TVMGg
Online Demo (JavaScript version):
-------------
Click here for a live demo (JavaScript):
- 2d - https://hunar4321.github.io/particle-life/particle_life.html
- 3d - https://hunar4321.github.io/particle-life/particle_life_3d.html
Interface (C++ version)
--------------------------------------------------------

Example Results
--------------------------------------------------------

Some Interesting Patterns to Reproduce:
-------------------------------------
You do not need to be exact with the parameters to reproduce these patterns. The best way to get interesting patterns is to first try random parameter explorations, once you find an interesting pattern, try fine-tuning it gradually. To avoid becoming stuck at a local maximum, you can make some occasional big parameter jumps. In this way interesting and different patterns shall keep poping up.

To use:
-------------
Download this repo. unzip the file then go to /particle_life/bin/ folder and click on particle_life.exe
Code:
----------------
The source code is available in C++, JavaScript, and Python.
Watch this YouTube video for a walkthrough tutorial: https://youtu.be/0Kx4Y9TVMGg
If you would like to contribute to the C++ program, the core algorithm is the first 100 lines of code at: "/particle_life/src/ofApp.cpp". The rest are GUI components and rendering controls which are provided by the openFrameworks library an opensource and easy-to-use image rendering library.
To start, download this repository then download openFrameworks library from here: https://openframeworks.cc/. Use openFramework's projectGenerator and import /particle_life/ folder to the project.
Alternatively, generate a new openFramework project and add ofxGui. Once the project files are generated replace the /src/ folder with the one provided here.
You can now compile the C++ code on your machine.
The JavaScript code is as simple as this:
-------------------------------------
Also, look at the particle_life.html file for a more optimized version - thanks to those who have contributed.
```html
<canvas id="life" width="500" height="500"></canvas>
<script>
//Hunar Ahmad @ brainxyz
m = document.getElementById("life").getContext("2d");
draw = (x, y, c, s) => {
m.fillStyle = c;
m.fillRect(x, y, s, s);
};
atoms = [];
atom = (x, y, c) => {
return { x: x, y: y, vx: 0, vy: 0, color: c };
};
random = () => {
return Math.random() * 400 + 50;
};
create = (number, color) => {
group = [];
for (let i = 0; i < number; i++) {
group.push(atom(random(), random(), color));
atoms.push(group[i]);
}
return group;
};
rule = (atoms1, atoms2, g) => {
for (let i = 0; i < atoms1.length; i++) {
fx = 0;
fy = 0;
for (let j = 0; j < atoms2.length; j++) {
a = atoms1[i];
b = atoms2[j];
dx = a.x - b.x;
dy = a.y - b.y;
d = Math.sqrt(dx * dx + dy * dy);
if (d > 0 && d < 80) {
F = (g * 1) / d;
fx += F * dx;
fy += F * dy;
}
}
a.vx = (a.vx + fx) * 0.5;
a.vy = (a.vy + fy) * 0.5;
a.x += a.vx;
a.y += a.vy;
if (a.x <= 0 || a.x >= 500) { a.vx *= -1; }
if (a.y <= 0 || a.y >= 500) { a.vy *= -1; }
}
};
yellow = create(200, "yellow");
red = create(200,Excerpt of 7,842 characters
Read on GitHubHunar Ahmad
139
114
23
skal · Google · France
12
11
3
2
2
1
Dominik Kruczek
1
1
Jilly Taboga
1
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:ea0950243ad0bcc3, topic:educational, readme:tutorial
matched fp:ea0950243ad0bcc3, topic:generative-art
matched fp:ea0950243ad0bcc3, topic:simulation