Skip to content

Instantly share code, notes, and snippets.

@rhysforyou
Created March 28, 2012 07:37
Show Gist options
  • Select an option

  • Save rhysforyou/2224513 to your computer and use it in GitHub Desktop.

Select an option

Save rhysforyou/2224513 to your computer and use it in GitHub Desktop.
SET sorted to true
DO
SET sorted to true
IF value1 > value2
SET temp to value1
SET value1 to value2
SET value2 to temp
SET sorted to false
END
IF value2 > value3
SET temp to value2
SET value2 to value3
SET value3 to temp
SET sorted to false
END
. . .
IF value(n-1) > value(n)
SET temp to value(n-1)
SET value(n-1) to value(n)
SET value(n) to temp
SET sorted to false
END
WHILE not sorted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment