Skip to content

Instantly share code, notes, and snippets.

@ducc
Last active June 1, 2017 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ducc/18dfcfbda4454855ace2067be9eb7b3c to your computer and use it in GitHub Desktop.
Save ducc/18dfcfbda4454855ace2067be9eb7b3c to your computer and use it in GitHub Desktop.
// 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