Coding challenge

Mark Wieder mwieder at ahsoftware.net
Wed Jan 30 23:18:31 EST 2013


Jacque-

Wednesday, January 30, 2013, 7:59:42 PM, you wrote:

> on makeChange pAmt
>    repeat for each item i in "50,20,10,5,2,1"
>      put i &"="& pAmt div i & cr after tList
>      put pAmt mod i into pAmt
>    end repeat
>    filter tList without "*=0"
>    put tList into fld "change"
> end makeChange

Mod - nicely done.
I hadn't thought of the solution of sorting by coin type.
So I get 74 =
50=1
20=1
2=2

-- 
-Mark Wieder
 mwieder at ahsoftware.net





More information about the use-livecode mailing list