twoWayBubbleSort = ->
VA.locals.swapped = true
while VA.locals.swapped
VA.locals.swapped = false
for x in [0...VA.length - 1]
VA.locals.x = x
if VA.gt(x, x + 1)
VA.swap(x, x + 1)
VA.locals.swapped = true
for x in[(VA.length-1)..1]
VA.locals.x = x
if VA.gt(x - 1, x)
VA.swap(x - 1, x)
VA.locals.swapped = true
twoWayBubbleSort()