Tag Info

New answers tagged


You are looking for a pattern suitable for loops which must terminate on a condition (rather than run a fixed number of times). While is a good solution for this, but the key is really Break[], which can be used in While, Do, For, etc. I would write this code as count = 1; While[RandomReal[] <= 0.9999, count++]; count as here you can move the ...

Top 50 recent answers are included