In a message dated 9/8/98 3:15:44 PM Eastern Daylight Time,
barbaradesmond@HOTMAIL.COM writes:
> I'm kind of baffled on shopkeepers returning the exact amount of change.
> I was wondering if anybody could give any suggestions on how to do this.
>
Try using / and %.
Say the shopkeeper needs to return 345 (stored in change)coins. Gold = 100,
silver = 10, copper = 1.
amount_of_gold = change / 100;
change = change % 100;
amount_of_silver = change / 10;
change = change % 10;
amount_of_copper = change;
Then give the person the appropriate coins from that.
- Kieran of Darkening Skies
"Be careful what you laugh at, it might laugh back."
-- Sonia Lyris
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST