Jump to content
BrainDen.com - Brain Teasers
  • 0


unreality
 Share

Question

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:


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 :D

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

The Hunter

EDITI 1;5;1

SHIFT 1;40;equ(a(b(0))+b(b(0))+c(b(0)),0,equ(a(b(0)),b(b(0)),equ(c(b(0)),0,-1,2),2),2)

BOMB 0;0;0

EDITI -2;1;1

SHIFT -2;sub(b(-3),3);-1

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 :D

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! :o 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 :D 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!! :D

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 :D

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 :P

Link to comment
Share on other sites

  • Answers 112
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Posted Images

Recommended Posts

  • 0
BTW, what's SPLIT? I didn't see that command defined in this topic.

SPLIT is a command from VNA. I originally had two more commands called 'SPLIT' and 'MERGE' which allow the creation and destruction of multiple pointers running simultaneously but alternating, like multi-core processors, but I figured it was too complicated for VNA 2.0 (as I was trying to make 2.0 more attractive to non-programmers), so I took them out :D I didn't really like the concept of that anyway, so it was okay

Did you design and write VNA yourself? It looks like quite a bit of programming there.

Mostly, yeah. I was inspired by an old game for old computers about assembly code, but VNA differs by a lot... although the basic concept is essentially the same, the VNA Code was designed by me and has a lot of different elements (like functions) and looks way different than 'redcode' (which is what the other one was). And thanks :D It wasn't that hard...

~~~

Bocinki has joined!! Yippee :P Hehe. I need a program from him as well as still Mekal. I have everything else I need

Link to comment
Share on other sites

  • 0

Okay, I have almost everything... it'll be a duel of 7 programs:

Unreality: The Awesome

Frost: The Uber Penguin Bomber

Mekal: Red Sea

DMS: Bomberman

FOTH: Flawless

Prime: Fish1.1

Bociniki: [Not Yet Named]

because I'm not using my other program, called the Gladiator, I'm posting it here ;D


The Gladiator:

EDITB 6;equ(a(140),0,equ(a(141),0,equ(a(142),0,equ(a(143),0,equ(a(144),0,equ(a(145),0,
equ(a(146),0,equ(a(147),0,equ(a(148),0,equ(a(149),0,equ(a(150),0,equ(a(151),0,eq
u
(a(152),0,equ(a(153),0,equ(a(154),0,equ(a(155),0,equ(a(156),0,equ(a(157),0,equ(a
(
158),0,equ(a(159),0,equ(a(160),0,80,152),151),150),149),148),147),146),144),143)
,
142),141),140),139),138),137),136),135),134),133),132);0
EDITB 5;equ(a(114),0,equ(a(115),0,equ(a(116),0,equ(a(117),0,equ(a(118),0,equ(a(119),0,
equ(a(120),0,equ(a(121),0,equ(a(122),0,equ(a(123),0,equ(a(124),0,equ(a(125),0,eq
u
(a(126),0,equ(a(127),0,equ(a(128),0,equ(a(129),0,equ(a(130),0,equ(a(131),0,equ(a
(
132),0,equ(a(133),0,equ(a(134),0,equ(a(135),0,equ(a(136),0,equ(a(137),0,equ(a(13
8
),0,80,131),130),129),128),127),126),125),124),123),122),121),120),119),118),117
)
,116),115),114),113),112),111),110),109),108),107);0
EDITB 4;equ(a(88),0,equ(a(89),0,equ(a(90),0,equ(a(91),0,equ(a(92),0,equ(a(93),0,equ(a(
94),0,equ(a(95),0,equ(a(96),0,equ(a(97),0,equ(a(98),0,equ(a(99),0,equ(a(100),0,e
q
u(a(101),0,equ(a(102),0,equ(a(103),0,equ(a(104),0,equ(a(105),0,equ(a(106),0,equ(
a
(107),0,equ(a(108),0,equ(a(109),0,equ(a(110),0,equ(a(111),0,equ(a(112),0,80,106)
,
105),104),103),102),101),100),99),98),97),96),95),94),93),92),91),90),89),88),87
)
,86),85),84),83),82);0
EDITB 3;equ(a(62),0,equ(a(63),0,equ(a(64),0,equ(a(65),0,equ(a(66),0,equ(a(67),0,equ(a(
68),0,equ(a(69),0,equ(a(70),0,equ(a(71),0,equ(a(72),0,equ(a(73),0,equ(a(74),0,eq
u
(a(75),0,equ(a(76),0,equ(a(77),0,equ(a(78),0,equ(a(79),0,equ(a(80),0,equ(a(81),0
,
equ(a(82),0,equ(a(83),0,equ(a(84),0,equ(a(85),0,equ(a(86),0,80,81),80),79),78),7
7
),76),75),74),73),72),71),70),69),68),67),66),65),64),63),62),61),60),59),58),57
)
;0
EDITB 2;equ(a(36),0,equ(a(37),0,equ(a(38),0,equ(a(39),0,equ(a(40),0,equ(a(41),0,equ(a(
42),0,equ(a(43),0,equ(a(44),0,equ(a(45),0,equ(a(46),0,equ(a(47),0,equ(a(48),0,eq
u
(a(49),0,equ(a(50),0,equ(a(51),0,equ(a(52),0,equ(a(53),0,equ(a(54),0,equ(a(55),0
,
equ(a(56),0,equ(a(57),0,equ(a(58),0,equ(a(59),0,equ(a(60),0,80,56),55),54),53),5
2
),51),50),49),48),47),46),45),44),43),42),41),40),39),38),37),36),35),34),33),32
)
;0
EDITI 1;2;1
COPY 2;0;0
SHIFT 1;b(-1);geq(b(-1),170,2,-2)
BOMB 0;0;0
JUMP 0;0;0
[/codebox]

I tried to make it so that the functions each have the maximum nestable amount (I playtested until I hit a limit), but then ended up adding an extra b(something function) in each so it's sort of over... anyway, there's sort of an official nested-function limit now. I just have to eyeball it and I can know if it probably will capsize the emulator ;D Hehe. The Gladiator is just above the acceptable line, another reason why I can't enter it :P

Link to comment
Share on other sites

  • 0
Right now I have about 5 and a half matches complete. By the time my temporary ban is over, I should have a good deal more :D It takes longer than I thought

btw Prime, I still am not sure whether you want me to use 1.1 or 3, so I'll hold back on yours

I've sent you my Fish3 the Flipper again.

Here is an example of what a round-robin tournament table may look like.

post-9379-1227479057.gif

Perhaps, you could make one like that filling the participant names and publish the latest standings once a day, just to keep the suspense. :)

Link to comment
Share on other sites

  • 0

Tournament Results

Be sure to check out my VNA Riddles, which I made during my exile ;D

The tournament didn't go as well as I was hoping for - it took a long time, but that wasn't the main problem - the thing was, 3 of the 7 programs had fatal flaws that incapacitated them and essentially denied them a possible victory. Those programs were FOTH's "Flawless" (hehe ironic name :P), Prime's "Fish3-Flipper" and bociniki's "Rail Gun". I saw bociniki's program's problem right when he PMed it to me, and was dying to tell him, but that wouldn't be fair. I did tell him multiple times to make sure he checked over his problem, but he seemed confident in it :( Sorry guys! I have no idea what the problem is with Flawless or Fish3, because on request I did not analyze them after receiving them, however both programs would snag on a specific line and then stay there, jumping back to it repeatedly. When I post everyone's programs, I'll point out the line in question. Both programs managed to get out 1, maybe 2, bombs, before they were caught in their own endless loops, but they never hit an enemy, and thus they were caught in stasis while the other program bombed them out, so I removed them from the tournament.

Bociniki's problem was simpler: his Rail Gun shot bombs upwards 1 instead of backwards (he started by bombing -40, and I'm sure he meant to go backwards from there), and thus he would just cover the no-program zone of 40 behind him until it hit himself, so I mercifully removed it too ;D

Sorry guys... revising your programs is the fun of VNA though, so it's no biggie ;D Just the first tournament. Next time I might do things a little differently, not sure. It will be a while before another formal event like this, although I will run any match between any two programs at the programmers' request :)

So, the four programs that worked: Unreality's "Awesome", Frost's "The Uber Penguin Bomber", Mekal's "Red Sea" and DMS's "Bomberman"

I made myself a 7x7 chart with a diagonal-half represented everyone against everyone, although with the three error-programs removed, it's just a triangle of the 4 programs (6 squares for 6 battles). However, it's kind of hard to reproduce that here, so I'll just list the standings:

Key - each match has a bunch of games, which are the individual numbers. Each game uses the same starting location, but switches the two players, thus each game is comprised of two battles. For example, if Unreality and Frost battled at 97, Unreality starts at line 1, Frost at 97 (so they are 96 apart), and Unreality goes first. Then, Frost starts at line 1, Unreality at 97, and Frost goes first. A zero (0) means it was a tie; ie, one person won a battle, and one person won the other. A non-zero number relates to the person's ID number:

unreality-1, frost-2, mekal-3, DMS-4. The number in parentheses is the starting line.

You need 4 games to win the match, remember. When clicking the random button, I would skip a number if it was within a couple nodes away from a previously used line, or that line's inverse (202 minus the number, which is the exact same thing because two games are played)

Here are the results. Note that for some games I forgot to switch who goes first, but I went back and redid a lot to make sure of the results, and also discovered that it only made a difference in one battle of one game of one match, and didn't affect overall results. But everything should be 100% good, if you want to check yourself on a different emulator go ahead.

In the general order of the matches I ran:

Unreality vs Frost

0(97), 1(118), 0(52), 1(61), 1(159), 2(66), 0(87), 1(101). Winner: 1

Unreality vs Mekal

0(88), 1(144), 0(109), 1(120), 1(136), 1(128). Winner: 1

Mekal vs Frost

0(150), 2(70), 2(88), 3(97), 2(129), 3(81), 2(62). Winner: 2

Mekal vs DMS

0(122), 3(102), 0(136), 3(110), 0(58), 0(83), 0(160), 0(75), 0(150), 0(90), 3(105), 3(130). Winner: 3

DMS vs Unreality

1(113), 1(105), 0(53), 1(83), 0(137), 1(93). Winner: 1

DMS vs Frost

2(137), 4(156), 4(126), 0(58), 4(71), 4(149). Winner: 4

Overall Results:

I won 3 games, beating Frost, Mekal, DMS. Frost won 1 game, beating Mekal. Mekal won 1 game, beating DMS. DMS won 1 game, beating Frost.

I guess it was like a rock-paper-scissors thing or something :P Anyway, I'm sure there would be a lot more wins and losses for everyone if the programs of FOTH, Prime and bociniki were working properly as they wanted them to (there would have been 21 matches instead of 6). No biggie though ;D

Here are the programs, their code, and my notes on them:

Unreality - the Awesome


EDITI 5;1;1
COPY 4;add(add(add(29,div(sub(b(4),mod(b(4),15)),15)),mul(add(mod(b(4),3),1),10)),mod
(mul(sub(b(4),mod(b(4),3)),2),10));0
COPY 3;add(add(add(58,div(sub(b(3),mod(b(3),15)),15)),mul(add(mod(b(3),3),1),10)),mod
(mul(sub(b(3),mod(b(3),3)),2),10));0
COPY 2;add(add(add(87,div(sub(b(2),mod(b(2),15)),15)),mul(add(mod(b(2),3),1),10)),mod
(mul(sub(b(2),mod(b(2),3)),2),10));0
SHIFT 1;add(add(add(116,div(sub(b(1),mod(b(1),15)),15)),mul(add(mod(b(1),3),1),10)),mo
d(mul(sub(b(1),mod(b(1),3)),2),10));equ(b(1),29,5,-4)
BOMB 0;-1;0
BLANK 0;0;0
BLANK 0;0;0
BLANK 0;0;0
SWAP 0;1;0
[/codebox]

I'm pretty proud of the Awesome, having spent some hard work figuring out some of the concepts, and there was a certain point where I had a huge breakthrough in its design... I was trying to increase different values at different times in a very complicated mess... then I found that I would just increment a single value by 1 each time with a single EDIT, and everything else can base off of that using arithmetic functions, most importantly the indispensable [b]mod[/b] function

Anyway, I think that my program may have lost against FOTH's or Prime's, if they get theirs working. Or maybe not. Maybe we can battle when they fix theirs ;D

Frost - the Uber Penguin Bomber

[codebox]
EDITC 0;equ(mod(c(0),3),1,mul(-1,c(0)),equ(mod(c(0),3),2,mul(c(0),2),equ(mod(c(0),3),-1,mul(c(0),2),equ(mod(c(0),3),-2,mul(-1,c(0)),64))));32
SHIFT 1;c(-1);-1
BOMB 0;0;0

Frost's was a great program - although it could bog down the emulator when its number got bigger and bigger. I decided to mod the result by 600 to keep it smaller. This preserves the mod3 value of the number as well as the mod200 value (for VNA position), thus not interfering with the program's functioning while making it less burdoning on my emulator :)

About the program design itself, it had a flaw, and that was that it becomes a loop after a certain, not too long, amount of time. After a certain point it would reach a number it had been at before, and then from that point on it could be considered a loop, and I would just wait for the other program to beat it. If I were making version 2 of this program (which has a lot of potential), I would perhaps add a touch of extra into its bomb-target-generating process

Mekal - the Red Sea


COPY 9;100;0
COPY 8;95;0
COPY 7;40;0
COPY 6;-40;0
EDITI -4;5;1
EDITI -4;-5;1
EDITI -4;5;1
EDITI -4;-5;1
JUMP -8;0;0
BOMB 0;0;0
[/codebox]

I was a big fan of Red Sea. This was a great program! Very powerful and sleek, and yet, looking at its code... it has no complex structures, no functions :D Because functions are so vital (they add so much into what a program can do), to see a 'pure-numbers' program kick some @ss was pretty awesome. Good job Mekal! ;-)

DMS - Bomberman

[codebox]
EDITI 1;-1;1
SHIFT 1;-40;-1
BOMB 0;0;0

This little program holds a lot of surprises - it's pretty effective, although also easy to beat sometimes. That may sound contradictory, but in essence this program is a time bomb. It drops a BOMB one more node backwards every 2 rounds, so it's guaranteed to kill you unless (a) you are some sort of Hopper or Hopper-Hybrid, which none of these programs were [although 'the Awesome' had a backup plan like that, and I was considering submitting a hopper-bomber-hybrid program I made], or (b) you kill it first. So it's a race against time: can the other program land a bomb in one of the two nodes that Bomberman runs, or will Bomberman bulldoze backwards into their territory? It was pretty fun watching a column of solid BOMBs advance toward the enemy. For a Bomberman 2.0, I would suggest -2 instead of -1 for speedier rampage... and maybe a more complicated mechanism that starts the advance over, hitting the odd nodes instead of even afterwards. Or something. Anyway, great program DMS ;D

FOTH - Flawless


JUMP 5;0;0
BOMB 0;0;0
BLANK 0;0;0
BOMB add(c(-12),add(c(-8),add(c(-4),add(c(4),add(c(8),c(12))))));sub(mod(mul(a(0),16),28),12);1
BLANK 0;0;0
EDITC leq(c(0),1,0,equ(a(-2),6,0,sub(b(-2),2)));leq(c(0),1,add(c(0),1),0);0
SHIFT com(c(-1),1,-3,equ(a(-3),6,equ(add(a(77),add(b(77),c(77))),1,0,-3),-3),-1);com(c(-1),1,75,equ(a(-3),6,78,sub(b(-3),3)),77);com(c(-1),1,-1,equ(a(-3),6,equ(add(a(77),add(b(77),c(77))),1,78,-1),equ(c(b(-3)),1,-1,0)),-1)
BLANK 0;0;0
BOMB 0;0;0
[/codebox]

It was probably a good program, although certainly not "Flawless" - it's error was getting stuck on a certain line and then running that line over and over again. That line was the big SHIFT line. I don't know exactly what's wrong or what needs to be fixed - that's up to you. Good luck ;D

Prime - Fish3

[codenamed Flipper]
[codebox]
SHIFT 1;-25;31
BOMB -25;-25;-25
BOMB -5;-2;1
BOMB 2;0;3
BOMB 1;1;1
BOMB -2;1;-2
BOMB 1;4;2
BOMB 3;5;-2
BOMB 2;-1;0
BOMB 1;0;2
BOMB 0;-5;1
BOMB -3;-5;-1
BOMB -1;-2;-2
BOMB -1;2;1
BOMB -2;1;-2
BOMB 1;4;2
BOMB 3;5;-2
BOMB 2;-1;0
BOMB 1;0;2
BOMB 0;-5;1
BOMB -3;-5;-1
BOMB -1;-2;-2
BOMB -1;2;1
BOMB 2;-1;0
BOMB 1;0;2
BOMB 0;-5;1
BOMB -3;-5;-1
BOMB -25;-25;-25
BOMB -2;-3;-2
EDITC 0;mod(add(c(0),17),160);0
PCOPY -2;add(c(-1),10);10
SHIFT equ(b(-2),mod(add(c(-2),17),160),equ(c(-1),10,1,4),3);equ(b(-2),mod(add(c(-2),17),160),equ(c(-1),10,mul(-1,add(c(-2),32)),-1),-2);equ(b(-2),mod(add(c(-2),17),160),equ(c(-1),10,-2,6),6)
BOMB 11;22;9
BOMB -25;-25;-25
EDITC 0;mod(add(c(0),17),160);0
PCOPY -2;add(c(-1),10);10
SHIFT equ(b(-2),mod(add(c(-2),17),160),equ(c(-1),10,1,4),3);equ(b(-2),mod(add(c(-2),17),160),equ(c(-1),10,mul(-1,add(c(-2),32)),-1),-2);equ(b(-2),mod(add(c(-2),17),160),equ(c(-1),10,-2,6),6)
SHIFT equ(c(-6),10,-1,-2);equ(c(-6),10,-6,-7);equ(c(-6),10,-6,0)
BOMB 3;2;5
BOMB 1;2;3

The line that this program got stuck one was a SHIFT line. Specifically, the simplest one, the one at the end. The line that's 3rd to last in the program. It was a mistake having the result be 0 if c(-6) wasn't equal to 10. You would never do this because c(-6) will never change, unless based on something external or something. I checked, and c(-6) is based off of b(-2), c(-2) and c(-1) [from -6's perspective, they would be -8 and -7 from the error line], and b(-2) is based off of c(0) [ie, c(-2)]. So it comes down to the c fields of those two adjacent lines, which start out at 0 and 10 and wouldn't change unless changed by something external, which you're not doing if you're caught in a JUMP 0 fest at the last SHIFT line. Good luck fixing, hopefully the fix isn't too tough :;-)

Bociniki - Rail Gun


COPY 3;-40;0
EDITI -1;1;1
JUMP -2;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
BOMB 0;0;0
[/codebox]

As I said earlier, the problem here is you advanced +1 from -40 instead of -1. As a result, you covered the no-man zone and then proceeded to bomb yourself. Fix that, and merge COPY/JUMP nodes to make a SHIFT, and you have DMS's Bomberman ;D (plus a bunch of BOMBs at the end)

Good job everyone and thanks to those that submitted! ;D My favorite battle to watch was probably a DMS vs Mekal battle, I forget which one specifically, where they were both on the verge of killing each other. It was pretty intense

So... check out the VNA Riddles if you get a chance, and see you around. Comments/ideas/suggestions/questions/etc, post em right here :P Like I said earlier, I'll happily run a battle between any two willing programs ;D

thanks for playing the VNA 2.0 Tournament :) Future VNA stuff will happen eventually, after some input by you guys

Link to comment
Share on other sites

  • 0

There was certainly some intentional irony in my choice of name - i had very little time to run over it to check it worked, so thought i'd call it flawless in case it was! Looking at it now i can already see it should have been jump 6 to start with!

Oh well. I'll take a proper look in the morning to see if I can spot the error. Having had a quick read of the others, though, I think it takes a different approach, as it is a form of hopper with some careful protection. Unfortunately, that's no use if it gets stuck! I'm keen for it to have a proper outing so won't explain its entire tactics yet...

Link to comment
Share on other sites

  • 0

There is a bug in my program. The third line from the end should be:

SHIFT equ(c(-7),10,-1,-2);equ(c(-7),10,-6,-7);equ(c(-7),10,-6,0)

Without testing, it's hard to make a program of some complexity to run on the first try.

That said, I don't quite see why it could not compete as is, unless there is another bug somewhere in the program. That line should never have been executed, unless the program "sensed" it was corrupted (bombed). That statement was meant to fix the damage. If it failed to mend the damage, it simply tries to survive by looping on the same instruction. If the opponent failed to find and bomb it in a reasonable time -- that's a draw!

A draw seems like a very legitimate outcome. A pointer may get lost and wind up executing the opponents program. Or both programs can end up in a cycle, where they cannot kill one another.

It seems the tournament has revealed some areas for improvement of its format. Consider the following suggestions:

1. Set a limit for the length of each fight. Say, after 5000 steps if both pointers are still alive -- then it's a draw.

2. As I suggested before, there is no need for determining the winner between every two contestants. A tie should be perfectly acceptable. Let's say a match between two contestants consists of 2 rounds 2 games each. (One round: get random positions, let them fight (one game), swap the positions and the first move and let them fight again.)

For each program an outcome of a single game could be: loss = 0 points, draw (both survived after 5000 steps) = 1 point; win (the opponent exploded) = 2 points. In the end just add up all points for each program and see who the winner is.

That should save a lot of time.

This game is fun. If I find the time, maybe, I'll write my own VNA interpreter, so that I can test my "Fishes" before sending them to fight.

Link to comment
Share on other sites

  • 0
There is a bug in my program. The third line from the end should be:

SHIFT equ(c(-7),10,-1,-2);equ(c(-7),10,-6,-7);equ(c(-7),10,-6,0)

Without testing, it's hard to make a program of some complexity to run on the first try.

That said, I don't quite see why it could not compete as is, unless there is another bug somewhere in the program. That line should never have been executed, unless the program "sensed" it was corrupted (bombed). That statement was meant to fix the damage. If it failed to mend the damage, it simply tries to survive by looping on the same instruction. If the opponent failed to find and bomb it in a reasonable time -- that's a draw!

Well I'm not sure what the problem exactly was, but it was definitely looping on itself, fairly quickly after beginning, running the same line over and over

A draw seems like a very legitimate outcome. A pointer may get lost and wind up executing the opponents program. Or both programs can end up in a cycle, where they cannot kill one another.

I agree. Two hoppers would be caught in an unending dance, or one COPY 0;1;0 that overwrites the next, starting an infinite loop, are all cases of an infinite tie. In theory, it will happen eventually, but I've never seen it happen ever in running any games from VNA or VNA 2.0... so if it ever does happen, I'll recognize it, don't worry :D

It seems the tournament has revealed some areas for improvement of its format. Consider the following suggestions:

1. Set a limit for the length of each fight. Say, after 5000 steps if both pointers are still alive -- then it's a draw.

Nah that would take too long - the longest game I've ran was upwards of 200 rounds. I manually click a button to run each round (I should probably program in a button that does many rounds and stops at victory lol), so I can manually spot an infinite loop far before 5000 rounds

2. As I suggested before, there is no need for determining the winner between every two contestants. A tie should be perfectly acceptable.

A tie is perfectly acceptable, if it's an infinite loop tie. Or if the match keeps getting filled with 0's (ie, one person won the first battle of the game, the other person won the second), I'll call it a tie. This has never happened, ever, so it's a special-case type thing. If I see a need to declare a tie, that's what I'll do :D

Thanks so much for your suggestions! There won't be a tournament for a while, and maybe not the same format, who knows. Until then, my VNA energy will be maintaining the 'VNA riddles' I just started, and running matches between two players that want to battle :) I may battle too

This game is fun. If I find the time, maybe, I'll write my own VNA interpreter, so that I can test my "Fishes" before sending them to fight.

yeah, I realized while typing this one thing I should add to my emulator: beneath my "Do 1 Round" button, put a "Do X Rounds" button, that does a bunch of rounds (perhaps I can input the number) at a time, stopping if someone wins of course. That way there's no need to click away ;D I didn't do this before out of laziness, but now that the Tournament is over, I'll do it soon :D

edit: Mekal: the max program size is 40 nodes, although I don't really see the need to make a program that long ;D Length is usually a setback

Edited by unreality
Link to comment
Share on other sites

  • 0
Well I'm not sure what the problem exactly was, but it was definitely looping on itself, fairly quickly after beginning, running the same line over and over

...

I don't see why. The program is supposed to loop endlessly in the three statements:

EDITC 0;mod(add(c(0),17),160);0

PCOPY -2;add(c(-1),10);10

SHIFT equ(b(-2),mod(add(c(-2),17),160),equ(c(-1),10,1,4),3);

equ(b(-2),mod(add(c(-2),17),160),equ(c(-1),10,mul(-1,add(c(-2),32)),-1),-2);

equ(b(-2),mod(add(c(-2),17),160),equ(c(-1),10,-2,6),6)

Unless it detected damage to itself. Then it should go into repair mode and return.

Unless I don't understand something about VNA.

I expect that the expression in the SHIFT statment: ... mod(add(c(-2),17),160) ... would evaluate to the same thing as the "b" parameter in the EDIT statement two lines prior:

EDITC 0;mod(add(c(0),17),160);x regardles of the value of "x".

I don't see why there aren't many draws. If programs move about and repair the damage, they could chase each other for a long time, not necessarily forever. Simply covering the entire field with bombs should not be enough to catch a good program.

Link to comment
Share on other sites

  • 0

hmmm. I've had a good look at my program and it definitely does what it's supposed to apart from the stupid JUMP 5 error which should have been JUMP 6! Oh well!

I even went to the lengths of programming an excel version of the VNA to test it, which I'll post somewhere for you all later. I haven't run any against Flawless yet, but will have a go later.

UR, I'm not sure how your emulator deals with circular references but I also discovered a potential difficulty which I have yet to overcome - one of my com functions, in certain circumstances, reduces down to give a c-value of com(6,6,0,0,c(0)). In theory this is fine because the c(0) should never be evaluated. However, Excel can't deal with it because it wants to evaluate everything in the function. Unfortunately, it means I'm going to have to put another level of error-checking in my parser.

To get round it, I've changed one of the lines, so here's the corrected Flawless:

JUMP 6;0;0

BOMB 0;0;0

BLANK 0;0;0

BOMB add(c(-12),add(c(-8),add(c(-4),add(c(4),add(c(8),c(12))))));sub(mod(mul(a(0),16),28),equ(a(0),6,0,12));1

BLANK 0;0;0

EDITC leq(c(0),1,0,equ(a(-2),6,0,sub(b(-2),2)));leq(c(0),1,add(c(0),1),0);0

SHIFT com(c(-1),1,-3,equ(a(-3),6,equ(add(a(77),add(b(77),c(77))),1,0,-3),-3),-1);com(c(-1),1,75,equ(a(-3),6,78,sub(b(-3),3)),77);com(c(-1),1,-1,equ(a(-3),6,equ(add(a(77),add(b(77),c(77))),1,78,-1),equ(c(b(-3)),1,-1,0)),-1)

BLANK 0;0;0

BOMB 0;0;0

Link to comment
Share on other sites

  • 0

Prime: no, not necessarily. The first line, the EDITC one, is taking the current c-value, adding 17, and modding 160. Then the line two nodes later (if they run in that order), takes that changed value, adds 17, mods 160. Think about it :D

FOTH: yeah it was probably just the JUMP in the very beginning that caused the error

Circular reasoning: look at the OP of this topic ;D Near the end is a spoiler that reads:

""If you want to know about things you cannot do that cause infinite loops, this is for you!""

and there I detail the paradoxical possibilities of the a/b/c functions and how not to use them. You are not allowed to use c(0) in a c-parameter, which you did. So it's good that you corrected it :)

And you guys don't need to post your corrected programs if you don't want to, I'm not doing anything with them unless you want me to (then you would PM the program)

Link to comment
Share on other sites

  • 0
Prime: no, not necessarily. The first line, the EDITC one, is taking the current c-value, adding 17, and modding 160. Then the line two nodes later (if they run in that order), takes that changed value, adds 17, mods 160. Think about it :D

...

That's not what I meant. Given the following code segment:

EDITC x;mod(add(c(0),17),160);x

PCOPY ...

SHIFT equ(b(-2),mod(add(c(-2),17),160),true,false);x;x

The "equ" statement in the SHIFT command must always evaluate to true, since it compares the "b" argument of the EDITC command with the expression which is equivalent to the one found in that argument and refers to the same input data. My understanding of the interpreter is that it evaluates b(-2) using the formula residing in the b(-2), then it evaluates the expression mod(add(c(-2),17),160) and finding the result to be equal (and it cannot be otherwise), returns "true".

If it was not so, that would mess up my program. Other than that I can't see why it would leave its loop and go into the repair mode. Can you test whether that comparison in the SHIFT statement returns false? Because, if it does -- that would be the VNA Emulator's bug.

Edited by Prime
Link to comment
Share on other sites

  • 0
I successfully created a "Do X Rounds" button with a text field to input the number of rounds I want to run (it stops automatically if someone wins), so this should make running games be quicker :D

Oh and Prime I tested my VNA emulator just in case, no bug ;D The lines we were talking about work fine :)

But then I don't see why my program would leave its normal loop and go into repair loop, unless it got bombed.

The only bug I could see is the one you pointed out, in the repair loop, where I put an offset -6 instead of -7.

Link to comment
Share on other sites

  • 0
FOTH: yeah it was probably just the JUMP in the very beginning that caused the error

Circular reasoning: look at the OP of this topic ;D Near the end is a spoiler that reads:

""If you want to know about things you cannot do that cause infinite loops, this is for you!""

and there I detail the paradoxical possibilities of the a/b/c functions and how not to use them. You are not allowed to use c(0) in a c-parameter, which you did. So it's good that you corrected it :)

I did not have c(0) directly evaluated in a c-parameter: but had something of the form equ(F,0,c(G),c(F)), with F and G other functions to be evaluated. This meant that, if F evaluates to 0, it reduces down to equ(0,0,c(G),c(0)), which should be fine as the c(0) is guaranteed not to be evaluated. However, it depends on whether your emulator always evaluates every argument of a function (as my Excel version is currently doing).

I have been running a few of the programs against mine - the matches have been lasting quite a long time and just filling the array with BOMBs! UR: Why does your program jump out of its loop after 29 rounds? On one of my tests it was the only reason Flawless beat you: the two programs spent the entire time just missing each other, until you jumped out of your loop and hit my BOMB.

I will post the Excel file later once I've fixed the potential circular reference error.

Edited by foolonthehill
Link to comment
Share on other sites

  • 0

And Prime's program works fine for me - it loops through the EDITC/PCOPY/SHIFT lines copying BOMBs throughout the VNA. In fact, it beat Flawless fairly quickly as changed the command of one of my main lines to a BOMB after about 10 rounds. It never went into the repair loop section.

No time to look at it in more detail, but will try making it repair itself later.

Link to comment
Share on other sites

  • 0

Here's my Excel emulator. It still fails if there is any sort of circular reference (eg. c-argument of equ(1,1,1,c(0)), but otherwise I think follows the OP correctly.

foth VNA Emulator

The programs are held on a sepearte sheet, so paste them into column A there and add a named range prefixed with "prog_" so that it can auto load it into the array. Clicking Reset blanks out the array (it's actually quite good to try it with BOMB 1;1;1 as the default throughout the array! No room for errors!) and copies the named programs into their relevant starting position.

Let me know what you think.

Link to comment
Share on other sites

  • 0

Prime: well I ran the version you gave me for the tournament. If you've fixed it since then, I obviously have no idea if it works or not :) I can run your newer version if you want (post it again)

FOTH: if you're running Prime's newer versions, he's probably fixed it, but if you ran the same version mine did, it should have gotten stuck fairly quickly (first few rounds). If not, no offense, but something is wrong with your Excel emulator :D My emulator runs all commands & functions perfectly as they should be, I've extensively tested it. And, again, you can't have any c(0) in a c-parameter. If you have something that COULD evaluate to it, it's a risk. If it's never supposed to happen, why not make it something other than 0? Because 0 just causes an infinite loop that jams the emulator. It was in the OP of this topic but I'll say it again: No a(0) in the a-param, b(0) in the b-param, or c(0) in the c-param! There are other logical impossibilities, all detailed in the spoiler near the bottom of the OP. If an emulator encounters such a logical paradox it should end the game immediately and report the problem. Or just leave it, because nobody should have anything like that in their program

oh and the VNA is initially filled with BLANK 0;0;0, not BOMB 1;1;1. I considered doing all bombs, but decided that BLANKs were better

Edited by unreality
Link to comment
Share on other sites

  • 0
Here's my Excel emulator. It still fails if there is any sort of circular reference (eg. c-argument of equ(1,1,1,c(0)), but otherwise I think follows the OP correctly.

foth VNA Emulator

The programs are held on a sepearte sheet, so paste them into column A there and add a named range prefixed with "prog_" so that it can auto load it into the array. Clicking Reset blanks out the array (it's actually quite good to try it with BOMB 1;1;1 as the default throughout the array! No room for errors!) and copies the named programs into their relevant starting position.

Let me know what you think.

I think this is great! I downloaded your emulator to my laptop. Now we can test and train programs before sending them into battle.

It is just as well that Excell cannot handle circular references. They should be illegal. There is no way to detect all of them programmatically, so what we could do is to set some limit for nesting. When you do parsing, your functions could keep track of how "deep" nesting is and return an error if it is greater than some preset number, say 40.

Spreadsheet format accomodates well for VNA commands. Maybe, we can do away with ";" delimeters? Just enter command name into one cell, argument a, into the next, then b, then c.

Prime: well I ran the version you gave me for the tournament. If you've fixed it since then, I obviously have no idea if it works or not :) I can run your newer version if you want (post it again)

FOTH: if you're running Prime's newer versions, he's probably fixed it, but if you ran the same version mine did, it should have gotten stuck fairly quickly (first few rounds). If not, no offense, but something is wrong with your Excel emulator :D My emulator runs all commands & functions perfectly as they should be, I've extensively tested it. And, again, you can't have any c(0) in a c-parameter. If you have something that COULD evaluate to it, it's a risk. If it's never supposed to happen, why not make it something other than 0? Because 0 just causes an infinite loop that jams the emulator. It was in the OP of this topic but I'll say it again: No a(0) in the a-param, b(0) in the b-param, or c(0) in the c-param! There are other logical impossibilities, all detailed in the spoiler near the bottom of the OP. If an emulator encounters such a logical paradox it should end the game immediately and report the problem. Or just leave it, because nobody should have anything like that in their program

oh and the VNA is initially filled with BLANK 0;0;0, not BOMB 1;1;1. I considered doing all bombs, but decided that BLANKs were better

I did not send anything to FOTH. The version he ran is the one that you published here. I did not go through FOTH's emulator code, but could see nothing wrong thus far with its operation.

On the other hand, I am still curious, why Fish3 went astray on UR's emulator. Perhaps, you could step through it and see what causes it to branch out into "repair" mode.

Link to comment
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...