Hahahahaha , epic x 2 , that's exactly what i thought you would reply , word-by-word!
I typed mine on the go too.
Funny thing , i really liked the whole idea and afterwards my mind has been working on the complete design pattern of that shit. An object oriented design , where depending on user we will load the apropriate function , that will be pretty epic but it comes pretty close to what i do at work so it ruins the fun of being in here , LOLLLLLLLLLLL
Oh well, here's a fast version of it , on the go again:
struct UltimateTrainer
{
int assesmentFunc();
int trainingFunc();
int evaluationFunc();
struct trainingData{
....
....
....
}*data;
}
int goGetIt( string *athlete )
{
struct UltimateTrainer *my_trainer
my_trainer = initAthletesTrainer( athlete );
runUltimateTrainer( my_trainer );
}
struct UltimateTrainer initAthletesTrainer( string *athlete )
{
UltimateTrainer *my_trainer = malloc( ...);
if( athlete == 'raptor' ){
assesmentFunc = aquireListOfSafeExcercises( my_trainer->data );
trainingrFunc = attemptFatLoss( my_trainer->data );
evaluationFunc = checkIfFatLossAchieved( my_trainer->data );
}
return my_trainer;
}
runUltimateTrainer( struct UltimateTrainer *my_trainer )
{
my_trainer->assesmentFunc( my_trainer->data);
do{
my_trainer->trainingFunc( my_trainer->data);
}while( my_trainer->evaluationFunc() != my_trainer->data->user_goal );
}
HAHAHAHA , loving it!
Pretty geeky too
, LETS NERD THE FUCK OUT!