Count the coins: Difference between revisions

no edit summary
No edit summary
Line 277:
 
=={{header|Arturo}}==
<lang arturorebol>changes: @(function [amount coins){][
{{trans|Python}}
ways: map 0..amount+1 [x]-> 0
<lang arturo>changes: @(amount coins){
ways\0: #(0)*(amount+1)
ways.0: 1
 
loop coins @('coin){ [
loop coin..amount @('j){ ->
set ways.[ j]: (get ways.[ j]) + get ways.[ j-coin]
}]
}
}
return ways.[amount]
}
 
return ways.[ \ amount]
print [changes 100 #(1 5 10 25)]
]
print [changes 100000 #(1 5 10 25 50 100)]</lang>
 
print [changes 100 #([1 5 10 25)]
{{out}}
print [changes 100000 #([1 5 10 25 50 100)]</lang>
 
<pre>242
13398445413854501
</pre>
 
=={{header|AutoHotkey}}==
1,532

edits