small basic

Watch
Announcements
#1
TextWindow.WriteLine("How many times do you want to throw the dice")
NumberOfDoubleSixes=0
NumberOfDoubleSixes2=0
attempts=0
DieRoll=Math.GetRandomNumber(6)
DieRoll2=Math.GetRandomNumber(6)
tenthousands=0
tries1=tries-remainder
remainder=math.Remainder(tries,1 0000)
if remainder<>0 Then
While attempts<> remainder
attempts=attempts+1
DieRoll=Math.GetRandomNumber(6)
DieRoll2=Math.GetRandomNumber(6)
If DieRoll+DieRoll2=12 Then
NumberOfDoubleSixes2=NumberOfDou bleSixes2+1
Else
TextWindow.WriteLine("You got "+NumberOfDoubleSixes2+" double sixes in "+remainder+" dice rolls")

For attempts=1 To tries1
For newcounter=1 To 10000
DieRoll=Math.GetRandomNumber(6)
DieRoll2=Math.GetRandomNumber(6)
If DieRoll+DieRoll2<>12 then
attempts=attempts+1
tenthousands=tenthousands+1
Else
attempts=attempts+1
NumberOfDoubleSixes=NumberOfDoub leSixes+1
tenthousands=tenthousands+1
EndIf
EndFor
TextWindow.WriteLine("In "+tenthousands+ " rolls you got "+NumberOfDoubleSixes+ " double sixes")

EndFor
EndIf
EndWhile

This is my coding i am not sure why it is not running do you know why?
0
X

new posts
Back
to top
Latest
My Feed

Oops, nobody has postedin the last few hours.

Why not re-start the conversation?

see more

See more of what you like onThe Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Poll

Join the discussion

Have you experienced financial difficulties as a student due to Covid-19?

Yes, I have really struggled financially (53)
17.67%
I have experienced some financial difficulties (83)
27.67%
I haven't experienced any financial difficulties and things have stayed the same (115)
38.33%
I have had better financial opportunities as a result of the pandemic (39)
13%
3.33%