VNA 2.0 is a game of epic cybernetic warfare - it's easy to learn, but from its simple rules comes a lot of thrilling complexity and hardcore battling. In this game of wits and passionate skill, your job is to design a killer program that can destroy its foes in a virtual environment where only one program can emerge victorious. During the actual battle, you play no part (it's run by my emulator) - it's up to your program! You can only wait for the results as two programs duel it out for control of the VNA...
***
Introduction
***
This is an improvement over an earlier game I made (here on Brainden), called VNA. It's a game that involves a cyber-environment called the VNA (which stands for Virtual Node Array), which is just a list of 200 lines of code. The code is written in VNAC (VNA Code), which I've devised based off of an ancient game known as CoreWars, and tweaked to be better and easier to learn & optimize. For VNA 2.0, I've made some changes to allow accessibility and easy learning for people who have never done an ounce of programming in their life.
In the VNA, each of the 200 lines is called a 'node' (thus the name 'Virtual Node Array'), although I use 'line' and 'node' interchangeably, and each node contains exactly one command and then three parameters (a,b,c) that the command uses as input. The parameters are separated by semicolons.
Most commands do not use all three parameters, so the extra parameters can have any value, it doesn't matter (the default is 0). Some programs may use excess values to store data.
The most basic type of command is BLANK 0;0;0, and the VNA begins with all 200 lines filled with these BLANK commands.
Then two players enter the VNA. Each player submits a program with the aim of destroying the enemy program. The two programs get entered into the VNA at random starting points, overwriting the BLANKs that they are copied over. Each program can be a maximum of 40 nodes long, thus the closest two programs can be is 40 nodes away.
[Note: the programs retain their order. You could have a 20-line program that gets copied onto line, say, 57. Thus your program will replace lines 57 through 76. If the opponent's program was 10 lines and got placed on line 112, their program would occupy lines 112 through 121]
After the programs have been copied into the VNA, the battle begins!
The game progresses in rounds. Each player has a 'pointer', which starts out at the first line of code of the player's program, wherever that may be in the VNA. In each round, player A's pointer runs one line of code (one 'node'), and then player B's pointer runs one node. After a pointer runs a node, it moves itself forward 1 node in preparation for next round [but each round, each pointer only runs ONE node, no exceptions].
[For example, take the previous Note - your program got placed at line 57 and occupied lines 57 through 76. Thus your pointer begins at line 57. Your opponent's program started at line 112, so your opponent's pointer begins at line 112. On the first round, if you go first, your pointer runs line 57. Then your opponent's pointer runs line 112. On the second round, your pointer would run line 58, and your opponent's would run line 113. On the third round, you would run line 59 and your opponent would run line 114. etc. Pointers will always increment by 1 after they are finished executing a command, unless otherwise specified!]
A pointer is destroyed when it executes a BOMB command, and the other player wins!
***
Nodes & Commands
***
So how does VNA Code work? It is very easy to learn! Each node has a simple format:
CMND a;b;c
a command name followed by a space followed by the parameters, which are separated with semicolons.
Each command does a specific action, using the parameters as its input. Here is a list of commands:
COPY a,b copies line a into line b (overriding the current line b)
JUMP a jumps the pointer to line a
BOMB destroys the pointer that ran this node
EDITA a,b a is the line number, b is the new a-value for that node
EDITB a,b a is the line nummber, b is the new b-value for that node
EDITC a,b a is the line number, b is the new c-value for that node
EDITX a,b,c a is the line number, b is the new value, c is 0/1/2 to denote a/b/c to change
BLANK what the original VNA is filled with. You can use BLANK commands too, it's basically a "do-nothing" command
EDITI a,b,c a = line number, b is how much is added to the current value, and c is 0/1/2 to denote a/b/c to change. 'I' stands for increment
SHIFT a,b,c copies line a into line b, then jumps pointer to line c
PCOPY a,b copies only the command part of line a into the command part of line b (stands for "partial copy")
SWAP a,b switches line a & line b (happens immediately)
[/codebox]
Before I go on, let me clarify EDITX and EDITI. The a & b parameters of EDITX are the same as the a & b parameters of EDITA or EDITB or EDITC. That is, the 'a' parameter designates the line number to edit, and the 'b' parameter represents the new value. However EDITX also utilizes the 'c' parameter. The c parameter can be either 0 or 1 or 2. Zero means that it is editing the line's a-param (as per EDITA). 1 means that it's editing the b-param (as per EDITB), and 2 means the c-param (as per EDITC). You wouldn't use EDITX if you knew you would always be editing a specific parameter... you would only use EDITX if the actual parameter you were editing was going to change too.
EDITI is the same thing as EDITX, except that the 'b' parameter is different: instead of representing the NEW value, it represents what is going to be added to the current value [just a shortcut I made because a common use of EDIT is to increment a parameter]
So how do you represent a line number?
The current line is always seen as 'line 0', the next line is 'line 1', the line after that is 'line 2', etc. The line BEFORE the current line is referred to as '-1', the line behind that being '-2', etc. Because of this, there is no absolute definition of line number, and the VNA wraps around as if it were an infinite loop, so line 200 or 400 or -600 is the same thing as line 0 (which is the current line).
For example, say your program is this:
COPY 0;1
when the pointer runs this node, it copies the current line (0) into the next line (1), and looks like this:
COPY 0;1
COPY 0;1
remember that the pointer increments itself each round, so next round it will run the SECOND node, which is also "COPY 0;1", and thus this program is basically an infinitely-repeating program that cannot die and cannot kill anything. After five iterations:
COPY 0;1
COPY 0;1
COPY 0;1
COPY 0;1
COPY 0;1
...etc
[[i]Note: technically, it should be COPY 0;1;0, because even though the c-parameter is not used, it still should be shown[/i]]
***
Parameters & Functions
***
So what can you use for parameters? You already know that you can put numbers in, but usually you want to have a function: a function is something, like add(5,2), that takes in input and produces an output. For example, add(5,2) will add 5 and 2 (5 & 2 are the input) and output the number 7. Functions will always churn out a number as output, and for input, they will accept either numbers or more functions. For example:
add(5,add(3,2))
will add 5 to the addition of 3 and 2, thus the output of that whole thing will be 5+(3+2) or 5+5 = 10
There is no 'official' limit to the number of functions you can have nested within other functions, but at a certain point it may clog up my VNA emulator, and usually there's no need for such uber-nesting
So what are the functions? [btw, a fancy name for "output" is "return". For example, add(7,2) returns 9]
[codebox]
a(n) returns the a value of the node at line n
b(n) returns the b value of the node at line n
c(n) returns the c value of the node at line n
add(m,n) returns m+n
sub(m,n) returns m-n
mul(m,n) returns m*n
div(m,n) returns m/n
mod(m,n) returns the remainder of m/n
pow(m,n) returns m^n
log(m,n) returns log (base m) of n
abs(n) returns the absolute value of n
int(n) returns the integer part of n
com(m,n,o,p,q) compares m & n. If they are equal, returns o. If m>n, returns p. If n>m, returns q
equ(m,n,o,p) compares m & n. If they are equal, returns o. Otherwise, returns p
geq(m,n,o,p) compares m & n. If m>n or m=n, return o. Otherwise, p
leq(m,n,o,p) compares m & n. If m<n or m=n, return o. Otherwise, p
nzero(n) if all three parameters of line n are 0, returns 0. Otherwise, returns 1
rand(m,n) returns a random integer from m to n, including m&n. 'n' must be greater than 'm'
As you can see, functions are pretty useful for evaluating data and deciding what to do.
***
That's It!
***
That's all you need to know! Simple, right? You may not think so yet, but it actually is. With the above stuff, you can make some awesome programs. Take this, for example:
COPY 3;40;0
EDITI -1;3;1
JUMP -2;0;0
BOMB 0;0;0
Believe it or not, this simple thing is actually a powerful program. Let's analyze what it does, line by line:
COPY 3;40;0
Okay, 'COPY a,b' copies line a into line b, overriding the current line b.
a=3
b=40
So line 3 is the line three lines forward from 'COPY'. This is the 'BOMB' line! The 40 means it copies the BOMB line into a node 40 nodes forward from the current line. Note that 40 is the minimum distance the two programs can be apart from each other, and thus the first possible space that the opponent's program could be on.
After running the COPY line, the new VNA state would be this:
COPY 3;40;0
EDITI -1;3;1
JUMP -2;0;0
BOMB 0;0;0
...
... (36ish BLANK commands would be here, I just don't have the space ;D)
...
BOMB 0;0;0
Simple so far! Next, the EDITI command. It edits line -1, which would be the COPY line, and it edits the b-parameter of the COPY line because the c-parameter of the EDITI line is 1, which corresponds with 'b'. So 3 means that the b-parameter is incremented by 3. Thus, the new copy line looks like this:
COPY 3;43;0
in other words, the EDITI command added 3 to the COPY line's b-parameter, turning 40 into 43
The next line is JUMP -2, which sends the pointer back 2 lines, to the COPY line. That means the next line that the pointer will run is the COPY line... the COPY line which was modified. Now the COPY line will copy the BOMB 43 spaces forward, instead of 40 like last time. Each iteration of the program will churn out another BOMB another 3 spaces forward!
As you can see, the BOMB command is part in the program but is never actually run by the program (unless it gets corrupted by the enemy prpogram), just copied across the VNA in an attempt to destroy the opponent
This type of program is called a "Bomber", and is one of the simplest possible forms of Bombers. Other Bombers may have defense mechanisms built in (to stop if it gets close to bombing itself), or better methods for efficiency, etc
So I'm going to start out VNA 2.0 with an "Opening Day Tournament", in which I need 8 battle programs submitted to me to compete in a bracketed tournament format.
If you have any questions about VNA or VNA Code, feel free to PM me!
I call this one 'the Hopper':
COPY 0;add(a(0),c(0));170
EDITI -1;1;0
JUMP com(a(-2),3,168,168,-2);0;0
It works by copying all three lines of itself 170 spaces forward, then when that is complete, jumping itself to the new copy 170 nodes forward and doing it all over again. The Hopper is very versatile and extremely hard to kill. After just 9 rounds it has sent itself to the next location. However the Hopper has its setbacks, and the major one is that it relies on the opponent bombing themselves... the only way that a Hopper can actively kill the enemy is if it (by luck) overwrites key parts of the enemy's program that causes it to completely mess up and possibly hit a BOMB
This is an even simpler form of the Hopper:
SHIFT 0;170;170
It does what the Hopper does with one third the nodes and one ninth of the total rounds it takes! This Hyper-Hopper is extremely hard to kill (a BOMB has to nail right on top of its new location right before it runs it and before it goes elsewhere), but of course it has no ability to kill the opponent, and could only win if the opponent tears themselves apart.
This one is a bit more complex, but more efficient than a simple bomber. It searches for nodes that have nonzero parameters (and thus probably at or near the enemy's program) and then bombs the area. Meanwhile it takes advantage of the new SHIFT command I added to splatter bombs around at the same time as jumping with JUMP
SHIFT 3;40;equ(nzero(b(0)),0,1,4)
EDITI -1;5;1
JUMP -2;0;0
BOMB 0;0;0
EDITI -4;1;1
COPY -2;b(-5);0
JUMP -2;0;0
This program can be improved upon, of course. It has no defense mechanisms that check to see if it's getting close to bombing itself and jump it to a next step which does something different. It also becomes an inefficient 1-node-at-a-time bomber in the last three lines. You can help yourself learn about VNA by adding onto this program and making it better
Spoiler for my best on the above:
Much more efficient, 5 lines not 7 and runs way less of them, going through iterations faster and with more accuracy. Also reduces function lag by evaluating nzero and taking out the equ around nzero (see later when I explain nzero). Basically the big thing in the c-parameter of the SHIFT command evaluates the line denoted by its own b-parameter, checks if all of its parameters are zero. If so, back one. If not, up 2
I call this one 'the Liberator'. It's a devastatingly simple and powerful program that takes advantage of the new SHIFT command and random function:
SHIFT 1;rand(40,160);0
BOMB 0;0;0
The rest I've made for VNA 2.0 so far are well-thought out warrior programs that I would use in a battle and not post here
If you understand how it all works, and can decipher programs... but have no idea where to start in making your own, then...
Make sure you have a clear goal on what you want your program to do (this is probably the most important step). Once you have a definite idea on how you want it to work, start to think about what commands you could use to make that happen in the best way...
If you want to know about things you cannot do that cause infinite loops,
COMMANDNAME b(0);a(0);7
Look at this. It's a-param references it's b-param, which references it's a-param!! I call this a 'paradox node'
COMMANDNAME a(1);2;25
COMMANDNAME a(-1);36;0
Same thing. Or it could be a-to-b like this:
COMMANDNAME b(1);2;25
COMMANDNAME 3;a(-1);0
or you could have three nodes that work this way, or four, or five! The possibilities are endless! The paradox nodes don't have to be next to each other either, of course
~~
The second kind is this:
COMMANDNAME a(0);8;15
You can NEVER have a(0) in the 'a' parameter, b(0) in the 'b' parameter, or c(0) in the 'c' parameter! (Or anything that equates to 0)
Note that nzero(n) = equ(a(n)+b(n)+c(n),0,equ(a(n),b(n),equ(c(n),0,AZ,NZ),NZ),NZ)
Where AZ is the result if line n has all-zero parameters, and NZ is the result if line n has at least one nonzero parameter. I didn't actually program nzero as a function in my emulator, I just added that to help you out - if I see a use of nzero, I'll replace it with the above longer version and use 0 for AZ and 1 for NZ... but the longer version is better for you to use raw because you can make the AZ and NZ anything you want that suits the specific purpose
The modulus is your friend
mod(a,b) = a % b, or "a modulo b" or "the remainder of a/b"
The function mod(x,3) will always produce a number that is either 0, 1 or 2, regardless of the value of x. A multiple of three (such as 33) will produce 0. One over a multiple of three (such as 34) will produce 1. Two over a multiple three (such as 35) will produce 2. For example:
mod(17,3) = 2
This is extremely useful in the 'c' parameter for the EDITX or EDITI commands, where a 0/1/2 value is required to specify a/b/c to edit. Using the mod function in combination with other values will allow you to manipulate that in a more complex/efficient program that uses a single EDITX or EDITI to do all of its editing
com is even MORE your friend!
The function I use most is probably com, though in VNA 2.0 with the addition of com's sister functions (equ, geq and leq) you can make your coms look simpler. Com just has more options, but when you know how you want to compare two things, using one of the other three will make your program less cluttered by removing the fifth input value (otherwise no actual advantage).
The command I almost always pair 'com' with is JUMP (or also the c-value of SHIFT) to tell it where to jump to in the program. Thus my JUMP commands act as switching stations that take in info, analyze with 'com' (or its sister functions) and then jump to the desired location
Efficiency is key
When you can use one line to do multiple things, do it! Each round, only one node is ran by your pointer, so you want to be as efficient as possible and make your actions take up the least amount of time to complete. For example, the SHIFT command I added in 2.0 allows for simultaneous copying and then jumping, with one node. So if you ever have a situation where you need to copy and then jump, SHIFT is the command for you.
Another tip for efficiency is placing any BOMB command your program might have at the end (or in middle if you're guaranteed to not run into it) of the code, and then reference it from earlier.
Integers and decimals
int(n) gives the integer part of n, for example int(5.78) = 5, though if you wanted just the .78 part, just do sub(n,int(n))
Plan for eventualities!
Make sure you have a backup plan if your program's initial goal fails! If you are a Bomber, when you jump back to re-bomb (if yours works like that), use a com with the JUMP to make sure that the bombs aren't getting too close to home. Creating a program that is capable of doing multiple tasks and planning for various types of enemy programs is a good idea Especially in the Tournament Game I'm going to start, where your program must be able to vanquish different kinds of foes
Editing input values
You may have noticed there are no commands for editing input values of functions... that's because it's just not feasible to do without unnecessary complications and complexities.
Instead, there is an efficient, elegant and much easier solution... if you have an input value of a function (no matter how nested it is within other functions, doesn't matter) that you know you want to change, just use in place of it one of these functions: a(n), b(n) or c(n), pointing to an unused parameter of a line. For example, if the previous line is a JUMP command, which doesn't use its b or c parameters, you could use b(-1) or c(-1) to reference one of those unused parameters of the JUMP command, which is where you would store the value which you could then easily change with an edit command.
I also do this when I want to increment, say two different values, by the same amount. I only use 1 round to increment ONE of those values, and have the other value piggyback off of the first and reference it. For example, if two values start at 0 and 7, and every xth round I want to increment them both by 1, I just increment the first one, and have the 7 instead be add(7,v) where v is the reference to the first value (such as a(3) or something similar). This saves a lot of efficiency!!
The random function...
rand(m,n) is special in that given the same two input values, the output can (and usually will) differ. Every time rand is evaluated by the VNA, it will return a different value. So when is it evaluated?
* when the node which it is a part of is ran by any pointer
* when a(n), b(n) or c(n) is used to reference the parameter [a, b or c] in which the 'rand' is used
* when EDITI is used to increment the parameter that the 'rand' is part of. EDITI just uses a shortcut of add(x,i) where x is the current value and i is the amount to increment by. Thus in this case, when an operation is performed on rand (such as adding to it, subtracting, etc), it fixes the value, because a(n) or b(n) or c(n) evaluate the current value of the whole parameter (including a random output if a 'rand' is there), and thus if you add something to that, it creates a fixed number, and if you plug that fixed number back into the parameter using EDIT, it is just a number now
** the same is true of all functions. For example, you could have a nested function system that continually evaluates the line 80 in front and adds all three of its parameters together [something like add(a(80),add(b(80),c(80))) ...], but when you use a(n), b(n) or c(n) on the parameter that contains that function, it evaluates it for the CURRENT case, into a fixed value - so if you plug that fixed value back into the parameter (after, say, incrementing it or something) it is no longer a function but a fixed number
So keep that in mind when using rand
So if you're interested, feel free to PM me about the game and submit your program today ;D I'm hoping to get 8 people for the Opening Day Tournament
Question
unreality
VNA 2.0
VNA 2.0 is a game of epic cybernetic warfare - it's easy to learn, but from its simple rules comes a lot of thrilling complexity and hardcore battling. In this game of wits and passionate skill, your job is to design a killer program that can destroy its foes in a virtual environment where only one program can emerge victorious. During the actual battle, you play no part (it's run by my emulator) - it's up to your program! You can only wait for the results as two programs duel it out for control of the VNA...
***
Introduction
***
This is an improvement over an earlier game I made (here on Brainden), called VNA. It's a game that involves a cyber-environment called the VNA (which stands for Virtual Node Array), which is just a list of 200 lines of code. The code is written in VNAC (VNA Code), which I've devised based off of an ancient game known as CoreWars, and tweaked to be better and easier to learn & optimize. For VNA 2.0, I've made some changes to allow accessibility and easy learning for people who have never done an ounce of programming in their life.
In the VNA, each of the 200 lines is called a 'node' (thus the name 'Virtual Node Array'), although I use 'line' and 'node' interchangeably, and each node contains exactly one command and then three parameters (a,b,c) that the command uses as input. The parameters are separated by semicolons.
Most commands do not use all three parameters, so the extra parameters can have any value, it doesn't matter (the default is 0). Some programs may use excess values to store data.
The most basic type of command is BLANK 0;0;0, and the VNA begins with all 200 lines filled with these BLANK commands.
Then two players enter the VNA. Each player submits a program with the aim of destroying the enemy program. The two programs get entered into the VNA at random starting points, overwriting the BLANKs that they are copied over. Each program can be a maximum of 40 nodes long, thus the closest two programs can be is 40 nodes away.
[Note: the programs retain their order. You could have a 20-line program that gets copied onto line, say, 57. Thus your program will replace lines 57 through 76. If the opponent's program was 10 lines and got placed on line 112, their program would occupy lines 112 through 121]
After the programs have been copied into the VNA, the battle begins!
The game progresses in rounds. Each player has a 'pointer', which starts out at the first line of code of the player's program, wherever that may be in the VNA. In each round, player A's pointer runs one line of code (one 'node'), and then player B's pointer runs one node. After a pointer runs a node, it moves itself forward 1 node in preparation for next round [but each round, each pointer only runs ONE node, no exceptions].
[For example, take the previous Note - your program got placed at line 57 and occupied lines 57 through 76. Thus your pointer begins at line 57. Your opponent's program started at line 112, so your opponent's pointer begins at line 112. On the first round, if you go first, your pointer runs line 57. Then your opponent's pointer runs line 112. On the second round, your pointer would run line 58, and your opponent's would run line 113. On the third round, you would run line 59 and your opponent would run line 114. etc. Pointers will always increment by 1 after they are finished executing a command, unless otherwise specified!]
A pointer is destroyed when it executes a BOMB command, and the other player wins!
***
Nodes & Commands
***
So how does VNA Code work? It is very easy to learn! Each node has a simple format:
CMND a;b;c
a command name followed by a space followed by the parameters, which are separated with semicolons.
Each command does a specific action, using the parameters as its input. Here is a list of commands:
Before I go on, let me clarify EDITX and EDITI. The a & b parameters of EDITX are the same as the a & b parameters of EDITA or EDITB or EDITC. That is, the 'a' parameter designates the line number to edit, and the 'b' parameter represents the new value. However EDITX also utilizes the 'c' parameter. The c parameter can be either 0 or 1 or 2. Zero means that it is editing the line's a-param (as per EDITA). 1 means that it's editing the b-param (as per EDITB), and 2 means the c-param (as per EDITC). You wouldn't use EDITX if you knew you would always be editing a specific parameter... you would only use EDITX if the actual parameter you were editing was going to change too.
EDITI is the same thing as EDITX, except that the 'b' parameter is different: instead of representing the NEW value, it represents what is going to be added to the current value [just a shortcut I made because a common use of EDIT is to increment a parameter]
So how do you represent a line number?
The current line is always seen as 'line 0', the next line is 'line 1', the line after that is 'line 2', etc. The line BEFORE the current line is referred to as '-1', the line behind that being '-2', etc. Because of this, there is no absolute definition of line number, and the VNA wraps around as if it were an infinite loop, so line 200 or 400 or -600 is the same thing as line 0 (which is the current line).
For example, say your program is this:
COPY 0;1
when the pointer runs this node, it copies the current line (0) into the next line (1), and looks like this:
COPY 0;1
COPY 0;1
remember that the pointer increments itself each round, so next round it will run the SECOND node, which is also "COPY 0;1", and thus this program is basically an infinitely-repeating program that cannot die and cannot kill anything. After five iterations:
COPY 0;1
COPY 0;1
COPY 0;1
COPY 0;1
COPY 0;1
...etc
[[i]Note: technically, it should be COPY 0;1;0, because even though the c-parameter is not used, it still should be shown[/i]]
***
Parameters & Functions
***
So what can you use for parameters? You already know that you can put numbers in, but usually you want to have a function: a function is something, like add(5,2), that takes in input and produces an output. For example, add(5,2) will add 5 and 2 (5 & 2 are the input) and output the number 7. Functions will always churn out a number as output, and for input, they will accept either numbers or more functions. For example:
add(5,add(3,2))
will add 5 to the addition of 3 and 2, thus the output of that whole thing will be 5+(3+2) or 5+5 = 10
There is no 'official' limit to the number of functions you can have nested within other functions, but at a certain point it may clog up my VNA emulator, and usually there's no need for such uber-nesting
So what are the functions? [btw, a fancy name for "output" is "return". For example, add(7,2) returns 9]
a(n) returns the a value of the node at line n
b(n) returns the b value of the node at line n
c(n) returns the c value of the node at line n
add(m,n) returns m+n
sub(m,n) returns m-n
mul(m,n) returns m*n
div(m,n) returns m/n
mod(m,n) returns the remainder of m/n
pow(m,n) returns m^n
log(m,n) returns log (base m) of n
abs(n) returns the absolute value of n
int(n) returns the integer part of n
com(m,n,o,p,q) compares m & n. If they are equal, returns o. If m>n, returns p. If n>m, returns q
equ(m,n,o,p) compares m & n. If they are equal, returns o. Otherwise, returns p
geq(m,n,o,p) compares m & n. If m>n or m=n, return o. Otherwise, p
leq(m,n,o,p) compares m & n. If m<n or m=n, return o. Otherwise, p
nzero(n) if all three parameters of line n are 0, returns 0. Otherwise, returns 1
rand(m,n) returns a random integer from m to n, including m&n. 'n' must be greater than 'm'
As you can see, functions are pretty useful for evaluating data and deciding what to do.
***
That's It!
***
That's all you need to know! Simple, right? You may not think so yet, but it actually is. With the above stuff, you can make some awesome programs. Take this, for example:
COPY 3;40;0
EDITI -1;3;1
JUMP -2;0;0
BOMB 0;0;0
Believe it or not, this simple thing is actually a powerful program. Let's analyze what it does, line by line:
COPY 3;40;0
Okay, 'COPY a,b' copies line a into line b, overriding the current line b.
a=3
b=40
So line 3 is the line three lines forward from 'COPY'. This is the 'BOMB' line! The 40 means it copies the BOMB line into a node 40 nodes forward from the current line. Note that 40 is the minimum distance the two programs can be apart from each other, and thus the first possible space that the opponent's program could be on.
After running the COPY line, the new VNA state would be this:
COPY 3;40;0
EDITI -1;3;1
JUMP -2;0;0
BOMB 0;0;0
...
... (36ish BLANK commands would be here, I just don't have the space ;D)
...
BOMB 0;0;0
Simple so far! Next, the EDITI command. It edits line -1, which would be the COPY line, and it edits the b-parameter of the COPY line because the c-parameter of the EDITI line is 1, which corresponds with 'b'. So 3 means that the b-parameter is incremented by 3. Thus, the new copy line looks like this:
COPY 3;43;0
in other words, the EDITI command added 3 to the COPY line's b-parameter, turning 40 into 43
The next line is JUMP -2, which sends the pointer back 2 lines, to the COPY line. That means the next line that the pointer will run is the COPY line... the COPY line which was modified. Now the COPY line will copy the BOMB 43 spaces forward, instead of 40 like last time. Each iteration of the program will churn out another BOMB another 3 spaces forward!
As you can see, the BOMB command is part in the program but is never actually run by the program (unless it gets corrupted by the enemy prpogram), just copied across the VNA in an attempt to destroy the opponent
This type of program is called a "Bomber", and is one of the simplest possible forms of Bombers. Other Bombers may have defense mechanisms built in (to stop if it gets close to bombing itself), or better methods for efficiency, etc
So I'm going to start out VNA 2.0 with an "Opening Day Tournament", in which I need 8 battle programs submitted to me to compete in a bracketed tournament format.
If you have any questions about VNA or VNA Code, feel free to PM me!
If you understand how it all works, and can decipher programs... but have no idea where to start in making your own, then...
If you want to know about things you cannot do that cause infinite loops,
Note that nzero(n) = equ(a(n)+b(n)+c(n),0,equ(a(n),b(n),equ(c(n),0,AZ,NZ),NZ),NZ)
Where AZ is the result if line n has all-zero parameters, and NZ is the result if line n has at least one nonzero parameter. I didn't actually program nzero as a function in my emulator, I just added that to help you out - if I see a use of nzero, I'll replace it with the above longer version and use 0 for AZ and 1 for NZ... but the longer version is better for you to use raw because you can make the AZ and NZ anything you want that suits the specific purpose
The random function...
So if you're interested, feel free to PM me about the game and submit your program today ;D I'm hoping to get 8 people for the Opening Day Tournament
Link to comment
Share on other sites
Top Posters For This Question
56
23
7
5
Popular Days
Nov 8
12
Dec 4
12
Nov 15
10
Dec 1
8
Top Posters For This Question
unreality 56 posts
Prime 23 posts
Mekal 7 posts
dms172 5 posts
Popular Days
Nov 8 2008
12 posts
Dec 4 2008
12 posts
Nov 15 2008
10 posts
Dec 1 2008
8 posts
Posted Images
112 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.