🚽 Urinal Sim

No input provided.
What is this?
Step-by-step visualizer for the Urinal Problem
Guests pick the urinal that maximizes distance from others
Chosen position = midpoint of the longest empty gap
Ties break toward the entrance (lowest index)
When full, guests queue (FIFO) for the next free urinal
Simulate tab
Use ◀ ▶ or the slider to step through events.
Banner — current event (assign, queue, depart)
Gap markers — candidate gaps. ✓ = chosen. Hover for info
Urinals — colored = occupied, ▲ = newly assigned
Timeline tab
A space-time chart. X-axis = urinals, Y-axis = time. Colored blocks show each guest's occupancy window.
Results tab
A table listing each guest's assigned urinal, start time, and wait time. Green = no wait, red = had to queue.