Reply to post: Ah - memories...

Coding with dad on the Dragon 32

Martin Milan

Ah - memories...

Anyone remember "Quest" - the BASIC game that was included with the Dragon32?

My mission to pop down and teach the Warlock a few things was made infinitely simpler when I discovered currency trading lol... You see, the game's internal currency was "gold coins", and lots of things could be bought and sold in the game - including, interestingly enough, gold coins...

Rather than correct this oversight and actually treat coins as currency as opposed to a tradeable inventory item, the developer decided not stop any naughtiness by checking that for blaggards like me who would offer to sell a gold coin for the princely sum of two gold coins - by writing a test that effectively looked for price_per_coin < 2.

Had that test been price_per_coin <= 1, the Warlock would have remained a happy man. Sadly, I rather got into the habit of selling coins for 1.9999999999 gold coins - building up quite a little nest egg for myself in the space of five minutes, allowing me to purchase a rather impressive militia to wonder down to warlock central to explain what's what - usually in one very decisive battle...

Happy times - and an example I still use to this today to illustrate decent validation to junior developers...

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon