start
define:
energy_max = 10; //maximum energy available to perform a task, also starting energy
xp = 0; //starting experience
task_action = 0; //0: no task has been assigned, 1: task has been assigned
task_status = 0; //0: task not completed, 1: task completed
task_count = 0; //starting number of completed tasks player has
while task_action == 1 and task_status == 0 //task has been assigned but not completed
energy_max = energy_max - task_energy;
if energy_max < 0 //check that character has enough energy to carry out assigned task
then print("Not enough energy, need energy boost. Task will be aborted.") //warn player that extra energy is required to complete task
else xp = xp + task_xp; //increase player's experience from completing task
task_status = 1; //task completed
task_action = 0; //assigned task has been completed
task_count = task_count + 1; //note number of player's completed tasks
end