chaos-engine
The ChaosEngine is a useful library that helps CLI-based projects that actively take input from the user to perform actions, which is suitable for text-based games in terminals.
The way it works is you create a few Page instances, which would contain the text to be displayed by the program, then at the bottom the user would have to give some text input. All inputs made by the user must be handled by you, where you could exit the program/display a new page (like progressing in a story), start a mini-game on a different page, etc.
Features
ChaosEngine includes a few useful features, including:
- Automatic word wrapping, with respect to paddings.
- Automatic re-adjustments to word wrapping when the terminal gets resized.
- Ability to create different pages to easily print whichever one you want depending on your logic.
Example Usage
Note: Do not be overwhelmed by how big this example is, it's just comments that explain the code. Just 21 lines of code if you exclude the comments.
use