Code Monkey home page Code Monkey logo

forest-fires's Introduction

Forest-Fires

A simple and rough simulation of forest fires on the windows console. It's mainly a demonstration of rendering and animating ASCII-art on the console, as well as responding to keyboard and mouse events. It would also probably make for a cool screen-saver.

This simulation is based on the forest-fire model cellular automata - although I've tweaked the rules a bit to make it look more interesting.

This is a console-application, although it responds to mouse and keyboard input, and it's animated without any flickering as you can see in the examples.

Requirements

The program uses the Windows API to manipulate the console - so this will definitely only work on Windows. It should work on Windows 2000+ however I could only test it on Windows 7 and 10. If you want to compile it yourself, you'll need a C99 compiler. If you just want to try the program I provided an executable.

Controls

key action
Left-click place trees
Right-click start fires
C clear everything
ESC quit

Trees have a random chance of growing on empty cells, and have a chance to spread to neighboring cells each turn. Every tree could randomly catch fire any turn, and the fire will quickly spread to all neighboring trees.

Licence

This is provided under the public domain - you can do whatever you want with the program and the source code :)

forest-fires's People

Contributors

blat-blatnik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.