📜 ⬆️ ⬇️

Entertaining problem with bar codes (only for those who want to help)


So. You need to create a copy of the program that creates bar codes.
But this program is kind of strange. If it is fed to the input 2, 3-digit number - it gives a valid 128 – V barcode
But if you feed 4-digit numbers, it gives out it is not clear what.
Namely, the "initial symbol | symbol code C | 2 symbols whose codes are formed from 2 pairs of numbers | Control symbol | final symbol"
My problem is that I do not understand how this control character is formed, or rather its code. 2 days I suffer, and the terms are burning. If you do not understand bar codes, then the task is as follows:
I will give several data - the first column is the incoming number, the second is its checksum

2184 85
2185 88
2186 91

1550 74
1551 77
')
2000 37
2001 40

This shows that as the number increases by 1, the checksum increases by 3.
There are also the codes of the pair of numbers increasing by 32, i.e. 2184 is output as chr (21 + 32) chr (84 + 32)
The code-code "code C" is 199, perhaps he also participates in this somehow.
I really hope for help.
UPD I can use Google !!! There is no standard situation.

Source: https://habr.com/ru/post/23236/


All Articles