' Neurobot v1
'
' My first go at making a bot controlled by 
' something resembling a neural network
'
'
' Memory locations:
'
' 902 - 970 are all freevars
'
' 902 - 925 are the connection weightings
' 926 - 949 are the neuron-neuron connections (must be set to a value between 959 - 963)
' 950 - 957 are the node biases
' 958 is the shoot boolean threshold
'
' 64 memory locations used in total for the neural net alone: Pretty memory-intensive!

' ------------------------------- NEURAL NETWORK -------------------------------

' 3 inputs per neuron; public outputs that can be accessed by any neuron in the network
' Neurons can even set their own outputs as an input

' neuron output = sum of (input * connection weighting) + bias

' Inputs

cond
start
 *.eye5 964 store
stop

cond
start
 *.refeye 965 store
stop

' Invisible layer

cond
start
 *926 * *902 mult *927 * *903 mult add *928 * *904 mult add *950 add 959 store
stop

cond
start
 *929 * *905 mult *930 * *906 mult add *931 * *907 mult add *951 add 960 store
stop

cond
start
 *932 * *908 mult *933 * *909 mult add *934 * *910 mult add *952 add 961 store
stop

cond
start
 *935 * *911 mult *936 * *912 mult add *937 * *913 mult add *953 add 962 store
stop

cond
start
 *938 * *914 mult *939 * *915 mult add *940 * *916 mult add *954 add 963 store
stop

' Outputs

cond
start
 *941 * *917 mult *942 * *918 mult add *943 * *919 mult add *955 add .up store
stop

cond
start
 *944 * *920 mult *945 * *921 mult add *946 * *922 mult add *956 add .aimdx store
stop

cond
 *947 * *923 mult *948 * *924 mult add *949 * *925 mult add *957 add *958 >
start
 -1 .shoot store
stop

end