Jump to content

Order two numerical lists: Difference between revisions

Add Miranda
(Added XPL0 example.)
(Add Miranda)
Line 1,719:
io.write_string(" : "), io.write_string(S), io.nl,
{ A < B -> S = "yes" ; S = "no" }.</syntaxhighlight>
 
=={{header|Miranda}}==
<syntaxhighlight lang="miranda">main :: [sys_message]
main = [Stdout (lay (map show [
order [1,2,1,3,2] [1,2,0,4,4,0,0,0],
order [1,2,0,4,4,0,0,0] [1,2,1,3,2]]))]
 
order :: [*]->[*]->bool
order as [] = True
order [] as = False
order (a:as) (b:bs) = a < b, if a ~= b
= order as bs, otherwise</syntaxhighlight>
{{out}}
<pre>False
True</pre>
 
=={{header|Nim}}==
2,114

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.