<

Challenge 3

User Image Log-in
with Discord

Part One:
Stop, Dock, and Roll

Today, you head to the Cargo Hold for your next assignment. The room is brightly lit in a white light, and you see thick tubes and chutes crisscrossing the walls and the high ceiling. Immediately in front of you, centered in the room, you see a row of 40 giant capsule-filled tubes with an opening for each at the very top and at the front of the bottom, like upside-down PEZ dispensers. Beside this dispensing system, bolted to the floor, is a large robotic arm. It is nearly as tall as the ceiling and features grips for spherical objects at the end of its long arm.

You're greeted by the supervisor of the Cargo Hold, who has a kind voice and an even kinder smile. She explains what you need to do:

The spherical capsules inside these tubes are all different kinds of cargo. They are heavy metallic balls studded with rivets and embellishments. To tell them apart, most of the capsules are painted with a large, bright red character (either alphabetical or a punctuation symbol). The ones that lack any marking are all the same item, so it might be helpful to think of them as a space character (" ").

What's inside them? She has no idea. She just gets a request from somewhere and runs the machine to fulfill it. Requests come on a piece of paper with three sections.

  1. The first line: a number from 0 to 39.
    This indicates which dispenser to set the machine to start at.
  2. The next line: a series of commands for the robotic arm, separated by commas.
    Each command begins with an R, L, T, or D, followed by a number.
  3. The following lines: lines of text representing the initial state of capsules in all dispensers.
    Each line shows the contents of the dispensers, ordered from 0 to 39. The capsule characters are listed from the bottom of each dispenser to the top, separated by commas.
  • When the machine gets an R or L command, the robotic arm moves its position either Right or Left by the numberof places indicated
  • When the machine gets a T command, the robotic arm Takes a single capsule from the bottom of the dispenser at its current position, letting the remaining capsules in the dispenser descend to fill the empty space
  • The grabbed capsule is then vacuumed into the robotic arm's C-shaped tube, where capsules are stored, always inserting itself into the entry point of the tube
  • This process is completed as many times as indicated by the number in the command, always one-at-a-time and never multiple capsules simultaneously
  • When the machine gets a D command, the robotic arm Drops the specified number of capsules, one-at-a-time, into the top of the dispenser it's currently facing
  • Because of the C-shaped tube, capsules are dispensed from the opposite end of the tube

You need to manually control the machine while following the instructions. Once the order is complete, you press the "release" button and one capsule from each dispenser rolls out from the bottom, in order, onto the delivery cart to be sent out to the appropriate area of the ship.

For example (with a shorter 5-dispenser system):

If your instructions are 3
L1,T3,R2,D1,L4,T3,R3,D4,L2,T1,L1,D1
Y,R,S
H,P
F,C,B,A

E

START
Dispensers:
01234
A
SB
RPC
YHFE
C-Shaped Tube:
Command: L1
Dispensers:
01234
A
SB
RPC
YHFE
C-Shaped Tube:
Command: T3
Dispensers:
01234
S
RP
YHAE
C-Shaped Tube:
BCF
Command: R2
Dispensers:
01234
S
RP
YHAE
C-Shaped Tube:
BCF
Command: D1
Dispensers:
01234
S
RPF
YHAE
C-Shaped Tube:
BC
Command: L4
Dispensers:
01234
S
RPF
YHAE
C-Shaped Tube:
BC
Command: T3
Dispensers:
01234
PF
HAE
C-Shaped Tube:
SRYBC
Command: R3
Dispensers:
01234
PF
HAE
C-Shaped Tube:
SRYBC
Command: D4
Dispensers:
01234
R
Y
PBF
HACE
C-Shaped Tube:
S
Command: L2
Dispensers:
01234
R
Y
PBF
HACE
C-Shaped Tube:
S
Command: T1
Dispensers:
01234
R
Y
BF
PACE
C-Shaped Tube:
HS
Command: L1
Dispensers:
01234
R
Y
BF
PACE
C-Shaped Tube:
HS
Command: D1
Dispensers:
01234
R
Y
BF
SPACE
C-Shaped Tube:
H

Then, pressing the release button will dispense one capsule from each dispenser, in order, giving you the capsules: SPACE.

Let's get that first delivery out. Your instructions are right in front of you...

Your instructions are: