ORIGINAL: WiFDaniel
I still come back to probabilty distributions being a solid simulation tool used throughout the programming industry, beyond the field of board games. Substituting finite draw probability distributions is rarely used and then only when there is something in the real world that has a direct correspondence.
I am curious what probability distribution you plan to use. Could you give us a hint?
Daniel
No secrets there. The code is already written. It is the same as from CWIF but modified to reflect the changes in counters ADG made most recently (within the last year?). The only difference from the board game probabilities is that the pool is infinite so drawing a counter (regardless of what counter's number is) does not change the probability for the next draw. Each year the probability changes to match the chits from WIFFE.
Here's the code:
// ****************************************************************************
function PickEntryChit(Year: Integer = 0): Byte;
begin
if Year = 0 then Year := Game.Date.Year; // Default: use the current year
ChitYear := Year;
case Year of
1939:
begin
case RollX(rsEntryChit, 0, TEntryChitRoll.HighRoll, nil, nil,
TEntryChitRoll.RollRange) of
0: Result := 0; // 4 3 1
1..9: Result := 1; // 6 7 9
10..16: Result := 2; // 6 7 7
17..22: Result := 3; // 7 6 6
23..28: Result := 4; // 5 6 6
else Result := 5; // 2 1 1 (29)
end;
end;
1940:
begin
case RollX(rsEntryChit, 0, TEntryChitRoll.HighRoll, nil, nil,
TEntryChitRoll.RollRange) of
0..4: Result := 0; // 12 6 4 -> 5
5..23: Result := 1; // 12 8 10 -> 19
24..36: Result := 2; // 11 5 6 -> 13
37..45: Result := 3; // 10 3 3 -> 9
46..51: Result := 4; // 6 1 0 -> 6
else Result := 5; // 2 1 0 -> 1 (52)
end;
end;
1941:
begin
case RollX(rsEntryChit, 0, TEntryChitRoll.HighRoll, nil, nil,
TEntryChitRoll.RollRange) of
0..4: Result := 0; // 12 0 0 -> 5
5..24: Result := 1; // 13 1 1 -> 20
25..40: Result := 2; // 14 3 3 -> 16
41..52: Result := 3; // 14 4 3 -> 12
53..62: Result := 4; // 9 3 4 -> 10
63..66: Result := 5; // 5 3 3 -> 4
else Result := 6; // 1 1 1 -> 1 (67)
end;
end;
1942:
begin
case RollX(rsEntryChit, 0, TEntryChitRoll.HighRoll, nil, nil,
TEntryChitRoll.RollRange) of
0..4: Result := 0; // 12 0 0 -> 5
5..24: Result := 1; // 13 0 0 -> 20
25..41: Result := 2; // 15 1 1 -> 17
42..56: Result := 3; // 17 3 3 -> 15
57..70: Result := 4; // 13 4 4 -> 14
71..78: Result := 5; // 9 4 4 -> 8
else Result := 6; // 3 2 2 -> 3 (79..81)
end;
end;
else
begin // 1943 +
case RollX(rsEntryChit, 0, TEntryChitRoll.HighRoll, nil, nil,
TEntryChitRoll.RollRange) of
0..4: Result := 0; // 12 0 0 -> 5
5..24: Result := 1; // 13 0 0 -> 20
25..41: Result := 2; // 15 0 0 -> 17
42..57: Result := 3; // 18 1 1 -> 16
58..73: Result := 4; // 15 2 2 -> 16
74..85: Result := 5; // 13 4 4 -> 12
else Result := 6; // 8 5 5 -> 8 (86..93)
end;
end;
end;
end;