none
Help! Small Basic! RRS feed

  • 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 B

    this is everything we already have

    TextWindow.Write("Kansspel")

    A = 5

    B = 5
    While A*B<>0

    chance=Math.GetRandomNumber(2)
    If (

    chance = 1) Then 
      A = A  + 1 
      B = B - 1

    Else
      A = A - 1 
      B = B + 1
    EndIf
    TextWindow.WriteLine("A="+A+" B="+B)
    EndWhile

    Monday, April 20, 2015 9:03 AM

Answers

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
    Answerer
  • 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
    Moderator