Coder Social home page Coder Social logo

smarticles's Introduction

Smarticles

A Rust port of Brainxyz's Artificial Life simulator with some fun features.

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.

– from the original repository

animation of the app simulating particles

Running the App

To run this, you will need Rust installed, which you can do by following the installation instructions on the Rust website. You should then have cargo installed, which is the command line program for managing and running Rust projects.

You can check your version of cargo in the command line:

cargo --version
cargo 1.64.0-nightly (85b500cca 2022-07-24)

Once done, download or clone this repository to your preferred location and run the program using cargo like so:

cd ~/Rust/smarticles
cargo run

How to Use It

First, watch it in action. Press the Randomize button, which will spawn a bunch of particles with randomized settings. Then, press Play to run the simulation.

screenshot of the app's basic controls

Try randomizing it a few times and seeing what kind of results you get.

animation of the app simulating particles

There are 4 particle types. You can change the behavior of each with the sliders:

screenshot of particle's parameters

Power is the particle's attraction to particles of the other type. A positive number means it is attracted to them, and negative means it is repulsed away. Radius is how far away the particle can sense particles of that type.

You can adjust these parameters while the simulation is running if you want to see the effect they have:

Sharing Simulations

The Seed field is the D.N.A of your particle system. It contains all the information needed to replicate the current simulation. Pressing Randomize will give you random seeds, but you can also enter a custom one.

What does your name look like?

simulation using "chevy" as the seed

☝️ literally the inside of my brain ☝️

If you start adjusting parameters, you'll notice the seed changes to a code that begins with the @ symbol. These are custom-encoded simulations, which you can share by copying the entire code.

The code will be partially cut-off by the textbox, so make sure you select it all before copying.

screenshot of particle's parameters

smarticles's People

Contributors

chevyray avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.