Skip to content

Instantly share code, notes, and snippets.

View KodaDono's full-sized avatar

Jorge Augusto Batassim Nunes KodaDono

  • eyeBros Studio
View GitHub Profile
@KodaDono
KodaDono / bubbleSort.pl
Created October 14, 2017 20:16 — forked from PythonJedi/bubbleSort.pl
Bubble Sort in prolog
% Bubble sort in prolog, because bubble sort
bubble_sort([],Sorted) :-
Sorted = [].
bubble_sort([X], Sorted) :-
Sorted = [X].
bubble_sort(Terms, Sorted) :-
bubble(Terms, Terms), Sorted = Terms ;
bubble(Terms, Partials), bubble_sort(Partials, Sorted).