Skip to main content

Posts

Showing posts from August, 2009

Article interruption

I know I've been publishing an article every Tuesday and Friday since I started this blog, but there's been a death in the family, so I've been a bit preoccupied. I'll try to get a new article out soon, probably related to that particular situation.

SpaceRat - an exercise in game programming

Almost entirely throughout my life, I’ve had access to computers. In most of that time I’ve wanted to write computer games. Most of my attempts have been aborted early on, before even getting code written. Stacks and stacks of paper have been used to sketch characters and scenery. One day in 2001 I decided to put together a small Space Invaders-like game named SpaceRat . SpaceRat began as a set of graphics I had created for a friend’s clone of Space Invaders. I had drawn a “hero” space ship and some enemy ships. There were a number of enemy sprites that I did not use in SpaceRat, simple because they did not fit the look I was going for. Starting off with pre-made graphics gave me the push I needed and gave me the opportunity to jump straight into programming the game. I was still in university, but was then employed in a co-operative education placement for discreet, a division of AutoDesk . Health problems prevented me from actually working at the time, and so to judge my ability ...

The Sky

When you’re far away from the city lights, the clear night sky is a beautiful thing. The constellations shine brightly, the Milky Way stands out clearly, and the Moon can provide all the light you need to see by. Living out here, I’ve had a chance to see wonderful things in the sky. Recently, the Perseid meteor shower provided my wife and I with a romantic bit of evening, with beautiful, astral accompaniment. We saw some spectacular meteors fall that night, and it was a welcome change from the cloudy night we had had previously. In the winter, on a snow-covered night, with the full Moon out, the snow sparkles beautifully and you can see almost as well as during the day. The silence is stirring and inspirational, and you can stand there in your winter gear, relaxed and at peace, almost losing track of time completely. To facilitate my Moon viewing, I wrote a small program called MoonPhase. You can find it where I keep many of my little projects at my main website . It shows the cu...

KnitPicker - a knitting stitch counter programming project

The art of knitting lace is an intricate process; it takes great skill with knitting and the ability to keep track of complex knitting instructions. One day, my wife Sophie was knitting a particularly complex pattern, and she complained about not being able to keep track of how many stitches she should have for a particular row or how many should be left in the next row. Enter the programmer! I’ve been throwing together little utilities for myself for ages. Sometimes I want to calculate some value that would take too long by hand; sometimes I want to sort a list in some particular way. Other times I have trouble deciding what to have for dinner, so I’ll write up a list of options and then pop in a random number to pick from it. I have one such script from ages ago that I used regularly when living in Montreal. It was clear to me that Sophie needed software to handle her problem. With instructions spanning up to a hundred stitches, it’s the sort of thing that’s hard to keep track of...

Interactive Fiction - Finding the Mouse

For as long as I’ve been using computers I’ve known of text adventures. Using your imagination and the words on the screen, you construct a world in your mind and then interact with it through the computer by typing in commands. The goal is usually to solve different puzzles in order to come to some sort of winning scenario. Nowadays text adventures have given way to interactive fiction, or IF. Much like text adventures, there is often a goal to reach. However, some can be entirely freeform and offer the reader a variety of scenery and possibilities to explore. They still stick to text as their means of communication and rely on the reader to imagine the scenery. There’s still usually some sort of puzzle to solve, and this can provide a lot of fun for some. The interactive fiction community is still going strong. There are plenty of archives out there for the curious reader to explore; the most prominent being the IF Archive . There’s a newsgroup at rec.arts.int-fiction (Google Groups...

Canadian Medicare and #welovethenhs

Health care, of all the services available, is almost certainly the most important one many of us will ever make use of. Without adequate health, our performance degrades at work, our enjoyment of life decreases and some of our routine responsibilities become uphill struggles. And yet, in some nations not everyone has affordable access to it. In Canada, we have tax-funded, universally accessible health care under the label Medicare. Tommy Douglas, a former premier of Saskatchewan, fought hard with the Federal government of his time to develop Medicare. For his efforts Canadians voted him the Greatest Canadian in 2004 through a CBC-run television series. Another prominent Canadian involved with supporting the creation of a system of socialized medicine was Norman Bethune . He went to China during the Japanese invasion in 1938 and acted as a battlefield surgeon, bringing anti-septic practices to Chinese medicine, a system of training doctors and nurses, and treated both Chinese and ...

Piet - an esoteric programming language

There’s a certain group of programmers out there that like to come up with programming languages just for the fun of it. Some of them have profanity as their names , and some are based on internet memes . Whatever the case may be, some individual out there enjoyed thinking up the language, and many of these languages are actually useable. One esoteric language that stands out, for me, at least, is Piet , created by David Morgan-Mar. Based on the idea of making programs that look like abstract art, Piet allows the programmer to express their software in the form of coloured blocks. Numbers are represented by blocks of pixels containing a pixel count equal to the number itself. Operations are performed by changes in hue or darkness. As an example, here is a Piet program I wrote to output the string “Hello World”. This image is in fact the entirety of the program, and can be run in any of the Piet interpreters out there. Other examples of Hello World programs are available on David’s si...

Aldebaran Colony

This is a quick little story I whipped together one day as a writing exercise. That's mainly the sort of stories I'll be putting up; 1000 word vignettes that I wrote during a day. Here it is: Why they had thought they needed a podiatrist on the colonization team was something Harry Jones couldn’t figure out. He wasn’t even one of the best podiatrists, although he had his moments. It wasn’t as if he wasn’t happy to be along. He was, in fact, overjoyed when he was given the news. It had just come as a bit of a surprise to him that he had been selected to join the ten thousand other people on the colony ship bound for Aldebaran 5. The ship had been equipped with a new Petrescu-drive engine, which would allow them to cross the distance between earth and the Aldebaran system in about 15 seconds. There had been some hushed conversations between the scientists setting up the engines, but Harry was confident that the colonists’ best interests were being kept in mind. After all, it was...

The Buddhabrot

Ever since I got my first glimpse of computer-generated fractals, I was hooked. The Julia and Mandelbrot sets captured my imagination, and I knew I had to make my own generator. At the time all I felt comfortable programming was a TRS-80 Colour Computer 3 , and I had a shaky knowledge of the complex numbers needed to calculate such fractals. My first attempts failed to properly render the Mandelbrot set, since I had not realized the need for an extra step. When I finally got comfortable with C, I wrote another Mandelbrot generator. You can find it at the bottom of this page . It requires a pre-Mac OS X PowerPC Mac, but has some nifty optimizations I was quite proud of at the time. However, unlike some Mandelbrot generators of the time, the optimizations still just got pixels onto the screen faster, and eschewed any larger-scale optimizations. Other programmers had used techniques such as outlining boxes in the fractal, then filling them in with the colour of the border. This made ...

The Idea Oubliette

A lot of thoughts pass through my mind in any given week. Some of them drive me to research a particular subject, others get me started on a project. But I have more ideas than I can use myself, and so some of them I'll take a look into and post them up here. Sometimes I just want to try something out, and I'll post my attempts up here. Every month or so I'll also post a short story. These will be about 1000 words, and usually science fiction. I occasionally get a hankering to write horror, so maybe there'll be some of those as well.