Nouveau mélange

Démarrer

Compter

Stop

RAZ

1

0,9

0,8

0,7

0,6

0,5

0,4

0,3

0,2

0,1

noir = 3 (slider from 0 to 10, step 1)
boule = Random(1, 10)
aspectratio: 3.09524
A = Point(yAxis)
c = Circle(A, 4)
cc = Semicircle((0, 4), (0, -4))
B = Point(cc)
a = Line(A, B)
C = Intersect(c, a, 2)
b = OrthogonalLine(C, a)
d = Circle(C, 4 / aspectratio)
D, E = Intersect(d, b)
e = OrthogonalLine(E, b)
f = OrthogonalLine(B, a)
F = Intersect(e, f)
G = Point(yAxis)
α = Angle(B, A, G)
couleur = If(boule ≤ noir, 1, 2)
dep: (0.05 * (Corner[2] - Corner[1]))
Ds: Corner[1] + (0.8 * (Corner[4] - Corner[1])) + (0.1 * (Corner[2] - Corner[1]))
liste1 = Sequence(Ds + ((i - 1) * dep), i, 1, noir)
choisir = false
liste2 = Sequence(Ds + ((i - 1) * dep), i, noir + 1, 10)
achoisir = false
bouteilleup: α ≤ 45°
nouvelle: bouteilleup ∧ achoisir
bouledisp = 10
bouteilledown: α > 100°
nnoir: 0
nrouge: 0
ntotal: nnoir + nrouge
propnoir: (100 * nnoir / ntotal)
proprouge: (100 * nrouge / ntotal)
couleurdisp = 2
bouleacompter = true
compter = true
parinoir: round(propnoir / 10)
parirouge: 10 - parinoir
SimuN: (ntotal, propnoir)
SimuR: (ntotal, proprouge)
g: y = (10 * noir)
h: y = (10 * (10 - noir))
solution = false
texte1: "Nombre de boules noires: " + nnoir + "
nombre de boules rouges: " + nrouge + "
Nombre de lancers:   " + ntotal + ""
H = (-59.4951667830189, 103.41825718799367)
I = (-10.784306641509469, 103.41825718799367)
J = (-10.784306641509469, 1.46885860979462)
K = (-59.4951667830189, 1.46885860979462)
q1, h_1, i, j, k = Polygon(H, I, J, K)