The earliest memory I have of ‘programming’ is in the early/mid 90s when my father brought home a computer from work. We could play games on it … so of course I took the spreadsheet program he used (LOTUS 123, did I date myself with that?) and tried to modify it to print out a helpful message for him. It … halfway worked? At least I could undo it so he could get back to work…

After that, I picked up programming for real in QBASIC (I still have a few of those programs lying around), got my own (junky) Linux desktop from my cousin, tried to learn VBasic (without a Windows machine), and eventually made it to high school… In college, I studied computer science and mathematics, mostly programming in Java/.NET, although with a bit of everything in the mix. A few of my oldest programming posts on this blog are from that time.

After that, on to grad school! Originally, I was going to study computational linguistics, but that fell through. Then programming languages (the school’s specialty). And finally I ended up studying censorship and computer security. That’s about where I am today!

But really, I still have a habit of doing a little bit of everything. Whatever seems interesting at the time!

Making Floupian Change

On the island of Floup in the South Pacific ((not a real place)), one might find coins worth 1, 3, 7, 31, or 153 floupia each. In addition, they have a most curious custom. Whenever one makes a payment of any sort, it is considered rude not to minimize the total number of coins involved in the exchange. For example, if someone were to purchase a nice refreshing beverage for 17 floupia ((the floupia is currently performing rather well against the dollar)), one might pay with three 7f coins and receive a 1f and a 3f coin in exchange for a total of 5 coins. But that would be terrible, as a more efficient solutions exists: pay a single 31f coin and receive two 7f coins as change.

read more...


Numbers as words in arbitrary bases

Today’s intermediate challenge on Reddit’s /r/dailyprogrammer intrigued me somewhat, so I decided to take a crack at it. The basic idea is if you are given a number, try converting it to all bases from 2 to 64 (with a special encoding). Print out any of those that are words.

For example, if you interpret the number 44,269 as a base 16 (Hexadecimal) number, you get the word “aced”. So just how many of these words are there out there?

read more...


The 147 Puzzle

Yesterday saw another puzzle from Programming Praxis, this one entitled The 147 Puzzle. The description is relatively straight forward. Find a set of k fractions each with numerator 1 such that the sum is equal to one.

For example, 1/5 + 1/5 + 1/5 + 1/5 + 1/5 = 1 is a trivial solution for k = 5. It turns out that there are 147 solutions when k = 5, thus the name of the puzzle.

read more...


#1GAM - ChessLike 1.0 - Did it!

Well there you have it. Three days to a feature complete game.

I ended cutting one of the kinds of levels, but other than that I got everything that I wanted in the game. It’s got 10 different kinds of pieces, 8 different kinds of levels (most procedurally generated), and statistics galore. It actually turned out to be kind of fun, although it’s a bit slower than I’d like. Not much I can do about that though without implementing a mouse interface (which I’ll probably do some day).

read more...


#1GAM - ChessLike 0.2.0 - Dungeons!

Here’s another day’s work on ChessLike. It’s actually a bit less full featured than yesterday, but I’ve made a lot of progress towards the dungeon framework that I’m going for.

read more...


#1GAM - ChessLike 0.1.5

Back around the last Ludum Dare, I decided to try out One Game A Month. Basically, the goal is to write one complete game per month, every month in 2013. Of course I’m great at putting things off until the very last minute–I finally started yesterday. So it goes.

read more...


Gregorian/Mayan conversion

It may be 1 uinal, 15 kin too late for the new baktun, but I’ve got some neat code to convert back and forth between the Gregorian calendar and the Mayan calendar. It’s based on a challenge on a post on the /r/dailyprogrammer subreddit. As one might expect, the goal is to be able to take a year, month, and day in the Gregorian calendar and return the equivalent Mayan Long Count corresponding to that date. As a bonus (which of course I had to do đŸ˜„), do the opposite and do it without using built in date functions.

read more...