Paul-

Wednesday, January 30, 2013, 8:21:36 PM, you wrote:

> And here's my simple logical non-mathematician version!

> function coinChange pChange
>    repeat for each item x in "50, 20, 10, 5, 2, 1"
>       repeat while pChange >= x
>          subtract x from pChange
>          add 1 to y
>       end repeat
>       if y > 0 then put y && "x" & x & "c" & cr after tResult
>       put 0 into y
>    end repeat
>    return tResult
> end coinChange

You did the same nested repeat thing I did.
And everyone but me seemed to think of listing the number of coin
types. I got lazy and just repeated the coin if necessary.

-- 
-Mark Wieder
 mwie...@ahsoftware.net


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to