# Replacing Dollars with Drachma

Heya all,

I’m looking to introduce currency into my game. I checked out Nickle and Dimed which seems to comprehensively cover everything I need, with coins and bills of various values. It looks like Inform 7 naturally has a dollars/cents system. This works fine:

``````Price is a kind of value. \$10.99 specifies a price with parts dollars and cents. A thing has a price. The price of a thing is usually \$0.00.

Money is a kind of thing. Coin is a kind of money.

A dollar bill is a kind of money. The price of a dollar bill is \$1.00. The printed name of a dollar bill is "dollar bill". Rule for printing the plural name of a dollar bill: say "dollar bills". The description of a dollar bill is "It has George Washington's head on the front, which with a bit of creative folding can be scrunched to look like a mushroom. All important things really are learned in kindergarten."

A five-dollar bill is a kind of money. The price of a five-dollar bill is \$5.00. Understand "five" or "five dollar" as the five-dollar bill. The description of a five-dollar bill is "Abraham Lincoln. He looks slightly less dignified here than he does on the penny."
``````

And so forth. Perfect for my use, but, I’m looking to use Drachma as the currency in my game, not dollars. Right now all the prices are printed with \$.

Simply replacing the \$ and dollar in the code with ₯ and drachma results in an error. I tried to create a rule that just prints \$ as ₯ but couldn’t quite get that to work either.

I figured someone’s probably done this before and there’s probably a simple way to do this. If anyone could help it’d be greatly appreciated.

The source won’t be happy with ₯. Leave it as ‘\$’ in the source or pick a different symbol, and then use the ₯ on output.

``````Price is a kind of value. %10.99 specifies a price with parts drachmas and leptons. A thing has a price. The price of a thing is usually %0.00.

To say (p - price):  say "[unicode 8367][drachmas part of p][unicode 46][leptons part of p]".

when play begins: let account be %3.67; say account.
``````

Your game will probably have to be played in a browser or via a bundled Lectrote app, though – other clients are likely to just print ‘?’ for ₯.

(Unicode 46 is just ‘.’. For whatever weird reason, a plain ‘.’ in the text for the say statement was generating a line break despite not being at the end of the text.)

So if you wanted to use a made-up currency, could you do it with English letters or keyboard symbols for an abbreviation? Like firkels abbreviated Fk or ^? Or would you always run into this trouble? Could @Lilt use Dp instead without trouble? I know this isn’t optimal, but might it be a workaround?

Have you tried it? That character displays fine on Gargoyle and the other interpreters I tested.

Gargoyle is weakest at Unicode (although how weak differs between Mac/Win/Linux). Other interpreters such as Spatterlight and WinGlulxe are entirely capable, as far as I can see.

2 Likes

Yeah, I should’ve thought of that…

``````Price is a kind of value. Dp 10.99 specifies a price with parts drachmas and leptons. A thing has a price. The price of a thing is usually Dp 0.00.

To say (p - price):  say "[unicode 8367][drachmas part of p][unicode 46][leptons part of p]".

when play begins: let account be Dp 3.67; say account.
``````

I hadn’t. I’ve had consistent enough trouble with Unicode that I was expecting ₯ to be a problem… but now I see it even works in my terminal emulator with git or glulx built with glktermw (with the terminal configured to use Noto Sans Mono).

Sorry for the misinfo, Lilt; thanks, Andrew.