RosettaCodeData/Task/Order-two-numerical-lists/Sidef/order-two-numerical-lists.sidef

15 lines
260 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
func ordered(a, b) {
(a <=> b) < 0
}
for p in [
Pair([1,2,4], [1,2,4]),
Pair([1,2,4], [1,2] ),
Pair([1,2], [1,2,4]),
] {
var a = p.first
var b = p.second
var before = ordered(a, b)
say "#{a} comes before #{b} : #{before}"
}