Skip to content

Instantly share code, notes, and snippets.

@Paul-cbt
Created November 14, 2021 17:45
Show Gist options
  • Save Paul-cbt/9585064431ce4a10a10803bec15d3a37 to your computer and use it in GitHub Desktop.
Save Paul-cbt/9585064431ce4a10a10803bec15d3a37 to your computer and use it in GitHub Desktop.
Resultat run(Status baseStatus) {
var currentStatus = baseStatus;
var numberOfDormir = 0;
var numberOfMangeoire = 0;
var numberOfRoue = 0;
for (var i = 0; i < nombreExecution; i++) {
switch (currentStatus) {
case Status.dormir:
numberOfDormir++;
break;
case Status.exercice:
numberOfRoue++;
break;
case Status.manger:
numberOfMangeoire++;
break;
case Status.reveil:
// numberOfDormir++;
//waking up, he is still at his sleeping place
break;
default:
}
currentStatus = getNextStatus(currentStatus);
}
return Resultat(
numberOfDormir: numberOfDormir,
numberOfMangeoire: numberOfMangeoire,
numberOfRoue: numberOfRoue);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment