karpathy/lifejs — explained in plain English
Analysis updated 2026-07-17 · repo last pushed 2012-05-27
Watch virtual creatures evolve survival strategies in real time to teach natural selection without a biology lecture
Tweak mutation rate, creature speed, and food availability to see how the virtual ecosystem's behavior changes
Use the creature AI and canvas simulation as a starting point for NPC behavior in a browser game
| karpathy/lifejs | kunchenguid/lavish-axi | fastify/fastify-schedule | |
|---|---|---|---|
| Stars | 117 | 118 | 119 |
| Language | JavaScript | JavaScript | JavaScript |
| Last pushed | 2012-05-27 | — | 2026-07-01 |
| Maintenance | Dormant | — | Active |
| Setup difficulty | easy | easy | easy |
| Complexity | 2/5 | 1/5 | 2/5 |
| Audience | general | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Runs directly in the browser, a JavaScript port of the older Scriptbots project.
This is a JavaScript-based artificial life simulator that runs directly in your web browser. It creates a digital world where simple virtual creatures evolve and compete over time, similar to how real organisms adapt in nature. You can watch them move around, eat food, reproduce, and struggle for survival on your screen in real time. The simulator works by spawning creatures into a canvas environment (the visual area where the action happens). Each creature has basic behaviors and can sense its surroundings, things like whether food is nearby or if another creature is close. They can move, eat, and breed, and their offspring inherit traits from their parents but with slight random variations. Over many generations, you'll see the creatures get better at surviving in their particular environment, developing strategies like clustering near food sources or avoiding predators. The whole thing is powered by Sylvester, a math library that handles the physics and calculations running behind the scenes. Who would find this useful? Game developers, educators, and curious programmers interested in evolution and AI. Teachers could use it to demonstrate how natural selection works without needing to explain complex biology, students can just watch the creatures adapt in real time. Hobbyists fascinated by artificial intelligence and emergent behavior might enjoy tweaking the parameters to see how different rules create wildly different outcomes. Someone building a game with NPC behavior or exploring what happens when you simulate life under different constraints could also use this as a starting point or inspiration. The main thing to know is that this is a port of an older project called Scriptbots, translated from another language into JavaScript so it can run on the web. You can customize how the simulation works by adjusting various settings, the README points to a list of tweakable parameters if you want to experiment with changing mutation rates, creature speed, or food availability to see how the virtual ecosystem responds.
A browser-based artificial life simulator where simple virtual creatures move, eat, reproduce, and evolve in real time, demonstrating natural selection through emergent behavior.
Mainly JavaScript. The stack also includes JavaScript, Sylvester.js, Canvas.
Dormant — no commits in 2+ years (last push 2012-05-27).
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly general.
This repo across BitVibe Labs
double-check against the repo, no cap.