Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

language #2

0 views
Skip to first unread message

James Whitehead

unread,
Jan 1, 2007, 4:15:24 AM1/1/07
to

Private Sub Form_Click()
asize = Text2

Dim ta() As Byte
ReDim ta(asize)
Randomize
' create array and randomly fill
' all chars
'MyValue = Int((6 * Rnd) + 1) ' Generate random value between 1 and 6.

'x = rnd()
'
Dim masc(10000) As Byte
Dim mmasc(255) As Byte

For x = 0 To 255
mmasc(x) = x
Next

'
'need to scramble
'
'
For x = 0 To 5000
p = (Int((256 * Rnd)))
pp = (Int((256 * Rnd)))
t = mmasc(p)
mmasc(p) = mmasc(pp)
mmasc(pp) = t
Next

For x = 0 To 255
masc(x) = mmasc(x)
Next
'===================================


'now bell curve
xx = 0
ex = 1

For x = 0 To 255
' now exponent
For yy = 1 To exi
masc(xx) = mmasc(x)
xx = xx + 1
If xx > 10000 Then xx = 0 ' wrap
Next yy
ex = ex + Tan(CDbl(ex)) 'tan ###################
'MsgBox (ex)
exi = CInt(ex)
Next x

For x = 0 To 1255
masc((Int((9000 * Rnd))) + 256) = mmasc((Int((256 * Rnd))))
Next

For x = 0 To 255
masc(x) = mmasc(x)
Next

'****************************
'****************************
' NOW using this array grab random data sets
' now add random chunks of random
'&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
'&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
For x = 0 To asize
ta(x) = masc(Int((10000 * Rnd)))
' MsgBox (ta(x))
Next

' *********************************
' blocks *************************
w = asize / 10000

w = w * (Int((3 * Rnd)))
If w < 2 Then w = 3
w = (Int((w * Rnd)))

For z = 1 To w
a = (Int((200 * Rnd)))
b = (Int((20 * Rnd)))
c = masc(Int((10000 * Rnd)))
y = (Int((a * Rnd))) * b
p = (Int((asize * Rnd)))
For x = p To p + y
If x > CLng(asize) Then Exit For
ta(x) = c
Next
Next
' ***********************************


w = asize / 100

w = w * (Int((3 * Rnd))) '/ power
If w < 10 Then w = 60
w = (Int((w * Rnd)))

For z = 1 To w
a = (Int((50 * Rnd)))
b = (Int((20 * Rnd)))
c = masc(Int((10000 * Rnd)))
y = (Int((a * Rnd))) * b
p = (Int((asize * Rnd)))
For x = p To p + y
If x > CLng(asize) Then Exit For
ta(x) = c
Next
Next
'......................................................
' need randomizing here
'.....................................................
skip:


'.....................................................


mf = Text1 & ".txt"
On Error Resume Next
Kill (mf)
On Error GoTo 0
Open mf For Binary As #1
For x = 1 To asize
Put #1, , ta(x)
Next
Close #1
End
End Sub


0 new messages