Page 1 of 1

alpha beta vs neural network (i wrote a program) ...

Posted: Thu Dec 21, 2017 3:38 pm
by pilgrimdan
Sub rnd1()

'below calls a random function to get a random number
'between 0 and 1...
'for illustrative purposes this represents alpha beta / mini max...

For x = 2 To 26
Cells(x, 20) = Int((2 - 0 + 0) * Rnd + 0)
Next

'below does not call a random function to get a random number
'between 0 and 1...
'for illustrative purposes this represents neural network...
'just like a neural network it has no knowledge of what a
'random number is...
'the below is based on cellular automata rule 30 center column...

Dim n(7)
ReDim ln1(6)
ReDim ln2(8)
For n1 = 0 To 7
If n1 > 0 And n1 < 5 Then n(n1) = 1 Else n(n1) = 0
Next
ln1(2) = 1: ln1(3) = 2: ln1(4) = 4
b = 4
dimt = 8
For c = 0 To 24
For d = 0 To b
If n(ln1(0 + d)) = 1 Then v1 = 4 Else v1 = 0
If n(ln1(1 + d)) = 1 Then v2 = 2 Else v2 = 0
If n(ln1(2 + d)) = 1 Then v3 = 1 Else v3 = 0
vt = v1 + v2 + v3
ln2(2 + d) = vt
Next
Cells(2 + c, 22) = n(ln2(4 + c)) ' ln2(4 + c)
ReDim ln1(dimt)
For upd = 1 To dimt
ln1(upd) = ln2(upd)
Next
dimt = dimt + 2
ReDim ln2(dimt)
b = b + 2
Next

End Sub

left side is first program ... right side is second program ...
1, 0
1, 1
1, 1
0, 1
0, 0
1, 0
0, 1
1, 1
1, 0
1, 0
0, 0
0, 1
1, 0
1, 1
0, 1
1, 0
1, 0
0, 1
1, 0
0, 0
1, 1
1, 1
0, 1
1, 0
0, 1

is this too simplistic ... or does it adequately represent the difference between alpha beta and neural network ...