                 i: 1
                 count: 0
 
-        { swapped, i, count } = sort_context
+        { swapped, i } = sort_context
 
         if i == colours.length
                 sort_context.i = 1

                min: 0
                count: 0

        { i, j, count, min } = sort_context

        if j == colours.length
                swapRects(i-1, min)

[rectWidth, rectHeight] = [20, 20]

UPDATE_INTERVAL = 1000

# Initialised by reset().
checkDoneInterval = null
