Quarry School

Split a message into numbered pieces — quick review

In plain words

A long freight train blocks a line for a whole day.

Rule

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.

Step

  1. Count the characters of the message, spaces and punctuation included.

  2. 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.

  3. Cut the message into pieces of 4 characters from the left; the last piece takes what is left.

  4. Write one card for each piece, with To, From, its number of N and its data.

  5. Check that joining the data of cards 1 to N in order gives back the message.

Trap

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.