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_compile.cpp (879B)
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_v << cursor_hide_v; 14 15 std::cout << cursor_position_v<1, 1> << foreground_v<91> << "HELLO!\n"; 16 17 std::cout << cursor_down_v<3>; 18 std::cout << foreground_v<30> << background_v<196, 53, 64> << "WORLD!\n"; 19 20 std::cout << background_v<DEFAULT> << "testing 1...\n" 21 << foreground_v<DEFAULT>; 22 23 std::cout << decor_set_v<INVERSE> << "testing 2...\n" 24 << decor_reset_v<INVERSE>; 25 26 std::cout << cursor_up_v<5> << "Hello there!" << cursor_save_v; 27 std::cout << cursor_down_v<10> << "General Kenobi!"; 28 std::cout << cursor_position_v<10, 40> << "no pain no gain" 29 << cursor_restore_v << cursor_show_v; 30 31 (void)std::getchar(); 32 33 std::cout << abuf_disable_v; 34 35 return 0; 36 }