# Help! Small Basic!

• ### Question

• ```Hello everyone, we have a question we need to jnow how to calcute this: Duration of the shortest game
- Duration of the longest game
- Probability that A wins
- Chance to win Bthis is everything we already have TextWindow.Write("Kansspel")A = 5B = 5While A*B<>0chance=Math.GetRandomNumber(2)If (chance = 1) Then   A = A  + 1   B = B - 1Else  A = A - 1   B = B + 1EndIfTextWindow.WriteLine("A="+A+" B="+B)EndWhile```
Monday, April 20, 2015 9:03 AM

• Heleen, How did you go with this?

Each time you toss the coin just record how many times you've tossed it.

```tryAgain = "True"

While tryAgain
countTosses = countTosses + 1
EndWhile```

Friday, April 24, 2015 11:46 AM

### All replies

• Hello Heleen,

You tell us you have part of a solution for your problem. This comes from my solution I gave "domendommer" in the topic "Help, gamble" He also asks additional help in that topic. I answered him there. You should look in that topic.

Jan [ WhTurner ] The Netherlands

Monday, April 20, 2015 9:42 AM
• Heleen, How did you go with this?

Each time you toss the coin just record how many times you've tossed it.

```tryAgain = "True"

While tryAgain
countTosses = countTosses + 1
EndWhile```

Friday, April 24, 2015 11:46 AM