I have ten men who each are assigned a number(obviousl y 1-10). I need to randomize them so that each man's number corresponds to each day of the month for the year. The days that the men are assigned have to be equal. The weekends have to be equal as well.
Integer syntax
Collapse
X
-
Could you show me an example of this, let us say for the month of April.Originally posted by RabbitWhat I would do is assign each person a number from 0 - 9 and then use a Modulo 10 to assign days to each person. This isn't entirely random as each person will come up every 10th day.Comment
-
Day 1 = 1, Day 2 = 2, Day 3 = 3, etc.
1 Mod 10 = 1 = Person 1
2 Mod 10 = 2 = Person 2
.
.
.
10 Mod 10 = 0 = Person 0
11 Mod 10 = 1 = Person 1
12 Mod 10 = 2 = Person 2
.
.
.
20 Mod 10 = 0 = Person 0
.
.
.
30 Mod 10 = 0 = Person 0
So with some sort of loop, you can loop through all the days and assign them accordingly.Comment
-
Comment
-
Thank you, but I do not understand. What is Mod?Originally posted by RabbitDay 1 = 1, Day 2 = 2, Day 3 = 3, etc.
1 Mod 10 = 1 = Person 1
2 Mod 10 = 2 = Person 2
.
.
.
10 Mod 10 = 0 = Person 0
11 Mod 10 = 1 = Person 1
12 Mod 10 = 2 = Person 2
.
.
.
20 Mod 10 = 0 = Person 0
.
.
.
30 Mod 10 = 0 = Person 0
So with some sort of loop, you can loop through all the days and assign them accordingly.Comment
Comment