Skip to content

Commit

Permalink
Update BubbleSort.rickroll
Browse files Browse the repository at this point in the history
  • Loading branch information
Sherlockcxk authored Jul 26, 2021
1 parent 7334ef9 commit 39687e2
Showing 1 changed file with 7 additions and 36 deletions.
43 changes: 7 additions & 36 deletions examples/BubbleSort.rickroll
Original file line number Diff line number Diff line change
@@ -1,56 +1,27 @@
never_knew BubbleSort arr could_feel_this_way

give_u_up i = 0
give_u_up j = 0

together_forever_with i is Length(arr)
together_forever_with i < length(arr)
give_u_up i = i + 1

together_forever_with j is Length(arr) - 1
give_u_up j = j + 1
give_u_up j = 0
together_forever_with j is_less_than length(arr) - 1

and_if_u_ask_me_how_im_feeling arr[j] > arr[j + 1]
give_u_up arr[j], arr[j + 1] = arr[j + 1], arr[j]
say_good_bye
give_u_up j = j + 1

say_good_bye
say_good_bye

when_i_give_my arr it_will_be_completely
i_just_wanna_tell_u_how_im_feeling arr


say_good_bye

take_me_to_ur_heart~
give_u_up arr = [6, 3, 5, 9, 12]
i_just_wanna_tell_u_how_im_feeling BubbleSort(arr)
give_u_up arr = [6, 7, 5, 9, 12]
BubbleSort(arr)

say_good_bye

# Equivalent to python
# def BubbleSort(arr):

# i=0
# j=0

# while i==len(arr):
# i=i+1

# while j==len(arr)-1:
# j=j+1

# if arr[j]>arr[j+1]:
# arr[j],arr[j+1]=arr[j+1],arr[j]
# pass

# pass
# pass

# return arr


# pass

# if __name__ == "__main__":
# arr=[6,3,5,9,12]
# print(BubbleSort(arr), end="")

0 comments on commit 39687e2

Please sign in to comment.