Monthly Archives: January 2004

OSCON Presentations

I just submitted my OSCON presentation proposals. For the ignorant, OSCON is the O’Reilly Open Source Conference, where the big Perl conference is held. It costs upwards of $1000 to get in, and I have thus never been before. But! if you do a talk, they waive your entrance fee. I’ll be submitting these talks to YAPC (Yet Another Perl Conference) once the submission form comes up, though the $80 entrance fee isn’t much to be waived (go YAPC!).

The first one is entitled “A Language For Games,” and in it I will be presenting GLIC (which is coming along nicely, by the way). I’ll write some simple “game scripts,” probably Sokoban or Pac-Man, to introduce people to the language. Then I’ll discuss the more advanced concepts. That’ll be cool, though I’m not sure if it will be accepted.

The other I’m quite sure will be accepted. It’s called “Compiler Writing with Perl,” and in it I discuss all the modules, machinery, etc. necessary to write a compiler with Perl. And I’ll be talking about Parrot as a target language, so I get to present something related to Perl 6, which the community should enjoy.

In related news, Synopsis 3 is almost done, and should be going on soon. My first published Perl 6 document!

Mac OS X: The present

I’ve been using my mom’s shiny new PowerBook G4 while she’s in Peru. I’m to the point where I’m making the computer my own (well, she still has her account; I hope my changes don’t affect it too much) and I’ve realized something. I kind of knew it all along, but not to this degree. Microsoft, you are waaay behind! And unless Microsoft pulls some wicked moves (they will), they are going to fall behind in the market.

I love Aqua, Cocoa is fantastic (Objective-C in general rocks), and I think I’m permanently in love with Exposé. Not only that, but the software support ain’t so bad anymore either, neglecting games. Hey, I’ll be sure to fix that!

I can run X11, and thus my favorite Linux apps (GIMP, Armegatron, Enigma). I have virtual desktops, perhaps the greatest thing UI-wise to come out of open source. I can still hack on Parrot. This little teeny computer still has a pretty sweet graphics card (certainly better than my Windows box), so I can write nice-looking games.

In summary, um, well you don’t need me to say it. How can I put it most eloquently, so that you’ll remember…?


La clase de Java

Yesterday the “Advanced Java” class just started actually coding. I thought the class would be interesting, as there are people with so much experience in the room. People with a masters degree in something or other who used computers extensively back in the punchcard days, etc. There’s a guy who had worked at IBM for ten years. I couldn’t believe it! Why are they taking a Java class at Front Range?

But after they actually started programming, it became painfully obvious that I was the best programmer in the room. Not obvious to them (yet :-), just to myself. We’re designing this GUI database interface with labels that change based on the locale. And the teacher’s solution kept a JLabel variable for each label! When he wanted to change the locale of each label, the code looked like:

    updateLocale(languageLabel, locale);
    updateLocale(savingsLabel, locale);
    updateLocale(contribLabel, locale);
    updateLocale(incomeLabel, locale);
    updateLocale(currentAgeLabel, locale);
    updateLocale(retireAgeLabel, locale);
    updateLocale(deathAgeLabel, locale);

Ugh (And I hate camelCase, but alas, ’tis the Java way). And he had this sort of thing in three places in the program. What a nightmare to maintain! And he didn’t even align them!

Thankfully, we don’t have to use his code. Most everyone did it the way he did. I put them in a list and looped through them when I needed to. The teacher “blames” that on my Perl origin.

This should be a fun class, though, because there are few programming projects that are monotonous unless a specific coding technique is enforced, which it isn’t (well, as much as Java doesn’t). It’s always interesting to come up with a design that significantly reduces my workload.


I finally beat my friends at poker for the second time :-). I’ve been doing a lot of studying recently, and it’s paid off. I’ve read two books on poker, and I’ve been playing online a bit.

I’m truly fascinated with how versatile a game it is. Limit poker is, in many respects, opposite from no-limit and pot-limit. Obviously, they both emphasize computing odds, but limit poker is about pot-odds while no-limit is about implied odds, two very different beasts. And no-limit has a huge emphasis on bluffing, while in limit it is usually wrong to bluff.

And I’m only talking about Texas Hold’em. Omaha Hold’em is vastly different, where you have to expect your hand to go somewhere by the end, and betting on the best hand at the moment (as you sometimes do in Texas) is a big mistake. And then there’s 7 card stud, which I still have no idea how to play :-).

And I’m pretty close to the point where playing online isn’t costing me anything: that is, it’s returning about $5 per hour, certainly more than most games I like, and worth my time for something I enjoy doing.

Fun Theory

Here I am, playing a game of $0.25/$0.50 Texas hold’em on one of the poker sites1, reading “Pot-Limit and No-Limit poker” by Reuben and Ciaffone between hands (yes, I like Poker). The book has become technical and dry, and I’m losing interest. So, I’ll blog instead.

I’m finding myself increasingly interested in the “theory” of that which makes games fun. It’s interesting how certain very simple sets of rules can give rise to a dull and boring game, while a slight variation on those rules can make a rich and entertaining game.

The first commandment of a good game, I have found, is the ability to tell whether you’re winning or losing. You see, because if you’re winning, you are inclined to push it that much further and finish the game. If you’re losing, then you feel that grandeur of coming back if you win.

Notice that a very popular game among game theorists is Nim, which doesn’t possess this property. Nim is what I call a flip-flop game, where each move switches who might win. Another game like this is J.H. Conway’s “sprouts.” I’ve never found these games very entertaining, and note that no popular games have Nim roots.

But, taking sprouts and adding a goal of interconnecting several dots completely (and the opposition’s goal to stop this from happening), and it becomes a fun and interesting game. That follows the first commandment, since if you’ve interconnected three dots, you’re half way there. Sprouts was awful — you had basically to forsee the entire game to decide what to do. Not only that, but it scales horribly (forseeing a game with twelve dots is impossible for any mere mortal).

Tune in next week to find out the next commandment (supposing I figure out what it is)!

1The name of the site has been removed because they blog-spammed me.

English is “simplifying” itself

I’ve been noticing a certain trend in common spoken English: people have no idea what they’re doing with case. For instance, the accusative case is now being used whenever it comes after the verb, instead of only when it’s an object of some verb; eg. “I’m not as good as him.” While I would postulate that the language itself is changing in this direction, I hear things like: “My father gave those to my sister and I” and “Whomever can hold their breath the longest wins.”1

It’s the classic “deterioration of language” phenomenon, which usually isn’t deterioration at all. I just don’t see where this particular change is simplifying things. Case might be working its way out of pronouns just as it has out of nouns, so we’d get a very order-dependent language (yay, making things even more ambiguous for us computational linguists).

1But all is lost with “who” and “whom” anyway, since very few people, even in the educated world, know what’s going on there.


I thought of a new game tonight. I’ve only been able to play against myself so far, but it seems pretty good from that. I encourage people to try it with their friends and give me feedback.

You need a checkerboard, two white and two black pawns, and a set of poker chips (checkers pieces will do if you have enough of them). Set up the board like this (where red & blue are poker chips, and black & white are pawns):

The game consists of alternating turns. A turn consists of either freely placing one red or blue chip (so long as it’s not on top of another one) or moving one of your pieces. Pieces can move an arbitrary number of squares in one turn, as long as they stay on the same color chip. Diagonal moves are not allowed. Each time a piece leaves a chip, the chip is removed. So, once a path is traversed, it must be re-placed before it can be traversed again.

In order to win, you must get to the opposite side of the board; i.e. black to the top, white to the bottom in the diagram. Either that, or you must surround both of the opponent’s pieces with the opposite color, such that, given an infinite number of consecutive moves, they would never be able to get to the opposite side.

So, both of the following boards are black wins:

The left because the black piece got to the top, the right because both white pieces were surrounded (since diagonal moves aren’t allowed, pieces don’t need to be surrounded diagonally: just like Go).