Pollyanna's Goatee











{Sunday 6th September '09}   Programming Praxis V

The “Perch” is a roulette betting strategy based on ignorance of the “Gambler’s Fallacy”: the gambler perches in a position where they can monitor all roulette tables; when a roulette table has had a run of red or black for the past four spins, the gambler places the minimum £10 bet on the opposite colour, reasoning that a run of five of the same colour is unlikely (the “Gambler’s Fallacy”, as the probability of the fifth spin landing on a given colour is the same as the first spin landing on a given colour); if the bet fails and the run of the colour continues, the gambler reasons that the odds of six in a row are even more unlikely, and increases their original bet by 50%; if that bet too fails, the gambler returns to the perch; the strategy ends when the gambler has either achieved their target winnings, or has insufficient money to place the £10 minimum bet.

Anyway, this {source code & compiled:Mac OS pre-X} is my solution for the fifth Programming Praxis held by The Daily WTF: a program to play roulette using the “Perch” strategy, with a user-entered number of roulette tables, starting amount of money, and target amount of money; the program ends when it has either achieved the target amount of money or has insufficient money to place the minimum £10 bet.

The solution was developed on an Apple Power Macintosh 8100 in C compiled with Metrowerks CodeWarrior IDE 2.1 (Discover Programming Edition.)



{Monday 3rd August '09}   Programming Praxis I

Supposedly, Russian peasants perform multiplication in the following interesting fashion: they write the two numbers which are to be multiplied at the top of two columns; then, they multiply the number in the right column by two, and divide the number in the left column by two – throwing away any fractional part – continuing until the number in the left column is one; then, those numbers in the right column whose corresponding number in the left column is odd are added together to produce the result.

Anyway, this {source code|compiled:Mac OS pre-X} is my solution for the first Programming Praxis held by The Daily WTF.

The solution was developed on an Apple Power Macintosh 8100 in C compiled with Metrowerks CodeWarrior IDE 2.1 (Discover Programming Edition.)



et cetera
Follow

Get every new post delivered to your Inbox.