RosettaCodeData/Task/Sort-three-variables/Prolog/sort-three-variables.pro

10 lines
237 B
Prolog

?- msort(['lions, tigers, and', 'bears, oh my!', '(from the "Wizard of OZ")'], [X, Y, Z]).
X = '(from the "Wizard of OZ")',
Y = 'bears, oh my!',
Z = 'lions, tigers, and'.
?- msort([77444, -12, 0], [X, Y, Z]).
X = -12,
Y = 0,
Z = 77444.