Last list item: Difference between revisions
→{{header|Ring}}
Line 490:
=={{header|Ring}}==
===
<lang
see "working..." + nl
Line 499:
while true
n++
first = List[1]▼
second = List[2]▼
ind1 = find(List,first)
del(List,ind1)▼
second = min(List)▼
ind2 = find(List,second)
del(List,ind2)▼
del(List,ind1)▼
else▼
del(List,ind1)▼
del(List,ind2)▼
ok▼
sum = first + second
add(List,sum)
Line 536 ⟶ 542:
see txt + nl
</lang>
===
<lang ring>
see "working..." + nl
Line 545 ⟶ 551:
while true
n++
▲ first = List[1]
▲ second = List[2]
ind1 = find(List,first)
▲ del(List,ind1)
▲ second = min(List)
ind2 = find(List,second)
▲ del(List,ind2)
▲ del(List,ind1)
▲ else
▲ del(List,ind1)
▲ del(List,ind2)
▲ ok
sum = first + second
add(List,sum)
|