All / Technology & Society

How C Built the Pyramid

In a bid to improve my understanding of the boxes of plastic I work with every day, I’ve started taking an online computer science course through EdX  (Harvard’s CS50–you too can share the fun!)  Part of this involves programming homework in a language called C.  Every geek’s reaction, when I tell them this, is basically summed up by my housemate’s reaction: it’s a bit like teaching someone to ride a bicycle on a penny-farthing.

So far I crash my penny-farthing a lot.  There’s been a fair amount of swearing, and flailing, and general gnashing of teeth.  One of the hardest things up to this point (bearing in mind I’m still in Week 1!) has been writing a loop in which the number of things being printed to the screen decreases for each iteration of the loop, so the loop is still counting up even though your output is decreasing.  (Hey.  It’s harder than it sounds, okay?)  That took a lot of very patient tutoring from my housemate, including him prompting me to literally walk through each step of the loop as though I were the compiler.  While being the compiler I discovered that my loop condition setting leaves a fair amount to be desired, for those with an interest in that sort of thing.

This particular homework challenge prints out a pyramid (more like the left half of a pyramid, really) of a height determined by user input.  If the user so wishes, though, she can request a pyramid of 0 height.  I was not very happy about this.  In fact, it filled me with a seething rage.

In which I demonstrate my usual decorum when dealing with technical challenges.

In which I demonstrate my customary decorum when dealing with challenging situations.

In time I was able to set aside my pyramid rage and build a program that functionally creates a pyramid based on user input (even should they, for reasons known only to their twisted innermost selves, ask for a pyramid 0 levels high.)

Look! It's (half) a pyramid!

Look! It’s (half) a pyramid!

And because I’m apparently a glutton for punishment, I’m starting a beginner’s mobile gaming course run by the University of Reading through FutureLearn on Monday.  (FutureLearn’s logo is a set of steps ascending from left to right.  Good thing I’ve already mastered that pyramid thing.)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s