4 ms·
Yeah, I actually implemented this some years ago here, for UTF-8 text: https://github.com/Michael-Zinn/cardfs https://github.com/Michael-Zinn/cardfs Works for
by RedNifre 2y ago
Yeah, I actually implemented this some years ago here, for UTF-8 text: https://github.com/Michael-Zinn/cardfs https://github.com/Michael-Zinn/cardfs
Works for Poker, Skat, Tarot and Quartett decks.
- zzo38computer 2y agoA tarot deck has more than only trumps. It also has fourteen non-trumps in each of four suits (Latin-suited or French-suited depending on the deck), so the total number of cards (trumps and non-trumps) is 78. Furthermore, if you can store bytes, then why should it need to be UTF-8? Not all data is text, and not all text is Unicode (and not all Unicode text is most efficient with UTF-8). As far as I can tell, the only part of the program that requires it to be UTF-8 is the "decode_array_to_string" function (although I think it will have to be a string without embedded null characters since that is how argv is working, and that could possibly allow you to store a few more bytes, if the data is required to not have null characters).
- RedNifre 2y agoThanks for pointing this out, I did not know that there are other tarot decks (I only have this one https://steemit.com/software/@michaelzinn/store-text-in-a-deck-of-cards https://steemit.com/software/@michaelzinn/store-text-in-a-de... ) I originally had planned to store other data as well (that's why it's called "CardFS"): With the bytes, there is another multiplier 3 in there, which is unused. My plan was to do 0=UTF-8 text, 1=raw bytes, 2=bitmap graphic, but I stopped working on it after I got the UTF-8 text working. Excluding NUL characters would only up the byte count to floor(log_255(52!)), which is still 28 bytes (though it increases the unused multiplier from 2.99 to 3.1, which makes it possible to use all bytes in all three file types), but how would you then store texts that use fewer than the maximum number of characters? Fill it with spaces?