Jump to content
BrainDen.com - Brain Teasers
  • 0


Prime
 Share

Question

I have developed my own VNA emulator in Excel. Let's call it VNA2.e. You can download (or open and save) it from VNA2.e

Of course, you must have MS Excel on your computer. The workbook contains macros (lot's of them) so you may need to change your browser's security settings to allow downloading/opening that file.

It was a somewhat sizeable project (about 1500 lines of code). The emulator features own parser and a rudimentary user interface with input validation error checking. I did it to keep my programming skills alive and to learn programming in Excel. I'm sure, it is still full of bugs, so I could use help in testing it. Run your VNA programs in it and let me know if some commands or user interface do not perform as coded.

The Emulator comes with 5 sample VNA warriors: Fish2, Fish2.2, and Fish3 (of my own design); and Awesome and Ghost (by Unreality copied from his VNA topic). The Worksheet "VNA Reference" contains information on how to operate the emulator.

Have fun. We shall have another tournament soon. :)

Link to comment
Share on other sites

Recommended Posts

  • 0

My emulator has nzero(n) function, which returns 0 if all 3 arguments at n are zero, and 1 otherwise. It was done per original specifications. Since I have annonced it that way and distributed with my Emulator, I am going to leave it in that form for the tournament. After the tournament, I can change it to nzero(n,a,b).

I implemented slightly different more efficient "megastructure" argument. It searches for starting location of the opponent and bombs it. For 2n locations it nests only n levels. Theoretically, you could search 120 locations with it. I made it to check only 40 locations, or so. And it kills on the first move quite often. Such first command does not hamper the rest of the program in any way. It is a SHIFT command, which jumps into the main logic of the program afterwards. It's a cheap shot, but it gives a huge advantage. And if it is legal, why not?

I will leave nesting level at 100, since that's the way it in the Emulator that I posted for everyone to download.

Link to comment
Share on other sites

  • 0

the point of this discussion, I thought, was to find a way to outlaw pesky megastructures without impeding on the functionability of legal programs. Clearly there is no strict computational way to measure megastructure, it's more of a case-by-case human judgment thing. Just because there are no exact rules forbidding megastructure, it IS a cheap shot and NOT legal (maybe not yet, but it should be), at least by my standards... it doesn't mean we should just say "oh well" and jump on the megastructure train. I'm trying to think of a way to prevent megastructures otherwise, but it's a fuzzy line between necessary function nesting and uber-repetitive-&-sequential function nesting. So I hope you don't actually put one in your program.... by the way this tournament seems to be going, I don't think I'll participate. Sorry man, I think it's fun, but megastructures (and some other things that crossed my mind) are a huge snag :) I think it may just be you and Mekal for this one ;D (unless someone has been secretly working on a program that will pwn us all :P)

Link to comment
Share on other sites

  • 0
the point of this discussion, I thought, was to find a way to outlaw pesky megastructures without impeding on the functionability of legal programs. Clearly there is no strict computational way to measure megastructure, it's more of a case-by-case human judgment thing. Just because there are no exact rules forbidding megastructure, it IS a cheap shot and NOT legal (maybe not yet, but it should be), at least by my standards... it doesn't mean we should just say "oh well" and jump on the megastructure train. I'm trying to think of a way to prevent megastructures otherwise, but it's a fuzzy line between necessary function nesting and uber-repetitive-&-sequential function nesting. So I hope you don't actually put one in your program.... by the way this tournament seems to be going, I don't think I'll participate. Sorry man, I think it's fun, but megastructures (and some other things that crossed my mind) are a huge snag :) I think it may just be you and Mekal for this one ;D (unless someone has been secretly working on a program that will pwn us all :P)

I made a suggestion, which would render a "megastructure" ineffective. Prohibit bombing on the first move. So that you have a chance hide your pointer in the middle of a 40-node program body. But you did not like that solution.

I joined this game on your invitation and submitted my entry early as you insisted and kept prodding me. After that I waited few weeks and you did not run it, as your VNA emulator did not work as promised. Actually, you ran only those entries against which you could win. So I wrote my own emulator and can't see the end of complaints and objections from you. Why did you invite me to play your game when you really don't want to compete? Did you think I would be an easy opponent to win against? :angry:

Link to comment
Share on other sites

  • 0
I made a suggestion, which would render a "megastructure" ineffective. Prohibit bombing on the first move. So that you have a chance hide your pointer in the middle of a 40-node program body. But you did not like that solution.

I joined this game on your invitation and submitted my entry early as you insisted and kept prodding me. After that I waited few weeks and you did not run it, as your VNA emulator did not work as promised. Actually, you ran only those entries against which you could win. So I wrote my own emulator and can't see the end of complaints and objections from you. Why did you invite me to play your game when you really don't want to compete? Did you think I would be an easy opponent to win against? :angry:

whoa, you've got it all wrong buddy :)

I made a suggestion, which would render a "megastructure" ineffective. Prohibit bombing on the first move. So that you have a chance hide your pointer in the middle of a 40-node program body. But you did not like that solution.

Exactly - like I said, there's no easy solution, but it doesn't mean that we should stop trying - it's a given that megastructures are cheap. I just don't think they should be allowed, at all. That's all

I joined this game on your invitation and submitted my entry early as you insisted and kept prodding me. After that I waited few weeks and you did not run it, as your VNA emulator did not work as promised.

I did prod you, like I prodded everyone.... but the reason we were waiting was because two people didn't have their programs in yet. It was only afterwards that I discovered there was a problem with the a/b/c functions, which I apologized for. :) After I fixed it, I found that your program whupped mine ;D But I didn't do it on purpose as your next sentence implies:

Actually, you ran only those entries against which you could win.

Now this is just unfounded! There was an accidental error in my program. This is my fault, yes, but I didn't do it on purpose. I wasn't like "Ohh Prime's looks intimidating, I'm going to pretend like his doesn't work on my emulator". Again, I'm sorry, but I didn't cause that error on purpose. I fixed it and it's okay now. I'm glad that your program beat mine, it made me realize an efficiency problem with the Awesome that I fixed in the Ghost (which your Fish2 then beat in the next round of matches). It's an ongoing cycle, and I don't mind when someone else wins, trust me :) It was just that error in my emulator.

If you were also referencing FOTH's program, then there was an actual flaw in that - one number was wrong, and after FOTH changed it, it worked fine.

So I wrote my own emulator and can't see the end of complaints and objections from you.

If you're talking about megastructures, then yes. I'm not going to let megastructures become a part of VNA, however tempting they are.

If you're talking about how the emulator didn't work on my computer, then I'm sorry, there's probably a problem in my Excel as its an older Mac version. It doesn't matter as there are so many emulators afloat. I seem to recall you saying that my emulator didn't work on your computer either :P lol

Why did you invite me to play your game when you really don't want to compete?

Of course I want to compete. As of now, both you and FOTH have better VNA programming skills than me. I'm not an idiot, but you guys are just better :) I don't have to win to still want to compete. I do. And my emulator having a bug does NOT mean that I was intentionally trying to not compete against your programs :rolleyes: If you want to know WHY I invited you, it's because I saw you were a programmer, and would probably be interested :D

Did you think I would be an easy opponent to win against? :angry:

No, the more challenging the better ;D ....as long as I win [just kidding lol]

I think there was some steam building up, and I think you're mad at me because my original emulator had that bug. Well let me assure you, I wasn't trying to shy away from fighting your programs. That's insane. After I fixed it, I ran battles and you won. End of story. What kind of person do you think I am?

~~

I think, overall, VNA 2.0 has been marred by a couple issues. As I am currently working on VNA 3.0, hopefully we can erase the past :) There are many changes in 3.0, and the problems of 2.0 (megastructures, backreferencing a/b/c parameters, etc) are all fixed. It's still in the developmental stages, but hopefully it'll be easier to understand and we'll get new blood. You don't have to play 3.0 if you want, and I'll understand if you don't, but I think it should be a better game

[edit - typo]

Edited by unreality
Link to comment
Share on other sites

  • 0

Before inventing new variations on VNA, it stands the reason to play with the existing version to fully apprecate its possibilities and shortcomings. So, I am offering a few simple VNA questions/puzzles here.

Given a search argument (megastructure), which checks 120 possible locations for the opponent's non-zero command. It is reasonable to expect that VNA programmers would fill the entire 40-node program body with non-zero bombs, or blanks to hide their meaningful commands.

1). I have constructed a megastructure statement which is almost guaranteed to find the opponent's first non-zero command in the 120 possible locations. Yet, this "megastructure" uses much less than 100-level deep nesting. How? (No need to write it out, just explain the general principle.)

And a corollary: What is the way to defend against/confuse a "compact megastructure"?

2). Given the rules of the tournament as I set them in my previous posts, what is the way to ensure that the opponent's "megastructure" loses even when it gest the first move?

3). Devise a match setup that would make a "megastructure" searching for the first non-zero command ineffective. (Other than prohibitting bombing on the first move.)

(Edited for grammar.)

Edited by Prime
Link to comment
Share on other sites

  • 0

me love riddles :P

And in the development of VNA 3.0, it seems the two are different enough to run simultaneously. VNA 3 is much more like the original CoreWars, yet is has so much more power than CoreWars. It does introduce a few new concepts though, making a few things harder, forcing programmers to be more creative. But I also love VNA 2.0, and think they should run at the same time if there's still a following for either

riddles!

Does it add together the values of multiple lines to shorten the number of functions? If so, you could place numbers at either side which add to be 0, like offset with a useless c-parameter. For example:

SHIFT 7;4;0

set the 0 to -11 and the whole thing adds to 0

Put a really long nested function in your very first line, ie, 99 nested, so that any function that calls it loses ... but you also lose

Do you mean put new rules in place (ie, no double-nested compare functions or something like that, not that I would use that one, just an example) or just a program with capabilities to deter a megastructure?

Link to comment
Share on other sites

  • 0
me love riddles :P

...

Does it add together the values of multiple lines to shorten the number of functions? If so, you could place numbers at either side which add to be 0, like offset with a useless c-parameter. For example:

SHIFT 7;4;0

set the 0 to -11 and the whole thing adds to 0

Nope. ADD command itself adds one level of nesting and it can only handle 2 values at a time. Also, there is a risk that two non-zero values add to zero.

Hint: my "megastructure" relies on opponenet's program having been filled with non-zero commands.

Put a really long nested function in your very first line, ie, 99 nested, so that any function that calls it loses ... but you also lose

Yes. Your program sacrifices itself, but makes sure the "megastructure" loses. It makes perfect sense for the first move. Suppose, megastructure has the first move and it has found your first command. Then it is going to replace it with a bomb and you lose in round 1. So if you are losing anyway, why not punish the opponent? On the other hand, if you got to execute your first command with 99-level nesting, you could jump into another logic and wipe out that 99-level nesting trap -- just replace it with a plain bomb. This could be a natural deterent to building "megastructures".

Do you mean put new rules in place (ie, no double-nested compare functions or something like that, not that I would use that one, just an example) or just a program with capabilities to deter a megastructure?

No to both questions. The program with capabilities to deter megastructure is as you found above for the question 2. And I do not suggest any artificial prohibitions or restrictions to VNA programmers -- you can code anything as long as the syntax is correct. What I have in mind is a small and very very simple change to the match setup.

Edited by Prime
Link to comment
Share on other sites

  • 0

sorry I haven't been working on these- been really busy

Let's see...

Perhaps you just looked at the b-parameter? Often, the b-param is most likely to have a nonzero number. However, with the nzero function, you can look at all three in just one function, so that doesn't matter. Hmmm. My other guess was adding chunks of lines at a time and zeroing in on that section if it added to above 0, however this would require extra adds and equs. I'm stumped.

Perhaps if you change the VNA size to something in the thousands... say 2000 nodes instead of 200. That would do the trick.

Here's a question: can you construct a Turing machine from VNA? :P

Link to comment
Share on other sites

  • 0
sorry I haven't been working on these- been really busy

Let's see...

Perhaps you just looked at the b-parameter? Often, the b-param is most likely to have a nonzero number. However, with the nzero function, you can look at all three in just one function, so that doesn't matter. Hmmm. My other guess was adding chunks of lines at a time and zeroing in on that section if it added to above 0, however this would require extra adds and equs. I'm stumped.

There are 120 possible starting locations for opponent's program. Checking for "b" parameter on all of them sequentially would take nesting level 120 levels or more.

Once again, my method relies on all (or most) of opponent's 40 nodes filled with non-zero commands.

Perhaps, I did not formulate the question clearly enough. So here is my solution to building a "megastructure" that would not violate nesting level:

The argument could check for non-zero node at some intervals, say 20.

IF nzero(60) then backward search for zero command ELSEIF nzero(80) then backward search ELSEIF nzero(100) ...

The backward search could go with IF-ELSE logic up to 21 steps back, or you could employ a kind of binary search there, going up or down half of the remaining interval.

This way we still check all 120 locations and have a very, very long argument, but it does not nest too deep.

Of course, when opponent's program is not completely filled with non-zero commands, this megastructure could easily miss. But for that matter, you could go at the interval of 3 (43, 46, 49, ...), hoping the opponent has at least 3 non-zero commands in a row, and have maximum nesting level in the order of 120/3 + 3 = 43.

Your way to trick such megastructure would be to have a single JUMP/SHIFT command at the beginning, followed by a bunch of zero dummy commands (BLANK, or BOMB), followed by a bunch on non-zero dummy commands, followed by your main program logic, followed by some zero dummy commands, and, finally, followed by a bunch non-zero dummy commands all the way to the end of your 40-node space.

...

Perhaps if you change the VNA size to something in the thousands... say 2000 nodes instead of 200. That would do the trick.

Nope. We can keep the field size at 200, or any other number -- it does not matter.

Instead of filling the unused portion of the battlefield with BLANK 0;0;0 -- fill it with BLANK a;b;c where a, b, and c are random integers.

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...