The Rule Choice Algorithm

This is the first version of the rule choice algorithm. It works only for Oben, Unten and Coiffeur RuleSet, yet. But for this it is quite good.

In semi-pseudo-code

  1. For RuleSets(j), j=1..n do
    1. B(i) = #Bock(i)/(i+1)
    2. C(k) =
      • IF #Color(k)-2>0 THEN #Color(k)-2 * #BockeInRow(color=k)
      • ELSE #BockeInRow(color=k)
    3. BOCK(j) = SUM(B(i),i=0..8);
    4. COLOR(j) = SUM(C(k), k=0..3);
    5. NUMCOLORS(j) = NUMBER OF DIFFERENT COLORS IN THE PLAYERS HAND
    6. ESTIMATE(j) = BOCK(j) + COLORS(j) + NUMCOLORS(j);
  2. R = RULESETNUMBER(MAX(ESTIMATE));
  3. RETURN RuleSet(R)

In words:

  1. The more high Bock Cards, the better
  2. The more Bock Cards in a Row , the better
  3. The more Cards of a Color, the better
  4. The more different Colors in the Players hand, the better