13/09/2011
I still can’t figure out exactly which operations are expensive in Python. My C/C++ can’t help me much because it seems that things aren’t implemented like I’d’ve expected—like lists that aren’t lists, but array lists, leading to
for operations you would otherwise expect to be
.

But a friend of mine—Olivier—showed me a simple, basic, yet rather effective tool to profile Python programs (I’m not sure if I should say script or not).
Read the rest of this entry »
6 Comments |
Bash (Shell), Life in the workplace, programming, Python | Tagged: easy_install, Kcachegrind, optimization, Profiling, SquareMap, Trace, Valgrind |
Permalink
Posted by Steven Pigeon
06/09/2011
In a previous installment, I discussed the quality of English in comments, arguing that the quality of comments influences the reader’s judgment on the quality of the code as well.

That’s not the only thing that can make code harder or easier to understand. Today (anyway, at the time of writing), I was working on something where arbitrary-looking constants would constantly come up. I mean, constants that you wouldn’t know where they’re from unless there’s a comment. A clear comment. Let’s see some of those.
Read the rest of this entry »
4 Comments |
algorithms, C, C-plus-plus, C99, Mathematics, programming | Tagged: Comments, Constants, hexagon, Sphere, surface |
Permalink
Posted by Steven Pigeon
30/08/2011
Quite a while ago, I discussed map generation in the classic 80s-era game Tunnels of Doom. After a short correspondence with Kevin Kenney himself (who kindly answered my questions; and I hope he is aware that he contributed to the fascination of great many kids in computer science), I manage to, not exactly reproduce his algorithm, but create a number of fun variations.

Tunnels of Doom Combat Screen.
This raises the question as to how do we encode maps efficiently in the computer’s memory, not only for Tunnels of Doooooom but also for any number of other games.
Read the rest of this entry »
Leave a Comment » |
algorithms, bit twiddling, data compression, data structures, embedded programming, hacks, programming | Tagged: Dragon Warrior, Map, Map representation, Quad-Tree, Tunnels of Doom, Wumpus |
Permalink
Posted by Steven Pigeon
/* no comments (part II) */
06/09/2011In a previous installment, I discussed the quality of English in comments, arguing that the quality of comments influences the reader’s judgment on the quality of the code as well.
That’s not the only thing that can make code harder or easier to understand. Today (anyway, at the time of writing), I was working on something where arbitrary-looking constants would constantly come up. I mean, constants that you wouldn’t know where they’re from unless there’s a comment. A clear comment. Let’s see some of those.
Read the rest of this entry »