Last list item: Difference between revisions
Content added Content deleted
Drkameleon (talk | contribs) (added Arturo) |
|||
Line 351: | Line 351: | ||
{243, 378} ← 150 + 228 = 378 |
{243, 378} ← 150 + 228 = 378 |
||
{621} ← 243 + 378 = 621"</syntaxhighlight> |
{621} ← 243 + 378 = 621"</syntaxhighlight> |
||
=={{header|Arturo}}== |
|||
<syntaxhighlight lang="arturo">lst: [6 81 243 14 25 49 123 69 11] |
|||
initial: lst |
|||
while [1 < size lst][ |
|||
remove 'lst min1: <= min lst |
|||
remove 'lst min2: <= min lst |
|||
append 'lst min1 + min2 |
|||
print ["List:" lst] |
|||
] |
|||
print "" |
|||
print [initial "=>" lst]</syntaxhighlight> |
|||
{{out}} |
|||
<pre>List: [81 243 14 25 49 123 69 17] |
|||
List: [81 243 25 49 123 69 31] |
|||
List: [81 243 49 123 69 56] |
|||
List: [81 243 123 69 105] |
|||
List: [243 123 105 150] |
|||
List: [243 150 228] |
|||
List: [243 378] |
|||
List: [621] |
|||
[6 81 243 14 25 49 123 69 11] => [621]</pre> |
|||
=={{header|AutoHotkey}}== |
=={{header|AutoHotkey}}== |