Perudo Game

NumberOfMyComingOut={0,0,0,0,0,0};PBiasedComingOut[TotNoDice_,NoInstances_,NoMyComingOut_:0,NoMyDice_]:=(TotNoDice-NoMyDice)!*(1/6)^(NoInstances-NoMyComingOut)*(5/6)^((TotNoDice-NoMyDice)-(NoInstances-NoMyComingOut))/((NoInstances-NoMyComingOut)!*((TotNoDice-NoMyDice)-(NoInstances-NoMyComingOut))!);PBiasedComingOutJolly[TotNoDice_, NoInstances_, NoMyComingOut_:0, NoMyDice_]:= (TotNoDice-NoMyDice)!*(2/6)^(NoInstances-NoMyComingOut)*(4/6)^((TotNoDice-NoMyDice)-(NoInstances-NoMyComingOut))/((NoInstances-NoMyComingOut)!*((TotNoDice-NoMyDice)-(NoInstances-NoMyComingOut))!)

Manipulate[ Text@Row[{
    Column[{
      Grid[choiceGr], 
      Grid[{{
         Button["Run", rollMany[1, num]], SpanFromLeft, 
         SpanFromLeft}}], "  ",
Grid[Join[{Prepend[If[Jolly,(Table[i,{i,1,6}]/.{1->"*"}),Table[i,{i,1,6}]],""]},(tot=Table[Prepend[Table[SetAccuracy[Sum[If[Jolly,If[i==1,PBiasedComingOut[TotNoDice,NoIstances,NumberOfMyComingOut[[i]],NoMyDice],PBiasedComingOutJolly[TotNoDice, NoIstances,NumberOfMyComingOut[[i]]+NumberOfMyComingOut[[1]],NoMyDice]],PBiasedComingOut[TotNoDice,NoIstances,NumberOfMyComingOut[[i]],NoMyDice]],{NoIstances,j, TotNoDice}],4.00],{i,1,6}],j],{j,1,TotNoDice}])/.{(x_/;x≤0.001)->Style["<0.001",Gray]}],Dividers->{2->True,2->True},ItemStyle->{1->Bold,1->Bold},Background->{Automatic, Automatic,Flatten[Table[Table[(If[tot[[i,j]]>0.5, {i+1,j}, {1,1}])->Yellow,{i, 1,TotNoDice}],{j, 2,7}],1]}]}]}],{{TotNoDice,TotNumberOfDice=30, "Total Number of Dice"},Table[i,{i,1,TotNumberOfDice}]},{{NoMyDice,NumberOfMyDice=5, "Number of Dice in my Hand"},Table[i,{i,0,NumberOfMyDice}],Appearance->"PopupMenu"}, {{Jolly, False, "use Wildcard"}, {False, 
   True}}, 
  {{dice, {, , , , , }}, 
  None}, {{choiceGr, 
   With[{ni = 5}, 
    Partition[
     PadRight[Table[Image[ConstantArray[1, {24, 24}]], {ni}], 
      1*Ceiling[ni/5], ""], 5]]}, 
  None},  {{nsixes, 0}, None}, {choice, None},  {{num, NoMyDice}, 
  None}, {{rollMany, (choice = RandomChoice[dice,NoMyDice]; 
      NumberOfMyComingOut=Table[Count[choice,dice[[i]]],{i,1,6}]; 
     choiceGr = Partition[PadRight[choice, 5*Ceiling[NoMyDice/5], ""], 5]) &}, None},SaveDefinitions->True ]