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.


Leave a comment

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Please enter the following words to prove your humanity: