Microsoft Small Basic

Program Listing: WBL535
re:
shufle()
testonrandomness()
TextWindow.WriteLine("wins "+win)
Goto re


'this is to shufle 52 cards
sub shufle
i=1
deck=""
While i<53
reshufle:
card= Math.GetRandomNumber(52)
If Array.ContainsValue(deck,card) Then
Goto reshufle
EndIf
deck[i]=card
i=i+1

EndWhile
EndSub

' i test if theres a 1 among the first 26 cards that should be a 50% chance
Sub testonrandomness
For i=1 To 26
If deck[i]=1 Then
win=win+1

Else

win=win-1
EndIf

EndFor
EndSub