Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
rosetta_sort :-
|
||||
L = ["Here", "are", "some", "sample", "strings", "to", "be", "sorted" ],
|
||||
predsort(my_comp, L, L1),
|
||||
writeln('Input list :'),
|
||||
maplist(my_write, L), nl,nl,
|
||||
writeln('Sorted list :'),
|
||||
maplist(my_write, L1).
|
||||
|
||||
|
||||
my_comp(Comp, W1, W2) :-
|
||||
string_length(W1,L1),
|
||||
string_length(W2, L2),
|
||||
( L1 < L2 -> Comp = '>'
|
||||
; L1 > L2 -> Comp = '<'
|
||||
; compare(Comp, W1, W2)).
|
||||
|
||||
my_write(W) :-
|
||||
format('~s ', [W]).
|
||||
Loading…
Add table
Add a link
Reference in a new issue