Go to file
n loewen 667897b31a First commit - Create punch-card encoding script 2023-08-25 11:56:12 +01:00
examples First commit - Create punch-card encoding script 2023-08-25 11:56:12 +01:00
.gitignore First commit - Create punch-card encoding script 2023-08-25 11:56:12 +01:00
punch-a-card.js First commit - Create punch-card encoding script 2023-08-25 11:56:12 +01:00
readme.md First commit - Create punch-card encoding script 2023-08-25 11:56:12 +01:00

readme.md

Create punch card patterns from binary strings

This script turns a binary string into a pattern formatted for copying to an IBM-style 80-column punch card.

It is intended for creating drawings patterns based on programs for my imaginary computer.

Use

./punch-a-card.js bin.txt

The input must be a text file containing nothing but 0s and 1s (no spaces, newlines, etc). It must be an even number of 8-bit bytes in length.

Example output

01234567  01234567  01234567  01234567  01234567  01234567  01
▮▯▮▯▮▯▮▮  ▮▮▮▯▮▮▮▮  ▯▮▯▯▯▯▮▮  ▯▮▯▮▮▮▯▯  ▯▮▮▮▮▮▯▮  ▮▮▮▮▯▮▮▮  ▯▯
▮▮▯▮▮▮▯▮  ▮▮▯▮▮▯▮▮  ▮▯▯▯▯▮▯▯  ▯▮▮▯▮▯▯▮  ▯▯▯▯▯▯▯▮  ▮▯▯▮▮▯▮▯  ▯▮
▯▯▯▯▯▯▯▯  ▯▯▯▮▯▯▯▮  ▯▮▯▯▮▯▯▮  ▮▯▮▯▯▮▮▮  ▮▮▮▮▯▮▮▯  ▮▯▯▯▮▯▯▮  ▮▮
▯▯▯▮▯▯▯▮  ▯▮▯▮▮▯▯▮  ▯▮▯▯▯▮▯▮  ▯▮▮▯▮▮▮▮  ▯▮▯▯▯▮▯▮  ▯▯▯▮▮▯▮▮  ▮▮
▯▯▯▮▯▯▯▮  ▯▯▯▮▯▮▯▮  ▯▮▯▯▯▮▯▮  ▯▮▯▯▯▮▯▮  ▯▮▯▯▯▮▯▮  ▯▯▯▮▯▯▯▮  ▯▮
▯▯▯▮▯▯▯▮  ▯▮▯▮▯▮▯▮  ▯▮▯▯▯▮▯▮  ▯▮▯▯▯▮▯▮  ▯▮▯▯▯▮▯▮  ▯▯▯▮▯▯▯▮  ▯▮
▯▯▯▮▯▯▯▮  ▯▯▯▮▯▯▯▮  ▯▮▯▯▯▮▯▮  ▯▮▯▯▯▯▯▮  ▯▮▯▯▯▮▯▮  ▯▯▯▮▯▯▯▯  ▯▮
▯▯▯▮▯▯▯▮  ▯▯▯▮▯▯▯▮  ▯▮▯▯▯▮▯▮  ▯▮▯▯▯▯▯▮  ▯▮▯▯▯▮▯▮  ▯▯▯▮▯▯▯▯  ▯▮
01234567  01234567  01234567  01234567  01234567  01234567  01