Program simulating particles' rules of attraction.
It's heavily inspired by hunar4321's life_code (it started as a port of his javascript code).
https://evolution.berkeley.edu/the-history-of-evolutionary-thought/1900-to-present/endosymbiosis-lynn-margulis/ https://www.ventrella.com/Clusters/
500 particles of each color:
1000 particles of each color:
Different amounts of each color of particles:
- 100 red particles
- 1500 green particles
- 500 blue particles
- 1200 yellow particles
Other random results:
- User Interface: changing rules live
- User Interface: adding/removing new types (colors) of particles
- User Interface: rules import/export
- computation parallelization
- rule mutations
- optimalizations :v (always ongoing)
Run the program using go run
command:
go run cmd/particlelifesim/main.go
simulation visualization (bad performance tho)
Compile the program to webasm and run a http server:
GOOS=js GOARCH=wasm go build -o static/main.wasm cmd/particlelifesim/main.go
python3 -m http.server --cgi 8080 --directory static/
or run the program using wasmserve
go install github.com/hajimehoshi/wasmserve@latest
wasmserve ./cmd/particlelifesim/