Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: (Golf) Giving Change

by tadman (Prior)
on Jun 12, 2001 at 05:26 UTC ( #87703=note: print w/replies, xml ) Need Help??


in reply to Re: Re^2: (Golf) Giving Change
in thread (Golf) Giving Change

The explanation from the land of Frobozz certainly clears up what you were getting at. I would posit, though, that most countries, unlike Frobozz, have designed their currency structure along some sort of logic which would limit this possiblity.

Humans regularily give change from a machine displaying only a single total, without benefit of a breakdown, moving from one bin to the next, trying to make a good total. There is little "wiggle room" in a fully stocked register. It is only when they start to run out of things that it gets interesting.

I, for one, would not want to design a Frobozzian register which had to explain how to give change.

The absence of a "penny" placeholder would cause a little havoc with change dispensing from a mechanical perspective, as you pointed out with your $0.30 example, which would be rendered impractical.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://87703]
help
Chatterbox?
[Corion]: Nicholas Clark++ # read for a multichar block-delimiter by scanning for the last char, and only then check whether the whole delimiter was read.
[Corion]: At least if you're appending the data read to a larger buffer, this means you avoid the situation of "a delimiter was found but the other half has not been read yet"
choroba misses the context
[Corion]: choroba: Optimizing how Perl reads source code on startup (and then processes it line-by-line)
[Corion]: But in general, it seems to be an interesting approach I should think about - whenever I'm searching for something, to consider if I could search for the end of the token instead of the start of the token

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (12)
As of 2016-12-06 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (107 votes). Check out past polls.