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-11-02 18:51

You're all doinitwrong

#ifndef WEAPON_H
#define WEAPON_H

#define DEFAULT_AMMO -2
#define DEFAULT_DAMAGE 0x80000000
/* etc */

struct weapon
{
 enum { NONE, MELEE, RANGED, SPECIAL } type;
 int id;
 int ammo, damage;
};

struct weapon *weapon_new();
void weapon_free(struct weapon *);
#endif

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