Skip to content
/ CAVIS Public

CAVIS provides a simple way of displaying your cellular automaton.

License

Notifications You must be signed in to change notification settings

Rapatas/CAVIS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAVIS (Cellular Automaton View in SFML)

CAVIS provides a simple way of displaying your cellular automaton. It comes in two flavors: Window and Widget. Use the Widget to display the automaton on your own projects. Alternatively use the Window and get started fast!

Contents

Features:

  • Move the view with WASD.
  • Reset view with R.
  • Control zoom with LShift & Space.
  • Control steps per second up with Up & Down arrows.
  • Show/Hide the grid with G.

Use cases:

Preview

Preview

Installation

Dependencies

CAVIS is based on SFML (Simple & Fast Multimedia Library). Follow SFML's documentation to install it.

For Ubuntu simply apt install libsfml-dev

CAVIS (Linux)

git clone https://github.com/Rapatas/CAVIS.git
mkdir CAVIS/build
cd CAVIS/build
cmake ..
make install # As root

Usage

  • Implement a cellular automaton using the provided interface (cellular_automaton.h).
  • Pass it as a std::unique_ptr to the Cavis or Window constructor.
#include <CAVIS/window.h>
#include "predator_and_prey.h"

int main() {

    // HD aspect ratio = 16:9
    unsigned height = 100;
    unsigned width = height * 16 / 9;
    unsigned cell_size = 4;

    Window window(
        std::make_unique<PredatorAndPrey>(), 
        width, 
        height, 
        cell_size, 
        "Predator & Prey"
    );

    window.run();

    return 0;
}

About

CAVIS provides a simple way of displaying your cellular automaton.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages