https://github.com/toruniina/miniascape-rs
Run your cellular automaton
https://github.com/toruniina/miniascape-rs
cellular-automata lifegame wasm wireworld
Last synced: 6 months ago
JSON representation
Run your cellular automaton
- Host: GitHub
- URL: https://github.com/toruniina/miniascape-rs
- Owner: ToruNiina
- Created: 2022-07-17T10:45:50.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-07T15:10:17.000Z (about 3 years ago)
- Last Synced: 2025-02-03T11:51:09.054Z (8 months ago)
- Topics: cellular-automata, lifegame, wasm, wireworld
- Language: Rust
- Homepage: https://toruniina.github.io/miniascape-rs/
- Size: 20.2 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# miniascape
[](https://deps.rs/repo/github/emilk/eframe_template)
[](https://github.com/emilk/eframe_template/actions?workflow=CI)Run your cellular automaton.
[open miniascape](https://toruniina.github.io/miniascape-rs/)
This repo is based on [eframe_template](https://github.com/emilk/eframe_template).
## What is this?
`miniascape` provides you an environement to run a cellular automaton with a rule you defined.
It utilizes [rhai](https://rhai.rs) as a scripting language to describe a rule.
`rhai` script you wrote will be evaluated in each cell while the simulation.
You can use arbitrary type as a cell state, including `bool`, `i32`, `f32`, `rhai::Array`, etc.
You can use not only square grid with Moore Neighborhood, but also a hex grid and a square grid with Von Neumann neighborhood.
## Build
### Compiling for the web
Make sure you are using the latest version of stable rust by running `rustup update`.
You can compile your app to [WASM](https://en.wikipedia.org/wiki/WebAssembly) and publish it as a web page. For this you need to set up some tools. There are a few simple scripts that help you with this:
```sh
./setup_web.sh
./build_web.sh
./start_server.sh
open http://127.0.0.1:8080/
```### Testing locally
**NOTE** First you need to comment out `"wasm-bindgen"` feature of `rhai` in `Cargo.toml` when you run it natively.
Make sure you are using the latest version of stable rust by running `rustup update`.
`cargo run --release`
On Linux you need to first run:
`sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev`
On Fedora Rawhide you need to run:
`dnf install clang clang-devel clang-tools-extra speech-dispatcher-devel libxkbcommon-devel pkg-config openssl-devel libxcb-devel`
For running the `build_web.sh` script you also need to install `jq` and `binaryen` with your packet manager of choice.