| Crates.io | hext-boards |
| lib.rs | hext-boards |
| version | 0.5.0 |
| created_at | 2022-12-25 09:04:46.033369+00 |
| updated_at | 2025-01-17 12:24:02.282431+00 |
| description | A small library that renders hexagonal boards with text on the terminal |
| homepage | |
| repository | https://github.com/odilf/hext-boards/ |
| max_upload_size | |
| id | 745235 |
| size | 13,849 |
A small library to render hexagonal boards on the terminal.
use hext_boards::HexagonalBoard;
let board = HexagonalBoard::from([
([0, 0], 'a'),
([1, 0], 'b'),
([0, 1], 'c'),
([-1, -1], 'd'),
]);
let output = board.to_string();
// Also works
println!("{board}");
/* Output is the following:
/---\ /---\
⟨ b ⟩---⟨ c ⟩
\---⟨ a ⟩---/
⟩---⟨
⟨ d ⟩
\---/
*/