alecAbstraction Layer for Escape Codes |
git clone git://git.dimitrijedobrota.com/alec.git |
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING | |
alec_runtime.cpp (829B)
1 #include <cstdio> 2 #include <iostream> 3 4 #include "alec/alec.hpp" 5 6 using namespace alec; // NOLINT 7 8 using enum Color; 9 using enum Decor; 10 11 int main() 12 { 13 std::cout << abuf_enable() << cursor_hide(); 14 15 std::cout << cursor_position(1, 1) << foreground(91) << "HELLO!\n"; 16 17 std::cout << cursor_down(3); 18 std::cout << foreground(30) << background(96, 53, 64) << "WORLD!\n"; 19 20 std::cout << background(DEFAULT) << "testing 1...\n" << foreground(DEFAULT); 21 std::cout << decor_set(INVERSE) << "testing 2...\n" << decor_reset(INVERSE); 22 23 std::cout << cursor_up(5) << "Hello there!" << cursor_save(); 24 std::cout << cursor_down(10) << "General Kenobi!"; 25 std::cout << cursor_position(10, 40) << "no pain no gain" << cursor_restore() 26 << cursor_show(); 27 28 (void)std::getchar(); 29 30 std::cout << abuf_disable(); 31 32 return 0; 33 }