B
Bob
in the days of line numbers i build a short programme to simulate the
throwing of two dice with a screen print out the number of times, a
particular number randomly came up . My question is can this run using Access
VB ? Any constructive advise would be most welcome . The old code is as
follows:
REM THROWING 2 DICE
CLS
INPUT "How many Throws", N
Dim A(12)
FOR M = 1 TO 12
A(M) = 0
Next M
FOR T = 1 TO N
X = int(6 * rnd (1)) + 1
Y = int(6 * rnd (1)) + 1
Z = X + Y
A (Z) = A(Z)+1
NEXT T
CLS
PRINT TAB(5); "Total" ; TAB(25); " Frequency"
PRINT
FOR M = 2 TO 12
PRINT TAB(7) ; M; TAB(28) ;A(M)
NEXT M
END
throwing of two dice with a screen print out the number of times, a
particular number randomly came up . My question is can this run using Access
VB ? Any constructive advise would be most welcome . The old code is as
follows:
REM THROWING 2 DICE
CLS
INPUT "How many Throws", N
Dim A(12)
FOR M = 1 TO 12
A(M) = 0
Next M
FOR T = 1 TO N
X = int(6 * rnd (1)) + 1
Y = int(6 * rnd (1)) + 1
Z = X + Y
A (Z) = A(Z)+1
NEXT T
CLS
PRINT TAB(5); "Total" ; TAB(25); " Frequency"
FOR M = 2 TO 12
PRINT TAB(7) ; M; TAB(28) ;A(M)
NEXT M
END