Split a message into numbered pieces — quick review
A long freight train blocks a line for a whole day.
To send a message with the card protocol, cut it into pieces of 4 characters from the left, the last piece holding the 1 to 4 characters left over, and number the pieces from 1 to N, where N is the length divided by 4 and rounded up. Every card carries To, From, its number of N and its data.
Count the characters of the message, spaces and punctuation included.
Count the full groups of 4 characters, and add one more card if any characters are left over: that is N, the number of pieces.
Cut the message into pieces of 4 characters from the left; the last piece takes what is left.
Write one card for each piece, with To, From, its number of N and its data.
Check that joining the data of cards 1 to N in order gives back the message.
Leaving spaces and punctuation out of the count can give the wrong number of pieces: MEET-AT-NOON. counted without its period has 12 characters and gets 3 cards instead of 4. Every character is part of the message.
Numbering from 0 on some cards and from 1 on others breaks the agreement. The card protocol numbers from 1 to N.