var world = new Environment();
var me = new Person("Bruno Pereira", "Software Developer");
world.addEventListener("onNewChallenge", () => {
me.quicklyFitNeeds();
});
world.addEventListener("onHelpRequest", () => {
me.tryToHelp();
me.shareKnowledge();
});
while (me.getLifeState() == LIFE_STATE.isAlive) {
try {
me.setFocus(world.getCurrentChallenge());
me.alwaysDoMyBest();
me.keepLearningAndImproving();
} catch (error) {
if (error instanceof MistakeDetected) {
me.workHardToFixASAP();
me.lifeExperience.add(error);
}
}
}