Skip to content

Instantly share code, notes, and snippets.

@chriswk
Created June 1, 2012 12:38
Show Gist options
  • Save chriswk/2851844 to your computer and use it in GitHub Desktop.
Save chriswk/2851844 to your computer and use it in GitHub Desktop.
quicksort lol code
HOW DUZ I QSORT YR DATA AN YR BEGIN AN YR END
END PWNS BEGIN
O RLY?
YA RLY
GTFO
OIC
I HAS PIVOT AN LEFT AN RIGHT AN TEMP
PIVOT R NMBR BEGIN OF DATA
LEFT R SUM OF BEGIN AN 1
RIGHT R END
IM IN YR BIGLOOP
IM IN YR LEFTLOOP UPPIN YR LEFT TILL EITHER OF LEFT PWNS RIGHT AN NMBR LEFT OF DATA PWNS PIVOT
OUTTA YR LEFTLOOP
IM IN YR RIGHTLOOP NERFIN YR RIGHT TILL EITHER OF LEFT PWNS RIGHT AN NOT NMBR RIGHT OF DATA PWNS PIVOT
OUTTA YR RIGHTLOOP
LEFT PWNS RIGHT
O RLY?
YA RLY
GTFO BIGLOOP
OIC
TEMP R NMBR LEFT OF DATA
NMBR LEFT OF DATA R NMBR RIGHT OF DATA
NMBR RIGHT OF DATA R TEMP
UP LEFT
NERF RIGHT
OUTTA YR BIGLOOP
NMBR BEGIN OF DATA R NMBR RIGHT OF DATA
NMBR RIGHT OF DATA R PIVOT
QSORT DATA AN BEGIN AN DIFF OF RIGHT AN 1
QSORT DATA AN SUM OF RIGHT AN 1 MKAY AN END
IF U SAY SO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment