Jump to content

Last list item: Difference between revisions

added Arturo
(added Arturo)
Line 351:
{243, 378} ← 150 + 228 = 378
{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}}==
1,532

edits

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