Exercise suited for a code kata
This is heavily inspired (meaning shamelessly stolen) by an exercise from Carlo Bottiglieri.
Given a string representation of a train, print an ASCII-art representation of this train.
- H: locomotive
<HHHH
orHHHH>
(depending on which side of the train it is) - P: passenger car
|OOOO|
- R: restaurant car
|hThT|
- C: cargo car
|____|
(when empty)|^^^^|
(when full)
Cars are attached together by ::
.