Apr-17-2017, 04:19 PM
I've merged the threads together. Those of us who help out, check the whole forum, so posting multiple times doesn't really help you at all.
With these sorts of problems, it can help to write out different situations that can happen, and then take a step back and see if any patterns exist. From there, writing the actual code is almost easy, it's the ideas and structure that you need to think about.
For example, you probably don't want to type in each guard's name every time you run the script. Do you want the schedule to remain roughly the same week to week, or do you want to vary it so the same people don't work the same shifts all the time? Either way, I think the first thing you should do is create a small database (sqlite and sqlalchemy make this very easy) to keep track of the guards, and another table to keep track of their shifts.
With these sorts of problems, it can help to write out different situations that can happen, and then take a step back and see if any patterns exist. From there, writing the actual code is almost easy, it's the ideas and structure that you need to think about.
For example, you probably don't want to type in each guard's name every time you run the script. Do you want the schedule to remain roughly the same week to week, or do you want to vary it so the same people don't work the same shifts all the time? Either way, I think the first thing you should do is create a small database (sqlite and sqlalchemy make this very easy) to keep track of the guards, and another table to keep track of their shifts.