Last active
June 1, 2017 14:33
-
-
Save ducc/18dfcfbda4454855ace2067be9eb7b3c 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
// we have a school which has 10 teachers | |
school | |
teachers = [10] | |
// each lesson requires a teacher | |
lesson | |
teacher | |
// when the lesson starts get an available teacher | |
on start | |
teacher = school.get available teacher | |
// when the lesson finishes the teacher is no longer needed | |
on finish | |
school.put back teacher | |
// run 20 lessons throughout the day one after the other | |
for 1 to 20 | |
new lesson |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment