by jrockway · 5y ago · 0 comments
I really hope they implemented this as an enum, so someone has to wade through:
enum PricePoint {
UNKNOWN = 0;
NINTEY_NINE_CENTS = 1;
ONE_DOLLAR = 2;
TWENTY_DOLLARS = 3;
NINETEY_EIGHT_CENTS = 4;
DEPRECATED_NINETY_SEVEN_CENTS = 5;
TEN_DOLLARS_PER_MONTH = 6;
PORTUGAL_NATIONAL_BALLOON_DAY_2019_SPECIAL_NINTEY_NINE_CENTS = 7;
// 500 lines follow.
}Would drive me absolutely livid. But of course no one was allowed to fix is since it was already in a few different games, countless script files, network-controlled configs etc.....
> it's troubles
> it's projects
> So now I'm often finding myself misspelling common words
> And all of this is intentional too!
:-D
CRIRCLE = 2
CIRCLE = CRIRCLE
You may notice that a lot of the code in Allegro spells 'palette' as 'pallete'. This is because the headers from my old Mark Williams compiler on the Atari spelt it with two l's, so that is what I'm used to.“Tests pass, ship it”
Unicode sidestepped the issue by naming the characters RIGHT/LEFT-POINTING DOUBLE ANGLE QUOTATION MARK.
“U+034F COMBINING GRAPHEME JOINER
The name does not describe the function of this character. Despite its name, it does not join graphemes”
“The use of the spelling lamda derives from ISO 10646. This does not mean that it is more correct than lambda, merely that the spelling without the 'b' is the one used in the formal character names”
“A spelling error: "brakcet" should be "bracket". A formal alias correcting this error has been defined”
I wrote my code and was fairly confident it was correct, submit the answer and it is rejected, spend the next few hours trying to find the logic error. Of course it's because English is ridiculous and it's "forty" instead of "fourty".
It doesn't catch everything however.
Even better, the library was called into as a COM object by a Visual Basic Script script, and the misspelled corner case only got hit rarely. Figuring out that the problem was the correctly spelled function call was a joy.
https://appstoreconnect.apple.com/apps/pricingmatrix/1539646...
It shows the tiers from 0 (free) to 87 (USD 999).
Then come the party tiers: 510, 530, 550, 560, 570, 580, 590 which are just repeats of the other tiers, probably for some good historical reason which I'm not aware of.
Those are the price adjusted tiers. They look like repeats in USD, but if you look at other currencies you’ll see they’re different. They’re designed to allow you to offer price points that are scaled according to the market (i.e, 99c in the US, but considerably cheaper than that in India or China).
It is interesting that things are not priced in "buying power", but in numbers that aim to most deceive. ("It's not even a dollar!")
enum PricePoint {
//all the 500+ price points defined above...
REGULAR_PRICE = 1023;
PROMO1_PRICE = 1047552;
PROMO2_PRICE = 1072693248;
AUTOHINT_ROUND_99 = 1073741824;
AUTOHINT_BUYING_POWER = 2147483648;
}
Little bit twiddling, and you can encode 3 prices + some flags in an uint32.