A good CS101 coursework task

5:10pm, 30th July 2003

Last summer I learned C++ and Python, finally grokking object orientation. Thrilled with my my newfound objectivism (haha! I’m so funny!) I set about writing a complete simulation of the entire universe, first in C++, and then in Python when I got bogged down in things like copy constructors.

You might be surprised to know that I didn’t succeed. What I was actually trying to do was reimplement my favourite game of all time, Frontier Elite II. I figured that all the interesting parts of the game stemmed from the variations in the star systems, and that these variations stemmed from their physical characteristics, which in turn are caused by the type of star, which is caused by their local group’s properties, and finally the location (radius, in fact) in the galaxy. I made a big class heirarchy, with Galaxy at the top and City at the bottom. Although I failed to simulate the universe, my little python program really did produce a complete galaxy filled with planets and cities and all the rest.

Trouble was, my python skills were so awful that the code was line noise quality, and the resulting Galaxy object had no way of being inspected, mainly because by the time I’d finished implementing all the functions to generate the stars and planets and cities and governments, I’d forgotten how it all fitted together, and there was no way I could read my own code to work it out. I know all the individual pieces were there and working, but I never saw the whole. Then I went back to university and forgot about the lot of it until now.

There’s no conclusion to this story. I just thought it was a shame that a galaxy could be generated over and over again, subtly different each time, always in the shape of a galaxy, but never seen by anyone. Who knows what the random number generator might’ve come up with? Maybe none of it worked after all, and I’m just imagining things.


Today’s reading theme: category theory

5:14pm, 30th July 2003

More MLP, with the things I thought about while reading.

  • I just read Vernor Vinge’s True Names, and a phrase popped out at me:

    …being a person is more than symptoms.

    As far as I can tell, no, it isn’t. You can’t devalue emergent phenomena just by calling them symptoms. Hate is just a chemical reaction, but what a chemical reaction! You can’t dismiss something just because you think you can categorise it.

  • Guide to Philosophy on the Internet → Comprehensive.
  • Changelog for Python 2.3 → Tons of interesting stuff, and it lead to…
  • The N Queens Problem → Read it, it’s good. Very nice introductory example of algorithmic thinking.
  • Logic File System → There’s definitely something in category theory…
  • n-categories → It’s everywhere. I don’t know anything about it and already it seems like the answer to knowledge representation, AI, language design, string theory, and the very essence of Pattern! Granted, that’s the best case scenario. The explanation might, in fact, be very localised, limited to merely our own galaxy. If I do a PhD, it has to be in this.

Worst Pun Ever

9:38pm, 30th July 2003

I wrote an awful, horrible pun a while ago. Here it is:

Once upon a time, in an ancient Swedish village, there lived an old man, Marten Senburg. He was no ordinary old man though; he was the Orchard King, and all the fruit growers of the land bowed down to his wisdom. His birthfruit was the Banana, and he was popularly known as The High Marten Senburg, or King Banana for short. He had three sons, Jens, Lars and Sven, each born a year apart, and they were known as Prince Grapefruit, Prince Apple, and Prince Orange.

Jens was a reliable and traditional prince, who could be counted on to always do what was expected of him, to be in the right place at the right time, and be an upstanding pillar of the community. Sven was similarly well respected, and together, they effectively ruled the groves while their father’s health declined. Lars, however, was different. Being the middle son had left him struggling to find an identity, and being somewhat smaller than his brothers, he had been unfairly picked on for most of his life. He had rejected the ways of fruit farming, and had left town to become a ballet dancer.

Meanwhile, back home, in the local school, Olof and Carl were talking to their teacher about their fruity royal family…

“Sir, could you help me and Carl settle an argument? ” asked Olof.
“Of course,” said Mr Hendrick. “About what?”
“Prince Apple” said Olof. “I heard he’s in Stockholm, although I don’t know what he thinks he’s doing there.”
“You’re wrong!” said Carl. “I heard he’s given up ballet, and is going to law school, but nobody knows where!”
“Calm down lads,” said Mr Hendrick. “You could both be right!”
“I doubt it.” said Olof.
“Why’s that?” enquired Mr Hendrick.
“Don’t you know? He’s High Senburg’s son, sir: dainty Prince Apple.”

Ba-da boom-chi!

Update 26/10/2004: Since so few people seem to understand this, here’s a hint.