Forum Moderators: coopster
If you need a bit of background, I am coding a script for a Family and Consumer Sciences teacher at a local middle school. The script generates a schedule for each student in the class, telling them what module to go to in what order. It has the following restrictions: Two students cannot be partnered more than once, and a student cannot be in a given module more than once.
Any help would be appreciated.
It would produce something like this
Already in value:
0,
0,
1,
1,
2,
2,
.
.
.
What should happen
0,9,
0,4,
1,2,
1,6,
2,1,
2,4,
.
.
.
I think i may be going about this the wrong way, so I am open to any suggestions about how I should change or rewrite this.
I drew this out on paper, so let me try to explain how I got it to work faily easily.
Pretend you have three circles each with the number of modules and students, the inside one stays still, the middle one rotates +1 at a time, and the outside one rotates +2 at a time.
The outside circle will rotate on odd numbers, and complete a rotation in 1/2 the time of the middle group, putting the outside group back at point 1, but with only half of the modules done, the middle group will be at the half way point, with half of the modules done also.
You could then put the outside group on the even numbers they missed, and keep the middle rotating at +1. They should all finish at the same time, but not repeat because of the difference in the speed of the rotation.
Hope this makes sense & helps.
Justin
Added: I don't have time to do the math, right now, but I'm sure you can find an equasion to do the trick =)