Robotic Arm Package Sorter
A TypeScript function that dispatches factory packages to the correct stack based on their volume and mass. Written for Smarter Technology's robotic automation factory.
Try It
All dimensions in centimeters · mass in kilograms
Stack
Sorting Rules
- STANDARD Package is neither bulky nor heavy — handled normally.
- SPECIAL Package is bulky or heavy (but not both) — cannot be handled automatically.
- REJECTED Package is both bulky and heavy — rejected entirely.
📦 Bulky: volume (W × H × L) ≥ 1,000,000 cm³ or any single dimension ≥ 150 cm
⚖️ Heavy: mass ≥ 20 kg
Test Results
✓
20 / 20 tests passing
— all edge cases covered
STANDARD — normal packages (not bulky, not heavy)
small light package
mass just below heavy threshold (19.99 kg)
volume just below bulky threshold (999,999 cm³)
single dimension just below the limit (149 cm), small volume
SPECIAL — heavy packages (mass >= 20 kg, not bulky)
exactly at the heavy threshold (20 kg)
well above heavy threshold (50 kg)
SPECIAL — bulky by volume (volume >= 1,000,000 cm³, light)
volume exactly at the bulky threshold (1,000,000 cm³)
volume well above threshold
SPECIAL — bulky by dimension (one side >= 150 cm, light)
width exactly at 150 cm
height exactly at 150 cm
length exactly at 150 cm
one dimension well above 150 cm
REJECTED — packages that are both bulky and heavy
bulky by volume and heavy
bulky by dimension and heavy
massively oversized and overweight
Edge cases — exact boundary values
mass 19.99 kg is NOT heavy → STANDARD
mass 20.00 kg IS heavy → SPECIAL
volume 999,999 cm³ is NOT bulky → STANDARD
single dimension 149 cm is NOT bulky → STANDARD
dimension 150 cm IS bulky → SPECIAL