BrainDen.com - Brain Teasers
• 0

## Question

VNA 3.0 ~ Evolution

VNA 3.0 is a game of battle and survival, mutation and destruction. In the game, you write a program [don't lose me yet, it's a very simple language, even much simpler than previous VNAs] and then the program takes it from there, hoping to win out over enemy programs and conquer the Virtual Node Array.

Digital virii vying for computer memory may not sound like your slice of cake, but it's actually an exciting and engaging game

This is the most radical change on previous VNA games - so I wouldn't advise going and looking through those topics for advice, programs, etc - you'll be able to find all that here and more

Let's face it: while I tried to pepper up VNA 2.0 to make it more accessible to non-programmers, it really only catered to those with a knack for coding. VNA 3 is different in that it's much easier to grasp - anyone can be awesome at this game

So, what does VNA even stand for? It's an acronym for "Virtual Node Array", a cyber-arena of 300 "nodes". This epic warzone is where the battles take place. Where the digital evolution takes place.

So what is a node? Well a node is like a little memory niche within the VNA, a distinct line of code. Nodes are numbered 0 to 299 but this is irrelevant - the VNA wraps around like a Mario game, so if you go over the top, you come out on the bottom, and vice versa. Thus, if you were on node 290 and go forward 20 nodes to 310, this is actually the same node as node 10. ie, 300=0, 301=1, 302=2, 405=105, 599 = 299, 600=0 again, etc. Likewise, -1 = 299, -2 = 298, etc.

Because of this, your program never knows its "absolute address" within the VNA... everything is relative. When dealing with a line number, 0 means the current node. 1 is the node one line down from your current position, etc. Say your current position is at node x:

* this is node -2

* this is node -1

* this is node 0, ie, the current line

* this is node 1

* this is node 2

This is probably the most complicated concept of VNA 3.0, so if you're good with this, you're ready

Moving on, to the concept of pointers. Each person has nine pointers, indexed with a digit from 1 to 9. At the beginning of the game, only pointer 1 is activated, the rest are in "stasis" mode. A pointer carries two statistics: Node and Energy.

Node signifies what node the pointer is currently on. Thus when the pointer runs, it runs that node and executes a command telling the program what to do. After most nodes, the pointer's Node value increments by 1, so that it runs the next node on the next round.

Energy signifies the digital life force of the pointer. The original pointer (#1) starts out with 10 energy. When a pointer runs a node, its energy is decremented by 1 unless the node's command is FOOD, which adds 1 to energy. If a pointer reaches 0 energy, it dies and returns to "stasis".

So, in the beginning, your program is placed randomly into the VNA. Your pointer #1 is given 10 energy and its Node is equivalent to the starting node of your program.

The two warring programs start at an undeterminable distance apart. All other nodes are inhabited by JUMP 0,1 ... essentially a "blank" node that just increases the pointer's Node value by 1.

Then the game begins!!!

The game progresses in rounds. Each round, your pointers are run through. Pointer #1 goes first, then #2, etc, all the way up to #9. If a pointer is in stasis, it is skipped. Then it's your opponent's turn. A round consists of a full turn by both players.

So, what do nodes consist of?

A single node is made up of a "command" and then a space and then two "parameters", separated by a comma. Parameters are just input for the command.

Here are the commands:

```Commands:

------------------------------------------

name		   effect on pointer's energy

-------------------------------------------

COPY a,b			-1 energy

JUMP a,b			-1 energy

EDIT a,b,c		  -1 energy

FOOD a,b			+3 energy```
An advanced feature that may assist you is a concept known as a variable - a symbol used to store data. In VNA 3.0, there are three basic variables: ! # \$ you can use them in commands instead of a number. Ie: COPY !,6 or even two variables: COPY !,\$ or two of the same variable: COPY #,# '!' and '#' are independent to your program, so you and your opponent can have different '!' and '#' values. However, '\$' is a shared variable, and you and your opponent(s) have access to the same '\$' You can set the variables with the following three commands:
```SET!	  a,b

SET#	  a,b

SET\$	  a,b```
All three have the effect on energy of ±0 .. ie, they have no effect and do not reduce nor add to energy. Also, after running a SET command, the Node of the pointer goes to the next line as usual. So how do they work? Well, the 'a' parameter is the new value of the variable, and the 'b' parameter is usually ignored. Ie: SET! 7,0 this sets the '!' variable to 7 The only time 'b' is taken into account is if b equals a special number: if b = -1, the variable is set to the a-parameter of line +a if b = -2, the variable is set to the b-parameter of line +a if b = -3, the new variable is INCREASED by the a-parameter of line +a if b = -4, the new variable is INCREASED by the b-parameter of line +a I know that doesn't make sense, so I'll give a few examples:
```SET#   19,0		  // sets # to 19

SET#   7,-1		  // sets # to the a-parameter of line +7

SET#   7,-2		  // sets # to the b-parameter of line +7

SET#   8,-3		  // increases # by the a-parameter of line +8

SET#   8,-4		  // increases # by the b-parameter of line +8```
Unless the b-parameter is -1, -2, -3, or -4, it is ignored. ~~~ There are a couple more types of variables. The first type is the letter p followed by a number from 1 to 9.... p1 = represents the line of pointer #1 relative to your current line p2 = ditto for pointer #2 p3 = ditto for pointer #3 p4 = ... etc, all the way down to p9 ie: JUMP 0,p6 This line would jump the current pointer to the current location of p6 [as the line value of p6 is given relative to the line of the current pointer] If the pointer in question doesn't exist (is in stasis), the variable's value is 300. If the 300 isn't checked and is used as 300, remember that saying node 300 (or 600, or 900, or -300, etc) is the same thing as saying node 0. However, this can be distinguished from 0 because, if the pointer DID exist and was at the same line, it would show as 0, not as 300. So if a pX variable is 300, you know that it's in stasis 'pX' variables always return a number in the range 0 to 299 (except for 300 if the pointer is in stasis), so even if you use p7 and pointer #7 is at the node -1 from you, the p7 variable will be 299 instead of -1 Also: you can do the following: p!, p#, p\$, pe and pt. This is just the pX variable with another variable representing the pointer number [see the next sections for what 't' and 'e' are]. However if the variable isn't a number 0 to 9, the value 600 is returned [this equates to 0 if used as a line number of course]. This is true even if a variable is not being used. Ie, p2.8 will return 600, as will p10. so: pX = 300 if pointer X is in stasis pX = 600 if X is not an integer 0 to 9 both numbers equate to node +0 if used as line numbers. ~~~ The next variable is 'q' ... 'q' is the current pointer's pointer-number, ie, a number from 1 to 9. If you need to use it, it's there ;P You could do 'pq', but that will always return 0 of course ~~~ The next is 't' - t is an integer 1 through 9 that represents the total number of living pointers at this current moment in your program ~~~ The final variable is 'e'. The pointer dealing with 'e' sees 'e' as the pointer's current energy ie, if the pointer has 5 energy and reads this line: JUMP 0,e It will see it as (for the moment) = JUMP 0,5 ~~~ What happens if variable parameters are edited, added to, etc? COPY 2,7 EDIT -1,\$,a+: This will add \$ to the a-parameter of the COPY line. The variable '\$' is examined and the value for that point in time is used for the addition. If '\$' is changed later on, it doesn't magically change the COPY too, the COPY is a set value Likewise: COPY \$,7 EDIT -1,3,a+: This will add 3 to the COPY's current a-parameter, which is whatever the variable '\$' is currently is, and then make that the new a-parameter. This value becomes set, ie, the '\$' part is overwritten with whatever the '\$' is at that moment, plus 3 from the EDIT ~~ Also, when dealing with the 'p1' to 'p9' variables and the 'e' variable, the value changes depending on which pointer of which program is viewing the line of code. Keep that in mind.
For extra power in your program, you can use a comparison operator in a parameter. This is denoted with the lowercase letter 'c', followed by underscores separating arguments in the comparison. Like so: c_1_2_3_4_5 There are always 5 arguments, and they must be either numbers or variables (you cannot nest comparisons within comparisons). The comparison as a whole evaluates down to one value, which is taken to be the parameter. It works like so: if 1=2, then the comparison evaluates to 3 if 1>2, then the comparison evaluates to 4 if 1<2, then the comparison evaluates to 5 This is like a variable in that, if the comparison is edited or used for editing, it becomes set in stone as an integer rather than retaining the variability. A quick example: JUMP 0,c_!_3_46_-5_-5 This compares the '!' variable to the number 3. If they are equal, the pointer jumps forward by 46 nodes. Otherwise it jumps backwards 5 Another example: SET\$ c_!_#_!_!_#,0 this takes the larger of the two variables '!' and '#' and sets that to the '\$' variable A final example: JUMP c_p7_300_7_0_0,c_p7_300_1_-3_-3 if p7 is in stasis, this creates it at node +1, but if p7 already exists, the current pointer jumps backward 3 ~~~ You can use comparisons in the c-parameter of EDIT, like so: EDIT 7,8,c_#_1_a+:_x*@_b^- if # = 1, then 'a+:' is used for the c-param if # > 1, then 'x*@' is used if # < 1, then 'b^-' is used
Like comparisons, math units are chunks of code that take in input and evaluate to a single number. Math units always start with a lower case "m" followed by an equals sign ("=") and then two numbers OR variables separated by an operation symbol. Like this: m=5+3 this evaluates to 5+3, or 8 m=e*7 this evaluates to seven times the pointer's current energy m=!+p# this evaluates to the value '!' plus the line distance to pointer '#' Like comparions, Math Units use the current variable value, etc, and if edited or used for editing, the current value is used, and thus editing a math unit by adding 2 to it will overwrite it with a fixed value. So a Math Unit is made up of 'm=' and then two numbers or variables separated by an operator. What are the operators? + = add the numbers - = first number minus the second * = multiply the numbers % = divide the first by the second, take remainder. If the second number is zero, the first number is outputted instead & = smushes the two numbers together (ie, 5 & 7 = 57) > = takes the greater of the two numbers < = takes the lesser of the two numbers Note: Math Unit input values MUST be numbers OR variables. You cannot nest other Math Units or Comparisons within a Math Unit. HOWEVER, you can have Math Units within Comparions!!! Say that pointer #1 runs the following line of code. It would jump pointer #2 ten nodes forward from pointer #1 JUMP 2,10 But what if you wanted to jump #2 ten nodes forward from itself, ie, from #2 instead of from #1? No problemo! JUMP 2,m=p2+10 Simple and effective ;D take this: JUMP c_m=!+1_#_9_0_0,c_\$_5_m=2*e_m=p3+17_m=p3+17 In this convoluted example, it compares the variable '!' plus 1 with the variable '#'. If they are equal, it jumps pointer 9, otherwise it jumps the current pointer. And it jumps this pointer to a different spot depending on '\$'. If \$ is equal to 5, it jumps it forward from the current pointer by double the 'e' variable, otherwise it jumps it 17 nodes forward from pointer #3. This example was just to demonstrate the Math Unit's power and flexibility :~D You cannot use a Math Unit in an EDIT command's c-parameter, as it would have no use there.
If you did peek, and now you're confused, don't worry, I know that some of this is complicated
COPY 0,1 This is a basic "replicator" program. Analyze it - what does it do? It copies itself (node 0) forward 1 node. Then the pointer advances to the next line, which is exactly the same, and runs that. This program will die after 10 rounds when its energy hits 0. Take this program: FOOD 0,0 JUMP 0,-1 This is a basic "guzzler" program. It adds 3 to its energy supply, then jumps itself backwards 1 (-1 to energy supply), then adds 3, etc, in an infinite loop. It continually gains energy, thus it never dies - but doesn't accomplish much else. Guzzlers can be useful sub-programs but would almost never be alone as a full program in themselves. This: COPY 4,10 EDIT -1,2,b+: FOOD 0,0 JUMP 0,-3 JUMP 0,100 is an example of what I call a "bomber". It drops a "JUMP 0,100" command every other node starting with the node +10 from the COPY. This is in an attempt to (eventually) overwrite an enemy program's lines and send it out 100 into desert of blank nodes (remember, the VNA starts out full of JUMP 0,1 commands before the programs are dropped in) so that its energy is depleted and it dies. You can trace the program line by line to see how it works. Think of the "JUMP 0,100" as a bomb that we're trying to hit the enemy program with. * COPY 4,10 ~ this drops the "bomb" (+4 from the COPY) to a spot +10 from the COPY * EDIT -1,2,b+: ~ this increments the COPY's b-parameter by 2 * FOOD 0,0 ~ this increases energy by 3 * JUMP 0,-3 ~ this jumps back to the beginning of the program Then it happens all over again. Remember that the program copies the "bomb" to a new spot every time because the EDIT command keeps adding 2 to its previous value and it sends the bomb out 2 nodes further each iteration. Perhaps a better choice for a one-line bomb would've been JUMP 0,0 ... this will cause a pointer to keep jumping to itself over and over again until its energy is lost and it dies. However this is probably in the vicinity of its other pointers and is thus more susceptible to being re-overwritten and saved. It's a tradeoff ;D Notice how the FOOD node is placed so that the program stays in an energy equilibrium.
~~~ NUMERICAL SPECIFICATIONS * max program size: 50 nodes * starting distance between programs: random. If P1 is assumed to start at "node 0", then P2 can start anywhere from "node 56" to "node 244" ~~~ Because of the way that VNA 3.0 is set up, much more creativity is endowed upon the coder. There are no simple bomb-commands or other instructions that delete a pointer or send it into stasis - the only way to do this is to deplete its energy to 0. There are numerous ways to do this (such as JUMP 0,100 in the example bomber, or better yet JUMP 0,0) with different advantages to them, and you can create more complex multi-command traps, etc, that suit your program better. General structure is of course different than previous VNAs with the lack of functions in this game, but this solves a lot of problems and makes for a better well-rounded game I think. There's no ubernesting, no megastructures, no paradoxical parameter references. Everything is airtight and simple. I also gave enough functionality for complex programs to be built without functions, so the variety of digital organisms should be pretty explosive
• Why Energy? I introduced energy to throw a monkey wrench into the works Programs are less like perfect machines and more like cyberzoa, more like battling virtual creatures, which is more how the game is designed. With the introduction of energy & pointers and the way they fit together, your programs can become both more simple and more complex at the same time, in different ways. With this new element, programs have to fit their environment, not the other way around. • Self-Sustaining? Gone is the day where a program can copy itself around the VNA forever, until the array is a soup of code fragments. In VNA 3.0, many programs have life spans - but this doesn't mean that guzzlers (a self-sustained program that just hides in a couple lines of code) will win... a good program, if it has a life span, has a long one, long enough to bomb to pieces a guzzler before it dies. But the type of program most affected by VNA 3.0 and the introduction of energy is the Hopper. I'm currently under the impression that it's impossible to create a self-sustaining hopper, but I'd be happy to be proved wrong. I just made one that survived 1342 rounds before dying of natural causes (I was cheap and filled all the extra space before the actual program with FOODs, without those it survived 74 rounds lol)... I'm sure someone else can do better ;D • Addendum: the above paragraph was written before I added some of the current features. Now I was able to make an efficient self-replicating hopper that not only sustains itself energy-wise but continually gains energy.
* Something I forgot to do a couple times while testing was to put the 'm=' in front of a Math Unit * One thing you should keep in mind is that each pointer is ran each round, cycled through one at a time. If stasis, skipped. This means that, if pointer #1 creates pointer #7, pointer #7 will take its own move before the round is over. However, if pointer #7 creates pointer #1, pointer #1 won't run until next round * Test your program! ;D My emulator has a handy option where you can check a checkbox to ignore program 2, and it just focuses on P1
Some useful "bombs": Pit Trap: JUMP 0,0 This is a basic bomb, although with a hidden weakness that it keeps the pointer within the bounds of its program and could potentially be repaired, if the program has some sort of repairer pointer for that purpose. Fling Trap: JUMP 0,100 This is a bit riskier but with more potential payoff. The pointer is flung far away from its nest into no-mans-land, where it can decrement to 0 energy or run into another bomb of some sort (such as a Pit Trap) to ensure the process without chance of rescue. Vortext Trap: JUMP 1,1 EDIT -1,1,a+: JUMP 0,-2 This is named such as it vacuums in the other pointers one by one. I'm still not sure whether it's best to use "JUMP 1,0" or "1,1" as the first line. The Vortext Trap isn't completely efficient as, the more pointers bouncing around within it, the faster the number gets incremented and some pointers may be skipped. Also, it takes at least three times longer to properly plant the trap. If you do use it, drop it in reverse order (ie, the last line first, then move backwards) Landmine: COPY 3,-5 EDIT -1,-2,b*: JUMP 0,-2 JUMP 0,0 This one "explodes" when the enemy pointer hits it, spewing pit trap bombs forward and backwards exponentially until the pointer dies. This one forces the captured pointer to contribute to its own program's demise, which is helpful. However, the innocent "-5" has a tendency of growing very fast. There may be a couple ways to fix this, I'll leave it up to you if you want to use it ;D Like the Vortex Trap, you should drop the Landmine in reverse order Other Tips and Tricks * Test your program and make sure your pointers (if you have multiple pointers) work well together. There's no need to use all 9 unless you want to, sometimes that's better for the program, sometimes it slows it down - it depends on the program. But, as for pointers, keep in mind that each round, your pointers are cycled through 1 to 9 and ran, even if they were created earlier in the round by an earlier pointer * Use clever combinations of systems - with VNA 3.0's features, you can do a lot of stuff, and there's probably a way to do what you want, so keep your mind open for new techniques ;D * One thing that VNA 3.0 has more of is lines... the total size is 300 nodes, the distance is 56 to 244
vna3.html and the max program size is 50. It's not as hard to use all 50 nodes. In general it's a good strategy to try to do as many things with as few nodes (less vulnerability), but with multiple pointers, you might still need quite a few lines
VNA 3.0 Emulator
Works very fast and smooth
Spoiler for source code:
* copy ALL of it * open a new text file (in TextEdit, NotePad, etc) * paste it * save as vna3.html or something similar (the important part is ending with .html) * here it is:
```<html>

<title>VNA 3.0 ~ Evolution</title>

<script LANGUAGE="javascript">

/* define global vars */

var vna = new Array();

var fillcode = "JUMP 0,1";

var exclam_1 = 0;

var exclam_2 = 0;

var pound_1 = 0;

var pound_2 = 0;

var dollar = 0;

var gameover = 0;

function doSwitch()

{

getp1 = document.form1.p1.value;

getp2 = document.form1.p2.value;

document.form1.p1.value = getp2;

document.form1.p2.value = getp1;

}

function doClear()

{

document.form1.p1.value = null;

document.form1.p2.value = null;

}

function doRandomStart()

{

/*

56 57 ... 243 244

0 1 ... 187 188

*/

document.form1.startline.value = Math.floor(189*Math.random())+56;

}

{

var error1="";

var error2="";

if (document.form1.p1.value == "") error1 = "P1 is not specified! ";

var pr1 = new Array();

var pr2 = new Array();

pr1 = document.form1.p1.value.split("\n");

if (document.form1.checky.checked == true && document.form1.p2.value == "")

{document.form1.p2.value = fillcode;}

else if (document.form1.p2.value == "") {error2 = "P2 is not specified! ";}

pr2 = document.form1.p2.value.split("\n");

var nStart = document.form1.startline.value;

var error3="";

var error4="";

var error5="";

if (pr1.length > 50) error3 = "Program 1 is too long! ";

if (pr2.length > 50) error4 = "Program 2 is too long! ";

error4 = error1 + error3 + error2 + error4;

if (nStart=="")

{

var rvvx = Math.floor(189*Math.random())+56;

alert("No starting node for P2 given - generating one randomly: "+rvvx);

document.form1.startline.value = rvvx;

nStart = rvvx;

}

nStart *= 1;

nStart = doMod(nStart);

var iString;

for (i=0;i<300;i++)

{

iString = fillcode;

if (i<pr1.length) {iString = pr1[i];}

if (i>=nStart && i<nStart+pr2.length) {iString = pr2[i - nStart];}

if (iString == undefined) iString = fillcode;

vna[i] = iString;

}

document.form1.vnarray.value = vna.join("\n");

document.form1.pt1_1.value = "0;10";

if (document.form1.checky.checked == false) {document.form1.pt2_1.value = nStart + ";10";}

else {document.form1.pt2_1.value = "stasis";}

// 9 through 26: element index for the 18 pointers

// alternates pt1_x and pt2_x

for (iq=11;iq<27;iq++)

{

document.form1.elements[iq].value = "stasis";

}

document.form1.rnds.value = 0;

document.form1.dornd.disabled = false;

document.form1.doxrnd.disabled = false;

document.form1.xrd.value = 10;

exclam_1 = 0;

exclam_2 = 0;

pound_1 = 0;

pound_2 = 0;

dollar = 0;

gameover = 0;

}

function doRound()

{

// increment round counter

document.form1.rnds.value++;

// P1 runs pointers 1 - 9

// P2 runs pointers 1 - 9

// skip pointer if in stasis

var zeval;

for (ix=9;ix<26;ix=ix+2)

{

zeval = document.form1.elements[ix].value;

if (zeval != "stasis") runPointer(ix,1);

}

if (document.form1.checky.checked == false)

{

for (ix=10;ix<27;ix=ix+2)

{

zeval = document.form1.elements[ix].value;

if (zeval != "stasis") runPointer(ix,2);

}

}

}

function doXRounds()

{

var getx = document.form1.xrd.value;

for (iv=0;iv<getx;iv++)

{

if (gameover == 0) doRound();

}

}

function doMod(zeinput)

{

while (zeinput < 0)

{

zeinput += 300;

}

zeinput = zeinput % 300;

return zeinput;

}

function runPointer(pointx,playernum)

{

var qstring = document.form1.elements[pointx].value;

var pdata = new Array();

pdata = qstring.split(";");

// line number

var qline = pdata[0]*1;

// energy

var qen = pdata[1]*1;

// aaand we begin!

var sline = vna[qline];

// isolate command

var cmdname = sline.substring(0,4);

var params = sline.substring(5);

pdata = params.split(",");

var parama = pdata[0];

var paramb = pdata[1];

var paramc = "";

if (pdata.length > 2) paramc = pdata[2];

// check for comparisons

if (parama.charAt(0) == "c") parama = doComp(parama,pointx,playernum,qen);

if (paramb.charAt(0) == "c") paramb = doComp(paramb,pointx,playernum,qen);

if (paramc.charAt(0) == "c") paramc = doComp(paramc,pointx,playernum,qen);

// check for p1 to p9

if (parama.charAt(0) == "p") parama = doPvar(parama,pointx,playernum,qen);

if (paramb.charAt(0) == "p") paramb = doPvar(paramb,pointx,playernum,qen);

// check for math units

if ((parama+"").charAt(0) == "m") parama = doMathUnit(parama,pointx,playernum,qen);

if ((paramb+"").charAt(0) == "m") paramb = doMathUnit(paramb,pointx,playernum,qen);

/*if ((paramc+"").charAt(0) == "m") paramc = doMathUnit(paramc,pointx,playernum,qen);*/

// basic variables

if (parama == "!" && playernum == 1) parama = exclam_1;

if (parama == "!" && playernum == 2) parama = exclam_2;

if (parama == "#" && playernum == 1) parama = pound_1;

if (parama == "#" && playernum == 2) parama = pound_2;

if (parama == "\$") parama = dollar;

//

if (paramb == "!" && playernum == 1) paramb = exclam_1;

if (paramb == "!" && playernum == 2) paramb = exclam_2;

if (paramb == "#" && playernum == 1) paramb = pound_1;

if (paramb == "#" && playernum == 2) paramb = pound_2;

if (paramb == "\$") paramb = dollar;

// check for e

if (parama == "e") parama = qen;

if (paramb == "e") paramb = qen;

// check for q

if (parama == "q") parama = ((pointx - playernum) - 6)/2;

if (paramb == "q") paramb = ((pointx - playernum) - 6)/2;

// check for t

if (parama == "t") parama = sumPointers(playernum);

if (paramb == "t") paramb = sumPointers(playernum);

// parama & paramb are now solid numbers

// paramc only used if EDIT

// switch statement based on cmdname:

cmdname = cmdname.toUpperCase();

parama = parama*1;

paramb = paramb*1;

var nextnode;

var nexten;

switch (cmdname)

{

case "COPY":

var copylinenuma = doMod(qline + parama);

var copylinenumb = doMod(qline + paramb);

vna[copylinenumb] = vna[copylinenuma];

nextnode = doMod(qline + 1);

nexten = qen - 1;

break;

case "JUMP":

var vptest = (parama*2)+6+playernum;

if (parama == 0 || pointx == vptest)

{

nextnode = doMod(qline + paramb);

nexten = qen - 1;

}

else

{

nextnode = doMod(qline + 1);

nexten = qen - 1;

// is the pointer # valid?

var indirecto = 0;

if (parama < 0) {parama = parama * -1; indirecto = 1;}

if (parama == 1 || parama == 2 || parama == 3 || parama == 4 || parama == 5 || parama == 6 || parama == 7 || parama == 8 || parama == 9)

{

// is the pointer in stasis?

var refpoint = (parama*2)+6+playernum;

var refline = document.form1.elements[refpoint].value;

if (refline == "stasis")

{

// create the pointer

var newspot = doMod(qline + paramb);

document.form1.elements[refpoint].value = newspot + ";" + qen;

}

else

{

// move the pointer

var newnode;

//if (indirecto==0)

//{

newnode = doMod(qline + paramb);

//}

//else

//{

//var reflinez = refline.substring(0,refline.indexOf(";"));

//reflinez = reflinez*1;

//newnode = doMod(reflinez + paramb);

//}

refline = newnode + ";" + refline.substring(refline.indexOf(";")+1);

document.form1.elements[refpoint].value = refline;

}

}

}

break;

case "EDIT":

var lineofz = doMod(qline + parama);

var stoedit = vna[lineofz];

var charx1 = paramc.charAt(0);

var charx2 = paramc.charAt(1);

var charx3 = paramc.charAt(2);

var editbase;

if (charx3 == ":") editbase = paramb;

if (charx3 == "@" || charx3 == "-" || charx3 == "x")

{

var lineofy = doMod(qline + paramb);

var storef = vna[lineofy];

storef = storef.substring(5);

var okay = new Array();

okay = storef.split(",");

var okayr;

if (charx3=="@" || charx3=="x") okayr = okay[0];

if (charx3=="-") okayr = okay[1];

// evaluate okayr into a number

if (okayr.charAt(0) == "c") okayr = doComp(okayr,pointx,playernum,qen);

if (okayr.charAt(0) == "p") okayr = doPvar(okayr,pointx,playernum,qen);

if ((okayr+"").charAt(0) == "m") okayr = doMathUnit(okayr,pointx,playernum,qen);

if (okayr == "!" && playernum == 1) okayr = exclam_1;

if (okayr == "!" && playernum == 2) okayr = exclam_2;

if (okayr == "#" && playernum == 1) okayr = pound_1;

if (okayr == "#" && playernum == 2) okayr = pound_2;

if (okayr == "\$") okayr = dollar;

if (okayr == "e") okayr = qen;

if (okayr == "q") okayr = ((pointx - playernum) - 6)/2;

if (okayr == "t") okayr = sumPointers(playernum);

okayr = okayr*1;

//

editbase = okayr;

}

var editbase2 = editbase;

sstoedit = stoedit.substring(5);

var rifty = new Array();

rifty = sstoedit.split(",");

var riftydos;

var nuline;

// take editbase and change it based on charx2 and existing parameter

if (charx1 == "a" || charx1 == "x")

{

riftydos = rifty[0];

// evaluate riftydos into a number

if (riftydos.charAt(0) == "c") riftydos = doComp(riftydos,pointx,playernum,qen);

if (riftydos.charAt(0) == "p") riftydos = doPvar(riftydos,pointx,playernum,qen);

if ((riftydos+"").charAt(0) == "m") riftydos = doMathUnit(riftydos,pointx,playernum,qen);

if (riftydos == "!" && playernum == 1) riftydos = exclam_1;

if (riftydos == "!" && playernum == 2) riftydos = exclam_2;

if (riftydos == "#" && playernum == 1) riftydos = pound_1;

if (riftydos == "#" && playernum == 2) riftydos = pound_2;

if (riftydos == "\$") riftydos = dollar;

if (riftydos == "e") riftydos = qen;

if (riftydos == "q") riftydos = ((pointx - playernum) - 6)/2;

if (riftydos == "t") riftydos = sumPointers(playernum);

riftydos = riftydos*1;

//

switch (charx2)

{

//case "~": editbase = editbase; //lol

case "+": editbase = editbase + riftydos; break;

case "*": editbase = editbase * riftydos; break;

case "%": if (editbase != 0) editbase = riftydos % editbase; break;

case "/": if (riftydos != 0) editbase = editbase % riftydos; break;

case "&": editbase = riftydos + "" + editbase; editbase = editbase*1; break;

case "^": editbase = editbase + "" + riftydos; editbase = editbase*1;

break;

case ">": editbase = Math.max(editbase,riftydos); break;

case "<": editbase = Math.min(editbase,riftydos); break;

}

nuline = stoedit.substring(0,5) + editbase + "," + rifty[1];

if (rifty.length > 2) nuline = nuline + "," + rifty[2];

stoedit = nuline;

sstoedit = stoedit.substring(5);

var rifty = new Array();

rifty = sstoedit.split(",");

}

if (charx1 == "b" || charx1 == "x")

{

if (charx3=="x")

{

okayr = okay[1];

// evaluate okayr into a number

if (okayr.charAt(0) == "c") okayr = doComp(okayr,pointx,playernum,qen);

if (okayr.charAt(0) == "p") okayr = doPvar(okayr,pointx,playernum,qen);

if ((okayr+"").charAt(0) == "m") okayr = doMathUnit(okayr,pointx,playernum,qen);

if (okayr == "!" && playernum == 1) okayr = exclam_1;

if (okayr == "!" && playernum == 2) okayr = exclam_2;

if (okayr == "#" && playernum == 1) okayr = pound_1;

if (okayr == "#" && playernum == 2) okayr = pound_2;

if (okayr == "\$") okayr = dollar;

if (okayr == "e") okayr = qen;

if (okayr == "q") okayr = ((pointx - playernum) - 6)/2;

if (okayr == "t") okayr = sumPointers(playernum);

okayr = okayr*1;

//

editbase = okayr;

}

else {editbase = editbase2;}

riftydos = rifty[1];

// evaluate riftydos into a number

if (riftydos.charAt(0) == "c") riftydos = doComp(riftydos,pointx,playernum,qen);

if (riftydos.charAt(0) == "p") riftydos = doPvar(riftydos,pointx,playernum,qen);

if ((riftydos+"").charAt(0) == "m") riftydos = doMathUnit(riftydos,pointx,playernum,qen);

if (riftydos == "!" && playernum == 1) riftydos = exclam_1;

if (riftydos == "!" && playernum == 2) riftydos = exclam_2;

if (riftydos == "#" && playernum == 1) riftydos = pound_1;

if (riftydos == "#" && playernum == 2) riftydos = pound_2;

if (riftydos == "\$") riftydos = dollar;

if (riftydos == "e") riftydos = qen;

if (riftydos == "q") riftydos = ((pointx - playernum) - 6)/2;

if (riftydos == "t") riftydos = sumPointers(playernum);

riftydos = riftydos*1;

//

switch (charx2)

{

//case "~": editbase = editbase;

case "+": editbase = editbase + riftydos; break;

case "*": editbase = editbase * riftydos; break;

case "%": editbase = riftydos % editbase; break;

case "/": editbase = editbase % riftydos; break;

case "&": editbase = riftydos + "" + editbase; editbase = editbase*1; break;

case "^": editbase = editbase + "" + riftydos; editbase = editbase*1; break;

case ">": editbase = Math.max(editbase,riftydos); break;

case "<": editbase = Math.min(editbase,riftydos); break;

}

nuline = stoedit.substring(0,5) + rifty[0] + "," + editbase;

if (rifty.length > 2) nuline = nuline + "," + rifty[2];

stoedit = nuline;

}

vna[lineofz] = stoedit;

nextnode = doMod(qline + 1);

nexten = qen - 1;

break;

case "FOOD":

nextnode = doMod(qline + 1);

nexten = qen + 3;

break;

case "SET!":

case "SET#":

case "SET\$":

// set a variable

switch (paramb)

{

case 1:

// left over from development days before the math unit

// to do SETX y,1 just do SETX m=X+y,0

// but leaving the comma 1 feature in anyway...

if (cmdname == "SET!" && playernum == 1) exclam_1 += parama;

if (cmdname == "SET!" && playernum == 2) exclam_2 += parama;

if (cmdname == "SET#" && playernum == 1) pound_1 += parama;

if (cmdname == "SET#" && playernum == 2) pound_2 += parama;

if (cmdname == "SET\$") dollar += parama;

break;

case -1:

case -2:

case -3:

case -4:

var cline = doMod(qline + parama);

var ccline = vna[cline].substring(5);

var xydata = new Array();

xydata = ccline.split(",");

var wxyz;

if (paramb == -1 || paramb == -3) wxyz = xydata[0];

if (paramb == -2 || paramb == -4) wxyz = xydata[1];

// evaluate wxyz into a number

if (wxyz.charAt(0) == "c") wxyz = doComp(wxyz,pointx,playernum,qen);

if (wxyz.charAt(0) == "p") wxyz = doPvar(wxyz,pointx,playernum,qen);

if ((wxyz+"").charAt(0) == "m") wxyz = doMathUnit(wxyz,pointx,playernum,qen);

if (wxyz == "!" && playernum == 1) wxyz = exclam_1;

if (wxyz == "!" && playernum == 2) wxyz = exclam_2;

if (wxyz == "#" && playernum == 1) wxyz = pound_1;

if (wxyz == "#" && playernum == 2) wxyz = pound_2;

if (wxyz == "\$") wxyz = dollar;

if (wxyz == "e") wxyz = qen;

if (wxyz == "q") wxyz = ((pointx - playernum) - 6)/2;

if (wxyz == "t") wxyz = sumPointers(playernum);

wxyz = wxyz*1;

//

if (paramb > -3)

{

if (cmdname == "SET!" && playernum == 1) exclam_1 = wxyz;

if (cmdname == "SET!" && playernum == 2) exclam_2 = wxyz;

if (cmdname == "SET#" && playernum == 1) pound_1 = wxyz;

if (cmdname == "SET#" && playernum == 2) pound_2 = wxyz;

if (cmdname == "SET\$") dollar = wxyz;

}

else

{

if (cmdname == "SET!" && playernum == 1) exclam_1 += wxyz;

if (cmdname == "SET!" && playernum == 2) exclam_2 += wxyz;

if (cmdname == "SET#" && playernum == 1) pound_1 += wxyz;

if (cmdname == "SET#" && playernum == 2) pound_2 += wxyz;

if (cmdname == "SET\$") dollar += wxyz;

}

break;

default:

if (cmdname == "SET!" && playernum == 1) exclam_1 = parama;

if (cmdname == "SET!" && playernum == 2) exclam_2 = parama;

if (cmdname == "SET#" && playernum == 1) pound_1 = parama;

if (cmdname == "SET#" && playernum == 2) pound_2 = parama;

if (cmdname == "SET\$") dollar = parama;

break;

}

//

nextnode = doMod(qline + 1);

nexten = qen;

break;

}

// render VNA

document.form1.vnarray.value = vna.join("\n");

// now do some checks

if (nexten < 1)

{

document.form1.elements[pointx].value = "stasis";

if (gameover == 0)

{

// check for other living pointers

for (iz=(8+playernum);iz<(25+playernum);iz=iz+2)

{

}

{

// Game Over!

gameover = 1;

var qrnd = document.form1.rnds.value;

if (document.form1.checky.checked == false)

{

if (playernum == 1) alert("Player 2 wins on round "+qrnd+"!!!");

if (playernum == 2) alert("Player 1 wins on round "+qrnd+"!!!");

}

else

{

alert("The program dies on round "+qrnd+"!");

}

document.form1.dornd.disabled = true;

document.form1.doxrnd.disabled = true;

}

}

}

else

{

// update pointer field (node;energy)

document.form1.elements[pointx].value = nextnode + ";" + nexten;

}

}

function doComp(xyz,pointx,playernum,qen)

{

xyz = xyz.substring(2);

var vvv = new Array();

vvv = xyz.split("_");

// make sure vvv[0] and vvv[1] are numbers

//  check for p1 to p9

if (vvv[0].charAt(0) == "p") vvv[0] = doPvar(vvv[0],pointx,playernum,qen);

if (vvv[1].charAt(0) == "p") vvv[1] = doPvar(vvv[1],pointx,playernum,qen);

// math unit

if ((vvv[0]+"").charAt(0) == "m") vvv[0] = doMathUnit(vvv[0],pointx,playernum,qen);

if ((vvv[1]+"").charAt(0) == "m") vvv[1] = doMathUnit(vvv[1],pointx,playernum,qen);

// basic variables

if (vvv[0] == "!" && playernum == 1) vvv[0] = exclam_1;

if (vvv[0] == "!" && playernum == 2) vvv[0] = exclam_2;

if (vvv[0] == "#" && playernum == 1) vvv[0] = pound_1;

if (vvv[0] == "#" && playernum == 2) vvv[0] = pound_2;

if (vvv[0] == "\$") vvv[0] = dollar;

//

if (vvv[1] == "!" && playernum == 1) vvv[1] = exclam_1;

if (vvv[1] == "!" && playernum == 2) vvv[1] = exclam_2;

if (vvv[1] == "#" && playernum == 1) vvv[1] = pound_1;

if (vvv[1] == "#" && playernum == 2) vvv[1] = pound_2;

if (vvv[1] == "\$") vvv[1] = dollar;

// check for e

if (vvv[0] == "e") vvv[0] = qen;

if (vvv[1] == "e") vvv[1] = qen;

// check for q

if (vvv[0] == "q") vvv[0] = ((pointx - playernum) - 6)/2;

if (vvv[1] == "q") vvv[1] = ((pointx - playernum) - 6)/2;

// check for t

if (vvv[0] == "t") vvv[0] = sumPointers(playernum);

if (vvv[1] == "t") vvv[1] = sumPointers(playernum);

// validate

vvv[0] = vvv[0]*1;

vvv[1] = vvv[1]*1;

// vvv[0,1] are pure numbers now

//

if (vvv[0] == vvv[1])

{

return vvv[2];

}

else if (vvv[0] > vvv[1])

{

return vvv[3];

}

else

{

return vvv[4];

}

}

function doPvar(pvar,pointx,playernum,wxen)

{

if (pvar == "pq") return 0;

pvar = pvar.charAt(1);

// parse if variable

if (pvar == "!" && playernum == 1) pvar = exclam_1;

if (pvar == "!" && playernum == 2) pvar = exclam_2;

if (pvar == "#" && playernum == 1) pvar = pound_1;

if (pvar == "#" && playernum == 2) pvar = pound_2;

if (pvar == "\$") pvar = dollar;

if (pvar == "e") pvar = wxen;

if (pvar == "t") pvar = sumPointers(playernum);

// if (pvar == "q") pvar = ((pointx - playernum) - 6)/2;

//

if (pvar != 1 && pvar != 2 && pvar != 3 && pvar != 4 && pvar != 5 && pvar != 6 && pvar != 7 && pvar != 8 && pvar != 9) return 600;

pvar = pvar*1;

pvar = (pvar*2)+6+playernum;

var curline = document.form1.elements[pointx].value;

var desline = document.form1.elements[pvar].value;

if (desline == "stasis") return 300;

var xrz = new Array();

xrz = curline.split(";");

curline = xrz[0]*1;

xrz = desline.split(";");

desline = xrz[0]*1;

return doMod(desline - curline);

}

function doMathUnit(mathstring,pointx,playernum,qen)

{

mathstring = mathstring.substring(2);

var referstring = "+-*%&><";

var qchar;

var zchar;

for (gn=0;gn<referstring.length;gn++)

{

zchar = referstring.charAt(gn);

if (mathstring.indexOf(zchar) != -1) {qchar = zchar; break;}

}

var mathparts = new Array();

mathparts = mathstring.split(qchar);

// turn the math parts into numbers

if (mathparts[0].charAt(0) == "p") mathparts[0] = doPvar(mathparts[0],pointx,playernum,qen);

if (mathparts[0] == "!" && playernum == 1) mathparts[0] = exclam_1;

if (mathparts[0] == "!" && playernum == 2) mathparts[0] = exclam_2;

if (mathparts[0] == "#" && playernum == 1) mathparts[0] = pound_1;

if (mathparts[0] == "#" && playernum == 2) mathparts[0] = pound_2;

if (mathparts[0] == "\$") mathparts[0] = dollar;

if (mathparts[0] == "e") mathparts[0] = qen;

if (mathparts[0] == "q") mathparts[0] = ((pointx - playernum) - 6)/2;

if (mathparts[0] == "t") mathparts[0] = sumPointers(playernum);

mathparts[0] = mathparts[0]*1;

//

if (mathparts[1].charAt(0) == "p") mathparts[1] = doPvar(mathparts[1],pointx,playernum,qen);

if (mathparts[1] == "!" && playernum == 1) mathparts[1] = exclam_1;

if (mathparts[1] == "!" && playernum == 2) mathparts[1] = exclam_2;

if (mathparts[1] == "#" && playernum == 1) mathparts[1] = pound_1;

if (mathparts[1] == "#" && playernum == 2) mathparts[1] = pound_2;

if (mathparts[1] == "\$") mathparts[1] = dollar;

if (mathparts[1] == "e") mathparts[1] = qen;

if (mathparts[1] == "q") mathparts[1] = ((pointx - playernum) - 6)/2;

if (mathparts[1] == "t") mathparts[1] = sumPointers(playernum);

mathparts[1] = mathparts[1]*1;

//

var retxval;

switch (qchar)

{

case "+": retxval = mathparts[0] + mathparts[1]; break;

case "-": retxval = mathparts[0] - mathparts[1]; break;

case "*": retxval = mathparts[0] * mathparts[1]; break;

case "%":

if (mathparts[1] != 0)

{retxval = mathparts[0] % mathparts[1];}

else {retxval = mathparts[0];}

break;

case "&": retxval = mathparts[0] + "" + mathparts[1]; retxval *= 1; break;

case ">": retxval = Math.max(mathparts[0],mathparts[1]); break;

case "<": retxval = Math.min(mathparts[0],mathparts[1]); break;

}

return retxval;

}

function sumPointers(pnum)

{

var pointercount = 0;

for (izz=(8+pnum);izz<(25+pnum);izz=izz+2)

{

if (document.form1.elements[izz].value != "stasis") pointercount++;

}

return pointercount;

}

function showVars()

{

alert("VARIABLES: \n! (P1) = "+exclam_1+"\n! (P2) = "+exclam_2+"\n# (P1) = "+pound_1+"\n# (P2) = "+pound_2+"\n\$ = "+dollar);

}

function showHelp()

{

alert("HELP: \n* Put the two programs in the P1 and P2 text fields\n* You can use the 'Switch' and 'Clear' buttons to switch and clear the P1 & P2 fields respectively\n* If you check the checkbox, only P1 will run (though P2 will still be put into the VNA if you put something for it). This is helpful for debugging a program or seeing when/if it dies of natural causes\n* Enter a number for P2 starting node in the range given, or click the button to generate one randomly\n* Click the load button to initialize everything\n* After that, you can see the VNA as well as pointer statistics and rounds. A pointer has its node reference on the first number, then a semicolon, then its energy\n* To do a round, click the Do 1 Round button\n* To do multiple rounds at a time, enter a value for X (default is 10) and click the 'Do X Rounds' button\n* To see the variables in their current state, click the 'See Variables' button\n* To change the number of rows displayed of the VNA, click the button in the bottom right corner. The default is 40, though I choose 15-20 if I want to see all the data at once - choose what works best for you and your browser\n* To get a line number after the VNA is filled, place the cursor in the middle of the line and look at the text field on the bottom. It's kind of a slow feature though\n* Enjoy;D");

}

function changeArrayH()

{

var newheight = prompt("New textarea height (in rows):",document.form1.vnarray.rows);

if (newheight != 0 && newheight != null) document.form1.vnarray.rows = newheight;

}

function doClickArray()

{

var objx = document.form1.vnarray;

var xout;

if(objx.selectionStart)

{

/*

if doesn't work, delete this func, and onClick of vnarray, and the text & input before div right

*/

var startx = objx.selectionStart;

var newlcount = 0;

for (trx=0;trx<startx;trx++)

{

if (objx.value.charAt(trx) == "\n") newlcount++;

}

xout = newlcount;

}

else

{

xout = "Need Firefox & Filled VNA";

}

document.form1.curatline.value = xout;

}

</script>

<body>

<h1>VNA 3.0 Emulator, by unreality</h1><form name="form1"><br><br><br>P1 ................................................................................

..........................P2<br>

<textarea name="p1" rows=10 cols=50></textarea>

<textarea name="p2" rows=10 cols=50></textarea>

<br>

<center>

<input type="button" value="Switch" onClick="doSwitch();">

<input type="button" value="Clear" onClick="doClear();"> ... <input type="checkbox" name="checky"> Check if just testing P1 [no P2]</center>

<br><br><br><br>

P1 starts at line 0 and goes first<br>

P2 starts at line X and goes second<br>

X: <input type="text" name="startline" length="10">

<input type="button" value="Random" onClick="doRandomStart();">

<br><br><br><br>

VNA:<br>

<textarea name="vnarray" onClick="doClickArray();" rows=40 cols=60></textarea><br>

P1_1: <input type="text" name="pt1_1" length="10"> .... P2_1: <input type="text" name="pt2_1" length="10"><br>

P1_2: <input type="text" name="pt1_2" length="10"> .... P2_2: <input type="text" name="pt2_2" length="10"><br>

P1_3: <input type="text" name="pt1_3" length="10"> .... P2_3: <input type="text" name="pt2_3" length="10"><br>

P1_4: <input type="text" name="pt1_4" length="10"> .... P2_4: <input type="text" name="pt2_4" length="10"><br>

P1_5: <input type="text" name="pt1_5" length="10"> .... P2_5: <input type="text" name="pt2_5" length="10"><br>

P1_6: <input type="text" name="pt1_6" length="10"> .... P2_6: <input type="text" name="pt2_6" length="10"><br>

P1_7: <input type="text" name="pt1_7" length="10"> .... P2_7: <input type="text" name="pt2_7" length="10"><br>

P1_8: <input type="text" name="pt1_8" length="10"> .... P2_8: <input type="text" name="pt2_8" length="10"><br>

P1_9: <input type="text" name="pt1_9" length="10"> .... P2_9: <input type="text" name="pt2_9" length="10"><br>

<center>

<input type="button" value="Do 1 Round" name = "dornd" onClick="doRound();"> <input type="button" value="Do X Rounds" name="doxrnd" onClick="doXRounds();"> X:<input type="text" name="xrd" length="10"></center><br>

Rounds: <input type="text" name="rnds" length="10"> <center> <input type="button" value="See Variables" onClick="showVars();"> <input type="button" value="Help" onClick="showHelp();"></center><br><div align="right"><input type="button" value="Change VNA textarea height" onClick="changeArrayH();"></div><br>Cursor Located at Line: <input type="text" name="curatline" length="12"> <font size=1>(Warning - this feature is slow, lol)</font>

</form>

</body>

</html>```

~ Note that my code uses a method called .split which is not supported by Netscape 2 and Explorer 3

~ Also, if you find any bugs/errors in the emulator, please PM me immediately ;D

• Created

## Recommended Posts

• 0

This is the self-sustaining hopper I wrote. While still easily beaten by one of my Hydras, it's pretty nifty anyway.

Redhopper

COPY !,m=!+117

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_114_-3_-3

It uses 117 as its hop-constant [the distance it jumps away each 'iteration'. An iteration for Redhopper is 16 rounds], which allows for 40 iterations or 640 rounds before overwritten the tip of itself. If you used 87 as a constant, it would allow about 1120 rounds before overwrite. I think the ideal constant for Redhopper is 152 or 148, but I haven't calculated it out yet. It could be something else. Anyway that doesn't even matter Enjoy!

##### Share on other sites
• 0

I've just made a program that could be described as a 'quick-bomber'. It uses a clever mechanism to spawn all 9 pointers in a single round, and then keeps them in a bombing loop. While much smaller than Hydra, it's probably more vulernable as Hydra is self-repairing [thus the name] and compartamentalized while this program (Scythe) has all its pointers running the same loop and is thus susceptible to a single bomb.

Anyway, here it is ;D It has a built-in feature to skip bombing itself. It uses Fling Traps for the bombs

Scythe

SET! 48,0

FOOD 0,0

JUMP m=q+1,0

FOOD 0,0

SET! c_!_235_48_48_m=!+2,0

COPY 2,m=!+q

JUMP 0,-3

JUMP 0,100

##### Share on other sites
• 0

LOL!!! The program i built for VNA2.0 was just like this! it never actually used a bomb!!! it was just a program that threw out jump commands in order to send them out of there program!

anyway, this looks good. sign me up

##### Share on other sites
• 0

no signup necessary More of an informal slew of matches against each other. Or, if you want, we can have a King of the Hill (KOTH) tournament that's not a fixed-time tournament but rather everyone just submits a bunch of programs and I randomly and continuously run some against each other to determine which programs are on "the hill". Or we could have a structured tournament. Or just matches. Whatever you want

##### Share on other sites
• 0

I think ill try it out too

##### Share on other sites
• 0

Who wants to battle? Maybe we could start a tournament...

##### Share on other sites
• 0

i was thinking about doing this but i havent actually started properly yet but intend to sometime soon when im in a more concentration-y kind of mood . it looks pretty doable for a non-programmer like me so i'll try my best, should be fun

##### Share on other sites
• 0

i'm kind of confused on how you kill the opponent without bombs or anything like that(or did i miss a part of your nice long topic thread(not that that's a bad thing)).

also now everyone has to make 9 little programs for one battle right?(i didn't see any length limits on them either)

##### Share on other sites
• 0
i'm kind of confused on how you kill the opponent without bombs or anything like that(or did i miss a part of your nice long topic thread(not that that's a bad thing)).

I thought I spelled it out clearly... multiple times You win when your enemy's program dies [ie, all of its pointers are in stasis]. This happens when its energy hits 0. There are various techniques you can do (such as "JUMP 0,0" or "JUMP 0,100" and longer traps) that can be used to attack the enemy. There are no more simple, mindless BOMBs - you have to be more creative. I showed some "traps" in the spoiler entitled 'Tips and Tricks and Bombs' which is the one right before the emulator spoiler.

also now everyone has to make 9 little programs for one battle right?(i didn't see any length limits on them either)

Your program is composed of pointers. At first you only start out with pointer #1, which begins at the first line of your program when it's placed in the VNA. However, a pointer can create a new pointer with JUMP as well as jump around existing pointers. See the description of that command for more detailed info

You can have up to 9 pointers.

Also, download the emulator and run different programs on it, it will help you see how it works. You could use some of the programs I've posted so far, like Redhopper or Scythe, and pit them against each other, etc.

length limits

Did you see the section entitled "Numerical Specifications"? Copied here:

NUMERICAL SPECIFICATIONS

* max program size: 50 nodes

* starting distance between programs: random. If P1 is assumed to start at "node 0", then P2 can start anywhere from "node 56" to "node 244"

~~~

Also, in case you didn't click the 'Help' button in the emulator [i'm pretty sure it's on there], in the pointer data given, it either says "stasis" if the pointer is in stasis, OR it gives two numbers separated by a semicolon like this:

137;10

this means the pointer is at line 137 [the first line of the VNA is line 0] and has 10 energy

The first number is line number, the second is energy

Edited by unreality
##### Share on other sites
• 0

JUMP m=1+q,0

JUMP 0,m=q*4

jump 0,0

jump 0,0

jump 0,0

COPY !,m=!+40

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_37_-3_-3

COPY !,m=!+60

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_57_-3_-3

COPY !,m=!+80

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_77_-3_-3

COPY !,m=!+100

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_97_-3_-3

COPY !,m=!+120

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_117_-3_-3

COPY !,m=!+140

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_137_-3_-3

COPY !,m=!+160

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_157_-3_-3

COPY !,m=!+180

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_177_-3_-3

COPY !,m=!+200

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_197_-3_-3

this one is just 9 red hopper pointers that go round on their own paths

set! -57,0

JUMP m=1+q,0

JUMP FOOD 0,0

COPY 4,m=!-q

set! c_!_-290_-57_m=!-2_-57,0

food 0,0

JUMP 0,-3

JUMP 0,0

this one turned out a lot like your Scythe. i tried to do some other stuff with it but that didn't work.

##### Share on other sites
• 0

nice - but what does JUMP FOOD mean in line 3? Is the 'JUMP' not supposed to be there, or the 'FOOD' not supposed to be there? Or something else?

edit: this is a program I made the other day

A Scanner Darkly

FOOD 0,0

SET! 60,-1

EDIT -1,c_!_0_5_-5_-5,a+:

JUMP 0,c_!_0_-3_1_1

SET! -3,-1

FOOD 0,0

COPY 3,!

SET! m=!+1,0

JUMP 0,-3

JUMP 0,0

true to its name, it scans the VNA for nonzero a-parameters, then starts bombing

edit2: haha I just ran your Redhopper-Gone-Crazy on the emulator - awesome! The only forseeable problem is clashing with itself and getting confused - I assume you tested different numbers and pick the most spaced? It seemed to work pretty decently for a couple hundred rounds.. also I'm not sure if it collided with itself if it would still work by running the next segment

also I love the way you used q*4 to space them out after creation... clever

Edited by unreality
##### Share on other sites
• 0

um... the jump food was is just a mess up my computer did when copying the code

also the hopper could be spaced a little betterbut i wanted to get it done so i could post both programs while you were still on.

##### Share on other sites
• 0

i did some battles with the RHGC and it seems fill the arena with so much stuff that no one can die.

##### Share on other sites
• 0

Yeah that seems to be the primary weakness of hoppers - they can be hard to kill, but they don't accomplish much. They either keep avoiding the enemy's attacks or overwrite the enemy (inciting an infinite spiral).

The only way a hopper can win is to avoid the enemy until the enemy bombs themselves, but all bombers I make have anti-self-bombing techniques, so hopper-vs-bomber games can have 4 outcomes:

1) after any amount of rounds (probably in the first hundred), the bomber destroys the hopper

2) a long time passes with the hopper not jumping onto the bomber and the bomber missing the hopper, and the bomber not bombing itself

3) as #2, except the bomber doesn't have an anti-self-destruct mechanism and bombs itself

4) the hopper overwrites the bomber and they dance around the VNA forever

of these, two are ties, one leads to a bomber win (#1) and one unlikely option (#3) leads to a hopper win.

For VNA 3.0, I think the best bet for a hopper is to augment it with some sort of bombing capability, ie, a bomber-hopper hybrid. This would be harder, though. I'll work on that next.

Also, feel free to run battles against any of my programs. I'm busy so I can't do anything right now, but I'll post them

Hydra

```FOOD 0,0

JUMP 2,11

JUMP 3,13

JUMP 4,15

JUMP 5,17

JUMP 6,22

JUMP 7,27

JUMP 8,35

JUMP 9,40

FOOD 0,0

JUMP 0,-1

JUMP 0,0

COPY -1,60

EDIT -1,5,b+:

JUMP 0,-2

COPY -4,120

EDIT -1,5,b+:

JUMP 0,-2

COPY -7,180

EDIT -1,5,b+:

JUMP 0,-2

JUMP c_p2_300_2_0_0,c_p2_300_-9_1_1

JUMP c_p3_300_3_0_0,c_p3_300_-7_1_1

JUMP c_p4_300_4_0_0,c_p4_300_-5_1_1

FOOD 0,0

FOOD 0,0

JUMP 0,-5

JUMP c_p2_300_2_0_0,c_p2_300_-15_1_1

JUMP c_p3_300_3_0_0,c_p3_300_-13_1_1

JUMP c_p4_300_4_0_0,c_p4_300_-11_1_1

FOOD 0,0

FOOD 0,0

JUMP 0,-5

FOOD 0,0

SET! -22,-2

EDIT c_!_230_-23_-23_100,62,b~:

SET! -21,-2

EDIT c_!_230_-22_-22_100,122,b~:

SET! -20,-2

EDIT c_!_230_-21_-21_100,182,b~:

FOOD 0,0

JUMP 0,c_e_7_-7_-7_-8

FOOD 0,0

SET# -28,-2

EDIT c_#_230_-29_-29_100,122,b~:

SET# -27,-2

EDIT c_#_230_-28_-28_100,182,b~:

JUMP 0,-5

FOOD 0,0

JUMP 0,-1```
This is the first program I made - it's okay, but not very good. Hydra II was a big improvement, but still not the most efficient: Hydra II
```FOOD 0,0

JUMP 2,11

JUMP 3,12

JUMP 4,13

JUMP 5,14

JUMP 6,15

JUMP 7,16

JUMP 8,23

JUMP 9,30

FOOD 0,0

JUMP 0,-1

JUMP 0,0

COPY -1,m=!+60

JUMP 0,-1

COPY -3,m=!+100

JUMP 0,-1

COPY -5,m=!+140

JUMP 0,-1

COPY -7,m=!+180

JUMP 0,-1

SET! c_!_80_2_2_m=!+5,0

JUMP 0,-1

FOOD 0,0

JUMP c_p2_300_2_0_0,c_p2_300_-11_1_1

JUMP c_p3_300_3_0_0,c_p3_300_-10_1_1

JUMP c_p4_300_4_0_0,c_p4_300_-9_1_1

JUMP c_p5_300_5_0_0,c_p5_300_-8_1_1

JUMP c_p6_300_6_0_0,c_p6_300_-7_1_1

FOOD 0,0

JUMP 0,-7

FOOD 0,0

JUMP c_p2_300_2_0_0,c_p2_300_-19_1_1

JUMP c_p3_300_3_0_0,c_p3_300_-18_1_1

JUMP c_p4_300_4_0_0,c_p4_300_-17_1_1

JUMP c_p5_300_5_0_0,c_p5_300_-16_1_1

JUMP c_p6_300_6_0_0,c_p6_300_-15_1_1

FOOD 0,0

JUMP 0,-7

FOOD 0,0

JUMP 0,-1```
I made Redhopper before Hydra II actually... I've posted Redhopper on here earlier: Redhopper
```COPY !,m=!+117

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_114_-3_-3```
this one is probably my deadliest & quickest bomber yet, although it has a crucial hidden weakness: Scythe
```SET! 48,0

FOOD 0,0

JUMP m=q+1,0

FOOD 0,0

SET! c_!_235_48_48_m=!+2,0

COPY 2,m=!+q

JUMP 0,-3

JUMP 0,100```
this one I recently posted: A Scanner Darkly
```FOOD 0,0

SET! 60,-1

EDIT -1,c_!_0_5_-5_-5,a+:

JUMP 0,c_!_0_-3_1_1

SET! -3,-1

FOOD 0,0

COPY 3,!

SET! m=!+1,0

JUMP 0,-3

JUMP 0,0```

It scans for nonzero a-parameters, and when it finds it, bombs it apart. It's an early version and has lots of weakness - ie, I haven't yet installed a mechanism to stop if it doesn't find one and is about to search itself, nor have I installed something to prevent it from self-bombing. But still, it's a good first step for scanner-programs

##### Share on other sites
• 0

```jump m=1+q,0

food 0,0

copy 21,m=54+q

copy 20,m=208+q

copy 19,m=76+q

copy 18,m=186+q

copy 17,m=98+q

copy 16,m=109+q

copy 15,m=164+q

copy 14,m=142+q

copy 13,m=131+q

copy 12,m=153+q

copy 11,m=120+q

food 0,0

food 0,0

copy 8,m=175+q

copy 7,m=87+q

copy 6,m=197+q

copy 5,m=65+q

food 0,0

food 0,0

food 0,0

jump 0,-21

jump 0,0```

this is just a simple speed bomber but it can hit almost the whole area in about 20 rounds

also i updated my signature to include all my programs and advertising to hopefully get some more people here.

##### Share on other sites
• 0

nice, thanks Sorry I haven't been too active on this, I've been busy with some things for school & stuff. I've made two other programs since I last posted, I'll post them sometime today ;D

##### Share on other sites
• 0
nice, thanks Sorry I haven't been too active on this, I've been busy with some things for school & stuff. I've made two other programs since I last posted, I'll post them sometime today ;D

it's ok i'm super bust with drivers ed and basketball season, so i don't get much time either and at this point it's starting to look like you and me will just have to have a huge battle

##### Share on other sites
• 0

as a test i pitted Unreality's Hydra

FOOD 0,0

JUMP 2,11

JUMP 3,12

JUMP 4,13

JUMP 5,14

JUMP 6,15

JUMP 7,16

JUMP 8,23

JUMP 9,30

FOOD 0,0

JUMP 0,-1

JUMP 0,0

COPY -1,m=!+60

JUMP 0,-1

COPY -3,m=!+100

JUMP 0,-1

COPY -5,m=!+140

JUMP 0,-1

COPY -7,m=!+180

JUMP 0,-1

SET! c_!_80_2_2_m=!+5,0

JUMP 0,-1

FOOD 0,0

JUMP c_p2_300_2_0_0,c_p2_300_-11_1_1

JUMP c_p3_300_3_0_0,c_p3_300_-10_1_1

JUMP c_p4_300_4_0_0,c_p4_300_-9_1_1

JUMP c_p5_300_5_0_0,c_p5_300_-8_1_1

JUMP c_p6_300_6_0_0,c_p6_300_-7_1_1

FOOD 0,0

JUMP 0,-7

FOOD 0,0

JUMP c_p2_300_2_0_0,c_p2_300_-19_1_1

JUMP c_p3_300_3_0_0,c_p3_300_-18_1_1

JUMP c_p4_300_4_0_0,c_p4_300_-17_1_1

JUMP c_p5_300_5_0_0,c_p5_300_-16_1_1

JUMP c_p6_300_6_0_0,c_p6_300_-15_1_1

FOOD 0,0

JUMP 0,-7

FOOD 0,0

JUMP 0,-1

against dms's red hopper gone crazy

JUMP m=1+q,0

JUMP 0,m=q*4

jump 0,0

jump 0,0

jump 0,0

COPY !,m=!+40

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_37_-3_-3

COPY !,m=!+60

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_57_-3_-3

COPY !,m=!+80

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_77_-3_-3

COPY !,m=!+100

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_97_-3_-3

COPY !,m=!+120

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_117_-3_-3

COPY !,m=!+140

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_137_-3_-3

COPY !,m=!+160

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_157_-3_-3

COPY !,m=!+180

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_177_-3_-3

COPY !,m=!+200

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_197_-3_-3

and there at round 1284 and still going...

im going to have a go at creating my own 'bomb' tomorrow...

##### Share on other sites
• 0

its still going!

i just realised im going to be busy for the next 2 days... so after that, ill see if i can do something...

(but knowing me im doing it completely wrong... probably )

##### Share on other sites
• 0

haha, nice! Most likely, RHGC invaded Hydra and captured its pointers into its own system. So the game will go on forever. Thus there is no "official" victory, however RHGC gets the "unofficial" victory by overwriting Hydra. Nice job DMS!

It also depends on the starting round. It's a good idea to cover 5 or so starting positions and do switch for each one, for a total of 10 games, to best measure the better opponent. That removes the chance of a lucky starting position

I'm pretty sure Hydra is my worst program, btw - Hydra II is good for what it does, though Scythe is a good one. A Scanner Darkly is decent but can be improved upon. Yesterday I created a hopper-bomber hybrid as well as a new kind of hopper, very sophisticated strategy-wise, which I'm still working on

##### Share on other sites
• 0

Reposting all of my programs, plus the Bombardier at the bottom is a hopper/bomber hybrid. While I concluded that a single pointer that is both a hopper and a bomber (easily possible in VNA 2.0) is hard in VNA 3.0, a much more efficient option is using multiple pointers to have a set bomber working with a separate pointer that runs a hopper. That's Bombardier's strategy - one bomber and one hopper running together [the bomber is unable to hit itself or any pieces of the hopper]

Hydra

FOOD 0,0

JUMP 2,11

JUMP 3,13

JUMP 4,15

JUMP 5,17

JUMP 6,22

JUMP 7,27

JUMP 8,35

JUMP 9,40

FOOD 0,0

JUMP 0,-1

JUMP 0,0

COPY -1,60

EDIT -1,5,b+:

JUMP 0,-2

COPY -4,120

EDIT -1,5,b+:

JUMP 0,-2

COPY -7,180

EDIT -1,5,b+:

JUMP 0,-2

JUMP c_p2_300_2_0_0,c_p2_300_-9_1_1

JUMP c_p3_300_3_0_0,c_p3_300_-7_1_1

JUMP c_p4_300_4_0_0,c_p4_300_-5_1_1

FOOD 0,0

FOOD 0,0

JUMP 0,-5

JUMP c_p2_300_2_0_0,c_p2_300_-15_1_1

JUMP c_p3_300_3_0_0,c_p3_300_-13_1_1

JUMP c_p4_300_4_0_0,c_p4_300_-11_1_1

FOOD 0,0

FOOD 0,0

JUMP 0,-5

FOOD 0,0

SET! -22,-2

EDIT c_!_230_-23_-23_100,62,b~:

SET! -21,-2

EDIT c_!_230_-22_-22_100,122,b~:

SET! -20,-2

EDIT c_!_230_-21_-21_100,182,b~:

FOOD 0,0

JUMP 0,c_e_7_-7_-7_-8

FOOD 0,0

SET# -28,-2

EDIT c_#_230_-29_-29_100,122,b~:

SET# -27,-2

EDIT c_#_230_-28_-28_100,182,b~:

JUMP 0,-5

FOOD 0,0

JUMP 0,-1

~~~

Redhopper

COPY !,m=!+117

SET! c_!_3_0_0_m=!+1,0

FOOD 0,0

JUMP 0,c_!_0_114_-3_-3

~~~

Hydra II

FOOD 0,0

JUMP 2,11

JUMP 3,12

JUMP 4,13

JUMP 5,14

JUMP 6,15

JUMP 7,16

JUMP 8,23

JUMP 9,30

FOOD 0,0

JUMP 0,-1

JUMP 0,0

COPY -1,m=!+60

JUMP 0,-1

COPY -3,m=!+100

JUMP 0,-1

COPY -5,m=!+140

JUMP 0,-1

COPY -7,m=!+180

JUMP 0,-1

SET! c_!_80_2_2_m=!+5,0

JUMP 0,-1

FOOD 0,0

JUMP c_p2_300_2_0_0,c_p2_300_-11_1_1

JUMP c_p3_300_3_0_0,c_p3_300_-10_1_1

JUMP c_p4_300_4_0_0,c_p4_300_-9_1_1

JUMP c_p5_300_5_0_0,c_p5_300_-8_1_1

JUMP c_p6_300_6_0_0,c_p6_300_-7_1_1

FOOD 0,0

JUMP 0,-7

FOOD 0,0

JUMP c_p2_300_2_0_0,c_p2_300_-19_1_1

JUMP c_p3_300_3_0_0,c_p3_300_-18_1_1

JUMP c_p4_300_4_0_0,c_p4_300_-17_1_1

JUMP c_p5_300_5_0_0,c_p5_300_-16_1_1

JUMP c_p6_300_6_0_0,c_p6_300_-15_1_1

FOOD 0,0

JUMP 0,-7

FOOD 0,0

JUMP 0,-1

~~~

Scythe

SET! 48,0

FOOD 0,0

JUMP m=q+1,0

FOOD 0,0

SET! c_!_235_48_48_m=!+2,0

COPY 2,m=!+q

JUMP 0,-3

JUMP 0,100

~~~

A Scanner Darkly

FOOD 0,0

SET! 60,-1

EDIT -1,c_!_0_5_-5_-5,a+:

JUMP 0,c_!_0_-3_1_1

SET! -3,-1

FOOD 0,0

COPY 3,!

SET! m=!+1,0

JUMP 0,-3

JUMP 0,0

~~~

Bombardier

JUMP 2,6

FOOD 0,0

COPY 3,m=!+60

SET! c_!_180_m=p2%5_m=p2%5_m=!+15,0

JUMP 0,-3

JUMP 0,50

COPY #,m=#+30

SET# c_#_3_0_0_m=#+1,0

FOOD 0,0

JUMP 0,c_#_0_27_-3_-3

I haven't finished my Oscillator Trap yet (the more sophisticated one I've been working on) cuz I haven't had enough time.

But something else I was doing (yesterday, actually) was mathematical research on the concepts of jump constants and the numerical behavior of hoppers jumping around the VNA, so as to predict behavior patterns and pick the perfect numbers. I have some conclusions, but for the amount of work I was doing they'll seem weak lol, so I'll post them when I complete what I'm intending to figure out

~~

edit: any complaints/suggestions/comments/etc for my emulator? It works fast, smooth and consistent for me - EXCEPT when I accidentally click inside the VNA screen and then it takes forever calculating what line I clicked on. It doesn't happen very often, but it's annoying. So if anyone else has that issue, I can disable the line-reporter feature entirely, or make an option where the user can disable it.

Edited by unreality
##### Share on other sites
• 0
its still going!

i just realised im going to be busy for the next 2 days... so after that, ill see if i can do something...

(but knowing me im doing it completely wrong... probably )

lol yeah that program was more for fun then to actually battle. it's only had one real win that i've seen. if it goes 100 turns the other programs is probably stuck and it won't end.

edit: i just did some battles with speedy against Bombardier and speedy won 4 out of 5

Edited by dms172
##### Share on other sites
• 0

yeah - as of now, Scythe is my star program

##### Share on other sites
• 0

I'm a first-time programmer (heh, if I can call myself that >_>), and just finished reading through the initial post (making sure to avoid the confusing spoilers!). The program is downloaded and I'm playing with it now. Don't know exactly what I'm doing at this point, but I'm getting there.

Cool topic btw.

##### Share on other sites
• 0

Okay, got the basics down. I wanted to see if I could write a program that would beat Unreality's sample of

COPY 4,10

EDIT -1,2,b+:

FOOD 0,0

JUMP 0,-3

JUMP 0,100

and

COPY 2,4

FOOD 0,0

FOOD 0,0

JUMP 0,-2

beat it during around 450.

That probably isn't that great, but still.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×