' ******************************************************************
' This program generates a binary file of random numbers,
' to be used with Marsaglia's DIEHARD battery of tests
' (http://stat.fsu.edu/pub/diehard/)
' ******************************************************************

#INCLUDE "fbmath.bi"

CONST N = 3000000  ' Generate N numbers

DIM AS UINTEGER I, R

CLS

' Initialize the random number generator

RANDOMIZE TIMER

' Create file

OPEN "random.dat" FOR BINARY AS #1

FOR I = 1 TO N
  R = RND
  PUT #1, , R
NEXT I

CLOSE #1

