Roll dice

1円

Distribute tips

sorting the chart

die1

die2

record history

1. Set the number of tips & pips of a dice.

2. Start a game by distributing tips.

3.Roll dices to exchange a tip. 
   Repeat AMAP.

[Sorted]

bankrupt possible

4. Chart configuration

bank
rupt

old: {0, 9, 9, 3, 6, 9}
dice2 = 5
dice1 = 3
pips = 6 (slider from 6 to 20, step 2)
delta = Sequence(If[k ≟ dice1 ∧ (k ≠ dice2), -1, If[k ≟ dice2 ∧ (k ≠ dice1), 1, 0]], k, 1, pips)
totalTips = 36 (slider from 30 to (10 * pips), step 2)
startTips0 = Sequence(Random[1, pips], k, 1, totalTips)
freq = Frequency(startTips0)
uniq = Unique(startTips0)
startTips = Sequence(If[IndexOf[i, uniq] > 0, Element[freq, IndexOf[i, uniq]], 0], i, 1, pips)
history: {{5, 8, 6, 9, 6, 2}}
k: 0
v = (-1.7, 0.86603)
Pts = Translate(Sequence[(cos(((2 * π / pips) * k)), sin(((2 * π / pips) * k))), k, 1, pips], v)
t = 1 (slider from 0 to 1, step 0.1)
dices2: {}
dices1: {}
B = Translate((cos((4 * π / pips)), sin((4 * π / pips))), v)
A = Translate((cos((2 * π / pips)), sin((2 * π / pips))), v)
poly1, AB, b, c, d, e, f, g, h, i, j, a, l, n, p, q, r, s, a_1, b_1, c_1, d_1, e_1, f_1, g_1, h_1, i_1, j_1, k_1, l_1, m_1, C, D, E, F, G, H, I, J, L, M, N, O, P, Q, R, S, T, U, V, W, Z, A_1, B_1, C_1, D_1, E_1, F_1, G_1 = Polygon(A, B, pips)
new: {}
K = Dilate(((1 - t) * Element[Pts, dice1]) + (t * Element[Pts, dice2]), 0.8, Point[(0, 0), v])
Kleft: K - (0.1, 0.125)
Kright: K + (0.1, -0.125)
xscale = 0.12 (slider from 0.01 to 0.2, step 0.01)
yscale = 0.11 (slider from 0.01 to 0.2, step 0.01)
ymax: (5 * Max[RemoveUndefined[{floor((2 * totalTips / pips / 5)) + 1, floor(Max[new] / 5) + 1}]])
labels = Sequence(Text[k, ((1.05 * cos(((2 * π / pips) * k))) + x(v) - 0.02, (1.05 * sin(((2 * π / pips) * k))) + y(v) - 0.03)], k, 1, pips)
yticks = Sequence(Text[k, (-0.1, (yscale * k))], k, 0, ymax, 2)
ygrids: {Sequence[Segment[(-0.05, (i * yscale)), (((pips + 0.5) * xscale), (i * yscale))], i, 0, ymax, 2]}
sort = false
text2: "\fbox{" + (LaTeX[dice1]) + "}\to\fbox{" + (LaTeX[dice2]) + "}"
tipTable1 = Sequence(Text[Element[new, k], ((1.25 * cos(((2 * π / pips) * k))) + x(v) - 0.05, (1.25 * sin(((2 * π / pips) * k))) + y(v) - 0.05)], k, 1, pips)
tipTable2 = Sequence(Circle[((1.25 * cos(((2 * π / pips) * k))) + x(v), (1.25 * sin(((2 * π / pips) * k))) + y(v)), 0.08], k, 1, pips)
text1: "#" + k + ""
rec = false
myHisto = Histogram((xscale * Sequence[k, k, 0, pips]), (yscale * If[¬sort, new, Sort[new]]))
flag: 0
Pips: {1, 2, 3, 4, 5, 6}
bankrupt = false
m: (Element[old, dice1] > 0) ∨ bankrupt
xyaxes: {Vector[(0, 0), (0, ((1.1 * yscale) * ymax))], Vector[(0, 0), (((1.1 * pips) * xscale), 0)], Text["member", ((pips * xscale) - 0.1, -0.1)], Text["tips", (0, ((1.1 * yscale) * ymax))]}