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-30 20:22

>>56
or you make it ENTERPRISE and do:

Weapon *weapon;
// 0 = single weapon, 1 dual, attack with first, 2 dual, attack with second
// it's ugly but I need to deliver the code by tomorrow, or else the boss will kill me.
if(attacker->dual_wield != 0) {
    weapon = (attacker->dual_wield == 1) ? attacker->first_weapon : attacker->second_weapon;
} else {
    weapon = attacker->weapon;
}
// Now your active weapon is ``weapon''! please be careful with it.

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