Coding challenge

dunbarx at aol.com dunbarx at aol.com
Wed Jan 30 23:08:00 CST 2013


Mark.


That comma is there for future expansion.


Craig



-----Original Message-----
From: Mark Wieder <mwieder at ahsoftware.net>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Sent: Wed, Jan 30, 2013 11:46 pm
Subject: Re: Coding challenge


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


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

 


More information about the use-livecode mailing list