Python
The list: items (dark bars are the sorted part · the card below the row is the card in hand · the dashed outline is the gap)
Output (print)