{$H+} program Compressor; var qrCode : string = '1111111111111111111111111111111111110000000100010100111111100100000001101111101000110100000111111011111011010001010100100010011100110100010110100010100101000110110101101000101101000101111110011101101001010001011011111010110010010000100110111110110000000101010101010101010100000001111111111101100110001111001111111111001100011110100110101010011010000110011001010010110010011111011001101101000101011001110011100111110100111010111101100101010011110101111100111101000001010000001001010111100111101000111001111110001011000000011011011000010101100000011100111001001110011001001010111001111010100001001101101100011001001000001110110111111011011101011000111010101011110110110111100001001110101110011111010011100100010111101101011000111100011111110001010010101110100010000101111110010101010010110010110111011011101111011001001111000111000111110110111111011110100101100111010111110111110001010110001111101000110000010011111111111001100010011111101110110111000000011011101010110001010100011110111110101111010100100000111001001101000101000100011001001100000111011010001011010101001001111011111100110100010111010100001110010111101011101111101001000001011100110000011111000000010100010101100011110111110111111111111111111111111111111111111'; qrBlock : string = '%'; dicLA, dicCA : byte; letterCode, error : byte; i : smallint = 1; begin // the 5-bit dictionary has 16 capital letters 'A'..'P' and 16 lowercasers 'a'..'p' dicLA := ord('a'); dicCA := ord('A') - 16; // second half of dictionary repeat qrBlock := qrBlock + copy(qrCode, i, 5); val(qrBlock, letterCode, error); if (letterCode > 15) then write(chr(letterCode + dicCA)) else write(chr(letterCode + dicLA)) ; qrBlock := '%'; i := i + 5; until i = 1226; writeln(' [END]'); end.