Example #1
0
 MayaNumber(const Alphabet& alphabet, const int value)
     : alphabet_(alphabet)
 {
     size_t tempVal = value;
     while (tempVal >= alphabet.num())
     {
         size_t d = tempVal / alphabet.num();
         symbols_.push_back(alphabet.fromValue(d));
         tempVal %= alphabet.num(); 
     }
     symbols_.push_back(alphabet.fromValue(tempVal));
 }
Example #2
0
 MayaNumber(const Alphabet& alphabet, const string& lines)
     : alphabet_(alphabet)
 {
     size_t n = alphabet.height() * alphabet.width();
     for (int i = 0; i < lines.length(); i += n)
     {
         symbols_.push_back(alphabet.fromValue(lines.substr(i, n)));            
     }
 }