Home Segments Index Top Previous Next

442: Mainline

Imagine that your railroad company has installed a device that classifies each car as that car rumbles into the company's central switching yard. A program written by your predecessors at the company uses that sensor's output to create a file in which each railroad car is represented by a number that encodes that car's type. Here, for example, is the file for a certain short train:

0 1 1 2 3 

Further imagine that you want to use those numbers to display a list of short, three-character names:

eng 
box 
box 
tnk 
cab