FA-79834 / Barcode symbology encoding / Member archive
Pharmacode bars are printed in generation order · case 04
Codes are mirrored, so asymmetric patterns scan as other values.
Case contract
Encode an integer 3..131070 as a one-track Pharmacode: repeatedly, an even value adds a wide bar and becomes (n - 2) / 2, an odd value adds a narrow bar and becomes (n - 1) / 2, until zero; bars are read in the reverse order of generation (left to right). Width: narrow 1, wide 3, spaces 2 between bars. Return [pattern, width] or None outside the range.
Why this case matters
Retail, logistics, pharmacy and document workflows depend on encoders that produce exactly the module pattern, code-set switches, separators and quiet zones scanners expect; one misplaced module or separator makes a label unreadable or, worse, scan as different data.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: reading order of bars 0 | ["nwwwwnn", 27] | ["nnwwwwn", 27] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗