Jump to content
BrainDen.com - Brain Teasers

unreality

Members
  • Posts

    6378
  • Joined

  • Last visited

Everything posted by unreality

  1. VNA VNA stands for Virtual Node Array, and is the setting for this game, which I based loosely off of Core Wars, an old programming game... but Redcode was pretty hard to understand IMO, I think VNA Code (which I have invented over the past two days) is better and easier to learn. You need no knowledge of Redcode or Core Wars to play this game. Back to the game. The VNA is like a computer memory space, one-dimensional, and filled with nodes. A node is like a line of programming code. Before the game begins, all of the VNA's nodes have the BLANK command, but when the game begins, two programs are put into the VNA at random locations. The programs designed by YOU, the players of the game! They retain their order and everything, they're just placed in at a random spot in the VNA, though considerably far away from each other. Each node refers to itself as 0, while the next line is 1 and the previous line is -1. The VNA wraps around so it's like a loop of nodes. So in the beginning of the game, both player's programs are put into the VNA, and then each player starts with one 'executor'. An executor starts at the beginning line of the player's program and then executes that node, then the next, etc. In one round, Player 1 (P1)'s executor executes one node, and P2's executor does the same. Then in the next round, etc. Using the SPLIT and MERGE commands, new executors can be made or deleted. Let's say P1 has 2 executors while P2 has 1. The game would proceed like this: Round One * P1's first executor * P2's executor Round Two * P1's second executor * P2's executor etc. Each player can have up to four executors running at any one time. The goal of the game is to destroy the opponent's executors and be the sole master of the Virtual Node Array! Note that once your initial executor starts running, you have no more impact in the game except to see the outcome. So how to program in VNA Code? First, the commands. Each node is essentially a command. Each command (except BLANK) is followed by three values: a,b,c. If not specified, they are assumed to be zero. I call the a/b/c values input vectors, and they can be either a number or a function (will get to functions next). The commands: COPY a,b copies line a into line b (overriding the current line b) JUMP a jumps execution to line a BOMB destroys the executor that executed this node SPLIT a creates a new executor which begins running at line a. Cannot create more than four MERGE deletes the most recently created executor. Cannot delete the initial executor 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 BLANK what the original VNA is filled with. You can use BLANK commands too, it's basically a "do-nothing" command. BLANKs cannot hold a/b/c values like other commands can Note that there are no 'c' fields in usage, but I left the possibility open for both data storage and in case I add more commands later that need a third input value as well So, a/b/c values are either numbers (usually line numbers, remember that each node refers to itself as line 0) OR functions. So what are functions? The functions: 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 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 exe() returns the number of executors that you have currently running num() returns the number of lines in the VNA That's all I've got right now, but I think it's enough. You can nest functions within functions, in case you were wondering - in fact I do that in my example program. I call it 'The Bomber' COPY 3, 4 EDITB -1, add(b(-1), 1) JUMP -2 BOMB Whoa! What's that do? The COPY command copies line 3 (which would be the BOMB) into line 4 (just a BLANK before, now it's a BOMB too). So this part of the VNA looks like this now: COPY 3, 4 EDITB -1, add(b(-1), 1) JUMP -2 BOMB BOMB In the next round, the next line is executed. The command on this node is EDITB, which edits the b field of a certain line. That line is in EDITB's a field, which is -1, so it's editing the b field of the line right before it. The line is edited to adding the CURRENT b field value [b(-1)] with the number 1. Basically, this EDITB line is incrementing the COPY's b field by 1. So the new code looks like this: COPY 3, 5 EDITB -1, add(b(-1), 1) JUMP -2 BOMB BOMB The next line is JUMP -2, which sends the executor backwards 2 lines to the COPY node again - phew that was close, we almost hit the BOMB command! So now the program runs all over again, except this time it copies the BOMB command to line 5 (the next BLANK). Thus, as the executor loops over these three lines, it spews out a chain of BOMBs to eventually march upon the opponent. That's why I call it the Bomber This isn't the perfect Bomber - because it only spews a BOMB command every third round, and the BOMB only advances one node each time. Depending on the size of the VNA, the opponent could have destroyed you by the time you lay the tenth BOMB. One way is to, based on the number of lines in the VNA, skip a certain amount of lines to place the next BOMB. I made this slightly more complicated program next, I call it the Bomb Evader: SPLIT -3 JUMP com(exe(),1,4,1,1) MERGE EDITA -3, sub(a(-3),2) JUMP -4 COPY 2, sub(a(-5),7) JUMP sub(a(-5),8) JUMP 0 It works by sending a secondary executor backwards toward the opponent, with the initial executor checking to see if it's still alive with exe(). When/if the secondary executor is killed, the executor copies the line 'JUMP 0' to that line and then jumps itself to the JUMP 0 line, thus staying in the same place while the opponent's BOMBs continue past, destroying the original program, looping back around, and killing the Bomber, while the Bomb Evader stays alive. This could fail, however, if the Bomber is, say, 4 lines long and did some math to make a BOMB every 5th line done so that if it looped back around (based on num()) it would avoid itself. Though it would also be unlikely to hit the JUMP 0 If you're interested in building your own battle program and warring with other people, post here The cool thing is that I can play too ;D
  2. unreality

    Pirate Mafia

    The Swashbuckler's dead (edit JS beat me to it) And I get it now, Ben Law didn't vote, so it counted as only 10 people voting, thus the Bartender only got x2 - which means either JS or GC is the Bartender And I'm pretty sure I know which one of them it is
  3. unreality

    Pirate Mafia

    If the bartender voted for CP, they would get 3 votes worth (since it was over 10 people), so it'd be +2 than the number of voters, thus it'd be 4 and CP would've won
  4. unreality

    Well let me know if you need help
  5. unreality

    Pirate Mafia

    I know, but he's much more likely to be a pirate (even before we found out that WW was innocent )
  6. unreality

    This is 'automated' Mafia: http://www.epicmafia.com/ Guess what's WAAAY better to play at? Brainden Cuz we're not a computer program that generates automatic death statements. Cuz we make up cool roles and cooler scenarios It'd be neat if you could automate it, let me know how it turns out - but can it support any kind of Mafia I can dream up? Any sort of complex role? What if you made it for normal Mafia then I spring the Aztec Mafia design on it? If you can really make it work for real and good (and for Mac ), then it's a great idea... otherwise don't waste your time ;D
  7. unreality

    uh... what? You can't "automate" Mafia lol. It's not a video game. It's a social game, originally a party game
  8. unreality

    Pirate Mafia

    Dang - if only we had gone with Slick like me, Itachi and CL wanted...
  9. unreality

    Pirate Mafia

    It means the bartender was among the voters, since Sinistral hasn't mentioned a tie
  10. unreality

    Pirate Mafia

    Yarrr! Me cannot wait for the tides of forture!
  11. unreality

    Pirate Mafia

    Arrhh! Looks like me made it back in time for the planking!
  12. Potentially, if it isn't bombed by some religious nut to salvage his religion or something Hopefully it brings about some sort of breakthrough Controversial Scientific Breakthrough Pattern: * Earth is round and the solar system is heliocentric not geocentric. Church denies at first, only accepts hundreds of years later and fits it into their worldview * Evolution changes species over time gradually, eventually some things become so different that they are considered separate species (speciation). We can trace our evolution through the fossil record back a long way. Church denies at first, only accepts hundreds of years later (right now we're about halfway through the acceptance process, I'd say), and fits it into their worldview * Big Bang (or some other model, I'm just speculating here) proved to be correct. Church denies at first, only to accept much later... and then they'd STILL fit it into their worldview ("God planted the seed of the Big Bang!"). Religion goes on ;D
  13. unreality

    Pirate Mafia

    JS: yeah, see my post right above yours (post 59 - it has the current roster)
  14. unreality

    Pirate Mafia

    the roster: Captain: Sinistral 1) Cherry Lane - voting for Slick 2) Wally West 3) FIF - DEAD [?] 4) Crazypainter - voting for Wally West 5) Joe's Student 6) Ben_Law 7) Itatchi - voting for Slick 8) Unreality - voting for woon 9) GC - voting for Crazypainter 10) woon - voting for Wally West 11) Mekal - voting for Ben_Law 12) Slick - voting for Wally West I don't like the "vote for me and lose" ultimatum either, and since nobody else thought woon was suspicion, I'll change my vote to Slick: Captain: Sinistral 1) Cherry Lane - voting for Slick 2) Wally West 3) FIF - DEAD [?] 4) Crazypainter - voting for Wally West 5) Joe's Student 6) Ben_Law 7) Itatchi - voting for Slick 8) Unreality - voting for Slick 9) GC - voting for Crazypainter 10) woon - voting for Wally West 11) Mekal - voting for Ben_Law 12) Slick - voting for Wally West This could be my last post, since there's been a change of plans, I'm going to the movies in about half an hour and won't be back until after 10, probably
  15. unreality

    No, I already sent mine I'm not sure when the time is up
  16. unreality

    Pirate Mafia

    CL, it's not the people that vote first, it's the people that vote SECOND. The Mafia/Pirates wait for someone to start a bandwagon (like Slick) and then they jump on it (as long as it's not one of their own). Then if the target ends up being innocent, the attention lands on the bandwagon-starter (slick), not the secondary joiner that made it happen I could be wrong, but right now Woon is looking suspicious 1) Cherry Lane - voting for Slick 2) Wally West 3) FIF - DEAD [?] 4) Crazypainter - voting for Wally West 5) Joe's Student 6) Ben_Law 7) Itatchi 8) Unreality - voting for woon 9) GC - voting for Crazypainter 10) woon - voting for Wally West 11) Mekal 12) Slick - voting for Wally West edit: added GC's vote
  17. unreality

    Pirate Mafia

    Any ideas or suspicions, matees? I have to dive overboard in about 5 hours or so, be back either much later in the eve or in the red tides of the morn!
  18. Well as you can see it's entitled "Discussion", so I may not host soon at all, especially with the lack of interest I've seen so far Which is fine, I just wanted to put the idea out there and discuss, hence the 'discussion' title. So I'm not sure whether the game will happen or not, it depends
  19. Then everything else is the center too ;D
  20. unreality

    Pirate Mafia

    I leave to visit my sister in college in about 8 hours or maybe a little less or later, not sure. So hopefully I'll have enough to go on to vote by that time. If not, I'll roll randomly ;D
  21. unreality

    Pirate Mafia

    Avast! We will revenge this courageless slaughter of Frozen in Fyre, lest we be taken to the depths with ye foul scumme! Me gut tells me to heave erstwhile rags, before another laceration in sea takes a life! Arrrh, if only Fiery Frozen were alive to witness our monstrous revenge on these unseaworthy bags of piratical scum! Graarrhhh ;D Who be a scalliwag among us? Make yer accusations, fellow crewmen and pirates alike, all will be heard! We might vanquish these rum-sucking enemies!
  22. unreality

    Pirate Mafia

    Arrh! Glad ter be aboar'd!
×
×
  • Create New...