Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ - RPG

Name: Anonymous 2010-10-29 15:44

Lets program a roleplaying game together. Each post must contain either a new function or an edited version of an old function in psudocode. I will start:

int dealDamage(int hp, int damage){
    return hp - damage;
}

Name: Anonymous 2010-10-31 16:55

>>94
it's generally a good idea to be able to tell whether or not a given datum is initialized
In C, you have to rely on the good will of the programmer to use the constructor you've provided.
There are ways of determining whether a thing is initialised or not - this is why I put a NONE type in the enum (I assume the constructor calls calloc), but these are more simply sanity checks.
However, on macros, an optimising compiler could turn const declarations into literals, could it not? And a decent debugger would look for macro constants in the source.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List