Dies ist nur eine Erweiterung @ ragfield Antwort.
Clear["Global`*"];
count = 0; inRange = 0; i = 0; sumTgt = 10^5
Monitor[
While[count < sumTgt,
If[.14 < (rand = RandomReal[]) < .15, inRange++];
count += rand;
]
, {{"SumTillNow", ProgressIndicator[count, {0, sumTgt} ],count},
{"InRange", ProgressIndicator[inRange, Indeterminate],inRange}}
// MatrixForm
];
Wenn Sie die Fortschrittsindikatoren als animiertes gif für presententations und so speichern möchten, können Sie ändern:
Wenn Sie beschränkte und unbeschränkte Größen darstellen wollen, colud Sie etwas in dieser Richtung tun es ist ein bisschen:
count = 0; inRange = 0; i = 0; sumTgt = 10^4
Monitor[
While[count < sumTgt,
If[.14 < (rand = RandomReal[]) < .15, inRange++];
count += rand;
]
, a[++i] = Grid[
{{"SumTillNow", ProgressIndicator[count, {0, sumTgt}],count},
{"InRange", ProgressIndicator[inRange, Indeterminate],inRange + 0.}},
Frame -> All, Alignment -> {{Left, Center, Right}},
ItemSize -> {{Automatic, Automatic, 8}}];
];
Export["c:\Anim.gif", Table[a[j]//MatrixForm, {j, i}],"DisplayDurations"->{.3}]
und das Ergebnis ist:
Danke, das habe ich schon getan. – pAkY88