Last Updated on: 11th January 2024, 05:01 pm

Web site: gitlab.com/jallbrit/cbonsai
Category: Games
Sub-Category: Games Others
Platform: Linux, BSD, OS X
License: GNU GPL
Interface: CLI
First release: 2021

cbonsai – a bonsai tree generator, written in C using ncurses. It intelligently creates, colors, and positions a bonsai tree, and is entirely configurable via CLI options. There are 2 modes of operation: static, and live.

The tree is automatically loaded from the cache file! And, since infinite mode is automatically turned on, it will finish the cached tree and just keep generating more. When you quit cbonsai again, the tree is once again written to the cache file for next time.

Keep in mind that only the seed and number of branches are written to the cache file, so if you want to continue a previously generated tree, make sure you re-specify any other options you may have changed.

cbonsai starts by drawing the base onto the screen, which is basically just a static string of characters. To generate the actual tree, cbonsai uses a ~~bunch of if statements~~ homemade algorithm to decide how the tree should grow every step. Shoots to the left and right are generated as the main trunk grows. As any branch dies, it branches out into a bunch of leaves.

cbonsai has rules for which character and color it should use for each tiny branch piece, depending on things like what type of branch it is and what direction it’s facing.

The algorithm is tweaked to look best at the default size, so larger sized trees may not be as bonsai-like.

Click to rate this post!
[Total: 0 Average: 0]

Leave a Comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.