Created
November 14, 2021 17:45
-
-
Save Paul-cbt/9585064431ce4a10a10803bec15d3a37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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