Mistmanov wrote:voidptr wrote:"Wait... this programming competition requires me to write code? That's so lame!"
It does sound kinda bad when you say it like that![]()
Anyway, I went for the quick and dirty option.. removing all of the "consts" and the "&" signs (have no idea what they do, but eh..),
Briefly and incorrectly, "&" in C++ means the same thing as "*" in C, except that when you use the variable, it has an implied "*" in front of it, and when you initialize the variable, the initializer has an implied "&" in front of it. It's called a "reference", because it can be used to implement pass-by-reference semantics. Look it up for more information.
It seems to do what I want it to do.. so I hope I can now go back to ignoring classes and stuff and pretending I'm coding C.
C++ doesn't force you to use classes, you know; you could rewrite all those member functions as plain old functions taking a parameter of type "struct PlanetWars *thisptr", and then you wouldn't have to worry about references or methods or anything. (Actually, part of my initial rewrite was to change "class" to "struct", remove all the "const" qualifiers, remove all the "public:" and "private:" keywords, and remove all the getter and setter methods, so that I could manipulate the objects without so many redundant() parentheses(). I only wish I'd bothered to remove the underscores from all the fields at that point; by now I've probably wasted at least that much time fixing places where I left off an underscore by accident.)
Or, I believe the server does support regular C now.