Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jzwood/sandfall
Falling sand simulator (webassembly)
https://github.com/jzwood/sandfall
Last synced: 13 days ago
JSON representation
Falling sand simulator (webassembly)
- Host: GitHub
- URL: https://github.com/jzwood/sandfall
- Owner: jzwood
- Created: 2024-07-13T02:03:39.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-10-24T01:20:44.000Z (15 days ago)
- Last Synced: 2024-10-24T04:44:55.212Z (14 days ago)
- Language: WebAssembly
- Homepage: https://jzwood.science/sandfall/
- Size: 580 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sandfall
# Dev Instructions
- install wat2wasm
- `brew install wabt`
- install local server (optional)
- `brew install http-server`
- install deno
- `brew install deno`
- scripts
- `build.sh` compiles wat to wasm and copies all src files to dist/
- `serve.sh` serves app locally (optional)## Algorithm
```
for each cell traversing rtl from bottom right to top left
if cell empty:
nop
else if south_cell empty:
set cell=empty
set south_cell=cell
else if west cell and south_west_cell empty:
set cell=empty
set south_west_cell=cell
else if east and south_east_cell empty:
set cell=empty
set south_east_cell=cell
else:
nop
```