Coding challenge
Mark Wieder
mwieder at ahsoftware.net
Wed Jan 30 23:45:40 EST 2013
Craig-
Wednesday, January 30, 2013, 8:31:54 PM, you wrote:
> on mouseup
> ask "Enter Value"
> put it into temp
> put "50,20,10,5,2,1" into coins
> put 1 into tCount
> repeat until temp = 0
> if item tCount of coins <= temp then
> put item tCount of coins & "," after tChange
> subtract item tCount of coins from temp
> else
> add 1 to tCount
> end if
> end repeat
> answer tChange
> end mouseup
OK. You went with my approach as well - listing the coins as values
rather than by number. I'll have to subtract a point for not cleaning
up the trailing comma, though.
--
-Mark Wieder
mwieder at ahsoftware.net
More information about the use-livecode
mailing list