Coding challenge

dunbarx at dunbarx at
Wed Jan 30 23:08:00 CST 2013


That comma is there for future expansion.


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


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

use-livecode mailing list
use-livecode at
Please visit this url to subscribe, unsubscribe and manage your subscription 


More information about the use-livecode mailing list