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:
Anonymous2010-10-29 16:44
// Command format:
// Commands:
// SAY {argument}
// MOVE {argument} -- Direction north, northeast, ettc
// WAIT {time_in_hours}
// ATTACK {enemy_id},{weapon},{target_location_on_enemy}
//Said command functions will return an int 0 = succeed; 1 = error
//////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int parse(char *x){
int size = strcspn(x," ")-1;
char *command;
char *arg;
char **argv;
int i,j;
if(size<=0)
return 1;