Last list item: Difference between revisions

Content added Content deleted
(→‎{{header|Ruby}}: print initial values)
Line 1,419: Line 1,419:


=={{header|Ruby}}==
=={{header|Ruby}}==
<syntaxhighlight lang="ruby">original = [6, 81, 243, 14, 25, 49, 123, 69, 11]
<syntaxhighlight lang="ruby">p original = [6, 81, 243, 14, 25, 49, 123, 69, 11]
until original.size == 1 do
until original.size == 1 do
mins = original.min(2)
mins = original.min(2)
Line 1,427: Line 1,427:
</syntaxhighlight>
</syntaxhighlight>
{{out}}
{{out}}
<pre>[81, 243, 14, 25, 49, 123, 69, 17]
<pre>[6, 81, 243, 14, 25, 49, 123, 69, 11]
[81, 243, 14, 25, 49, 123, 69, 17]
[81, 243, 25, 49, 123, 69, 31]
[81, 243, 25, 49, 123, 69, 31]
[81, 243, 49, 123, 69, 56]
[81, 243, 49, 123, 69, 56]
Line 1,436: Line 1,437:
[621]
[621]
</pre>
</pre>

=={{header|Sidef}}==
=={{header|Sidef}}==
===With sorting===
===With sorting===