Skip to content

About

Drossel-Schwabl forest fire model simulated in the terminal, written in C

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C Linux

Forest fire simulation based on the Drossel-Schwabl forest fire model

The program simulates a forest fire in a terminal window. It is based on the model created in 1992 by Barbara Drossel and Frank Schwabl. Written in C for Linux.

Demo

The program consists of three files:

File Description
main.c setup and main loop
grid.h constants, cell states, declarations
grid.c cell colors and definitions

Optionally, set the grid dimensions and other constants in grid.h before building.

Constant Description
ROWS number of rows
COLS number of columns
STEPS number of simulation steps
TIME delay between steps in milliseconds
TREE_CHANCE chance of a tree growing in each step
FIRE_CHANCE chance of a fire starting in each step

Then build the program and watch the world burn.

Build with gcc

gcc main.c grid.c -o forest-fire
./forest-fire

Build with CMake

cmake -B build
cmake --build build
./build/forest-fire

About

Drossel-Schwabl forest fire model simulated in the terminal, written in C

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages