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!
- 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.
CAVIS is based on SFML (Simple & Fast Multimedia Library). Follow SFML's documentation to install it.
For Ubuntu simply apt install libsfml-dev
git clone https://github.com/Rapatas/CAVIS.git
mkdir CAVIS/build
cd CAVIS/build
cmake ..
make install # As root
- 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;
}