terminity/
lib.rs

1//! Crate to register multiple terminal games, allow to choose a game and set up an environment
2//! to run them. This is at an extremely early development stage.
3//!
4//! To try it, clone the project and run `cargo run Chess` or `cargo run SuperTicTacToe`.
5//!
6//! The purposes and goals of this crate are to to:
7//! 1. Make it easier to build good UI in terminal
8//! 2. Make terminal games accessible to anyone and everyone. A windows `.exe` is to be expected,
9//! and I'd love to make a smartphone app.
10//!
11//! I would also love to setup a P2P (peer to peer) system allowing to play the games online with
12//! anyone, and giving the programmers an API to setup an online game without a mandatory need for a
13//! server (although a way to create a server-client game is to be expected if the P2P system is
14//! created). Making the P2P system seems feasible, but I don't know yet for the API.
15//!
16//! This project is of course not feasible alone. It needs at least a community to try it and give
17//! feedback. If you want to support this project in any way, from being part of a
18//! subreddit to be an active developer, please do!! You don't have to be a developer or have money
19//! to spend to help, and any help is probably more helping than you expect.
20//!
21//! Currently, to ease the UI building, a bit of configuration is made to help making something of
22//! quality. That is:
23//!
24//! * Enable paste, focus change, and mouse captures
25//! * Put the terminal in "alternate screen"
26//! * Enable raw mode
27//! * Save cursor position and move it to 0,0
28//! * When any unwind (and thus most panics) occurs, the terminal state is restored before the
29//! unwinding data is displayed (the display may be improved though). Without that, the terminal
30//! state keeps the configuration and the sh CLI becomes crappy.
31//!
32//! The result of doing all this can be seen for instance on the chess implementation, where
33//! dragging with the mouse is supported, and any keyboard input is captured immediately.
34
35#![warn(missing_docs)]
36
37pub mod games;