#include #include #include #include #include #include #include #include #define FRC_NO_ICU 1 #include "FRC.h" using namespace std::string_literals; std::string makeMap(std::bitset<10> b) { std::unordered_map lookups = { {"111100", "1111000000"}, {"111010", "1110000001"}, {"110110", "1100000011"}, {"101110", "1000000111"}, {"011110", "0000001111"}, {"11100", "1110000000"}, {"11010", "1100000001"}, {"10110", "1000000011"}, {"01110", "0000000111"}, {"1100", "1100000000"}, {"1010", "1000000001"}, {"0110", "0000000011"}, {"100", "1000000000"}, {"010", "0000000001"}, {"00", "0000000000"}, }; std::string out, b_s = b.to_string(); for (int c = 0; c < 3; ++c) { std::string accum; for ( ; std::count(accum.begin(), accum.end(), '0') != 2; accum.push_back(b_s.front()), b_s.erase(b_s.begin()) ) {} out += lookups[accum]; } return out; } std::string keymapAdaptor(std::string k) { return "{{"+std::accumulate( k.begin(), k.end(), ""s, [](std::string s, char c) {return s += c==' '?"1,"s:"0,"s;} )+"}}"; } int main() { std::vector outs; std::cout<<"#include \n"; std::cout<<"std::array, 126> space_maps {{\n"; for (unsigned short cnt = 0, i = 0b00'0011'1111; i <= 0b11'1110'0001; i += 2) { if (__builtin_popcount(i) == 6) { ++cnt; outs.push_back(((i>>1)&511)); // std::cout<>1)&511)<<": \n"; std::cout<( makeMap(~std::bitset<10>(i)) ).to_string('.', ' ') )<<",\n"; } } std::cout<<"}};\n"; std::cout<<"std::array spaceTable = {\n"; for (int i = 0; i < static_cast(outs.size()); ++i) { std::cout< b) { return b.to_string(); } std::string keymapAdaptor(std::string k) { return "▒"+std::accumulate( k.begin(), k.end(), ""s, [](std::string s, char c) {return s += c==' '?" ":"█";} )+"▒"; } int main() { for (i = 0b00'0011'1111; i <= 0b11'1110'0001; i += 2) { if (__builtin_popcount(i) == 6) { std::cout<(i>>1)).to_string('.', ' ') )<<"\n"; } } } */