samedi 26 novembre 2016

How do I loop until one of two variables reaches zero

I want to first get a random number from 0-1, and then according to if that number is <= 0.6, I want it to add 1 to 2 and subtract 1 from 10. If it's > 0.6, I want it to add 1 to 10 and subtract 1 from 2. What is a code for making it keep adding/subtracting until one of the variables reaches 0?

Aucun commentaire:

Enregistrer un commentaire