Jump to content
BrainDen.com - Brain Teasers

unreality

Members
  • Posts

    6378
  • Joined

  • Last visited

Everything posted by unreality

  1. there are 117 non-self nodes and damn, I figured megastructure was impossible in this game without the com() function. I have yet to analyze your method though... regarding divide by zero, the inv() function is rigged to output 0 if fed 0. I'll do the same for the div() function... ie, if the second is 0, then it will output 0. Likewise if you do log(0,x) it will output 0. Also as dms said, there were problems with line carry-over, so I extended out the text field to allow for any (or so I thought) reasonable line length. I think a massive line can still be introduced depending on how you copy it into the text field, I'll have to play with that... edit: also fixed it for mod(x,0) and I tested it for pow(0,0)... it says "1"
  2. those look pretty damn good I love how you use the SWITCH_structure in Transporter 2 to act as a checker to see if you've been compromised, and at no extra efficiency cost... nice! I haven't looked at radar bomber in depth yet but it looks pretty meticulously planned hehe. I'll be out tonight and tomorrow but before I go, if you want we can see how they fare against various other programs if you wish. Or one of you guys can run some matches, we've all got the same emulator ;D
  3. just had time to look at this one, nice! I love the use of num()s to check if a group of lines has been compromised. A bomb will lower the total num() count since you have no single-term JUMP structures. The fifth value each time might as well be a "!" since it's not expected for the num()count to increase, but that got me thinking... the only way to bomb this program and then fool it into thinking it's alright is to throw a bomb down on one space and then a longer line on another. But it's hard to predict exactly what the bomb will replace and thus what number will need to be added on in another bomb quickly enough before it's checked. So essentially this is fully self-repairing; the problem is when a bomb hits an unexpected spot and it can't save itself quickly enough. I love the multiple-regenerator setup and how, if the regenerator itself is compromised, it jumps to the next one instead. This seems to be in the class of "imps" or "hoppers" not because it's constantly moving but because it's hard to kill, but weak offensively. Then again, if it's not hit, it only lends an extra round to CHECKING if it was hit before resuming bombing. And if it is hit and it sees it, it can save itself rather than dying, so loss of efficiency is better there than no efficiency. Thus the only real "efficiency loss" is that one extra lines it takes to do the check... going well it would bomb 1-in-3 rounds. The best way I can see to optimize it would be to change its -5 starting bomb to -42 or so
  4. I ran some tests... ~~~ BM vs Zero [starting Number for Zero]: [Results] 142: BM wins after 143 rounds (odd...) 143: BM wins after 27 rounds 42: Zero wins after 391 rounds! This is to be expected since the first line bombs 41 + 1 + a(which is 1) = 43 from the origin. Thus a zero at 42 will slip by unnoticed and the BM will die on the 391st round, which is what happened. Testing the other extreme now... 158: BM wins after 147 rounds I think that we can conclude the rest of the results in theory... with a distance of 4 between each of the BM's bomb each time, after 4 iterations are complete, the BM will have bombed the whole space between 43 and 194. This happens after exactly 156 rounds and BM is back at line zero ready to increment a from 4 to 5. At this point, there are only 8 non-BM or non-BM-bombed lines in the VNA: the two following BM's own bomb (I made it 'zzz' instead of 'x' in testing to see how it was progressing) then three x's that constitute lines 40, 41 and 42 and of those it's only technically legal for the enemy program to be on line 42 and onward, so the only space left is line 42 itself. The five other safe lines are 195, 196, 197, 198 and 199, which are directly before BM and thus not legal either for the Zero. Thus the ONLY and I repeat ONLY legal spot where the Zero can survive and kill the Brutus Maximus is starting line 42. Out of 117 possible starting locations, only one results in the Zero's success. So "0" is not a viable competitor. But a non-static hopper with the correct hopping constant (before I've used 137 just for its non-repetitious behavior) might be able to sneak through and stay always just ahead or just behind, jumping over places that the BM has already bombed... hmmm...
  5. yeah I was thinking a program like this: "0" the BM will only destroy itself if left to play for 10 iterations of its code or so... calculating exactly... the 39th line of BM bombs +38 from the zero line, aka 152+38 = 190, but a will be 1 at that time so 191. So when a is 10, that final bombing line will bomb 200 aka 0 from the zero line and ruin the program the next round. a goes to 2 after the 40th round, 3 after the 79th round, etc, ie, +39 each time, 40 + 39(n-2) where n is the desired value of a, ie, 40 + 39n - 78 = "39n - 38" for the simplest equation. Thus a will turn 10 after 390-38 = 352 rounds. The bombing line that will cause the suicide is 38 rounds later. 352 + 38 = 390. Then it will jump back to that line and run the bombed line to kill itself: 390 + 1 = 391 So, if left to its own devices, a program such as "0" must survive 10 iterations of onslaught by the BM and 391 rounds total before the BM self-destructs. Because of that, it may be that "hunkering down" to oppose the BM isn't the strategy. If it works, the 0 would have to be placed pretty cleverly or something, I'll try it in a bunch of places (I'll keep BM as P1 since the "0" doesn't really do anything anyway, and then just move P2 around) and see what happens...
  6. unreality

    I know I came into this kind of late but it reminds me of a (semi-joke) problem my uncle's friend told me: edit ~ anyway it's possible that the questions are asking the same thing (with the 'motion' just relative to each other) but I'd have to think about it more
  7. Nice. What do you call it? Is there a reason it uses SWITCH instead of COPY? Also, quite ingeniously, your program can never hit itself if left to bomb indefinitely... nice!
  8. Zebra Warrior add(mul(mod(z,2),3),int(div(z,2))) add(mul(mod(z,2),50),137,int(div(z,2))) 1 z mod(inc(z),5) z 0 135 -2 -2 Brutus Maximus a sum(a,1) 38 sum(41,a) 1 37 sum(44,a) 1 36 sum(47,a) 1 35 sum(50,a) 1 34 sum(53,a) 1 33 sum(56,a) 1 32 sum(59,a) 1 31 sum(62,a) 1 30 sum(65,a) 1 29 sum(68,a) 1 28 sum(71,a) 1 27 sum(74,a) 1 26 sum(77,a) 1 25 sum(80,a) 1 24 sum(83,a) 1 23 sum(86,a) 1 22 sum(89,a) 1 21 sum(92,a) 1 20 sum(95,a) 1 19 sum(98,a) 1 18 sum(101,a) 1 17 sum(104,a) 1 16 sum(107,a) 1 15 sum(110,a) 1 14 sum(113,a) 1 13 sum(116,a) 1 12 sum(119,a) 1 11 sum(122,a) 1 10 sum(125,a) 1 9 sum(128,a) 1 8 sum(131,a) 1 7 sum(134,a) 1 6 sum(137,a) 1 5 sum(140,a) 1 4 sum(143,a) 1 3 sum(146,a) 1 2 sum(149,a) 1 1 sum(152,a) -38 x ZW vs BM [Array filled with bombs (x)] Generated Local Starting Values: 45, 57, 64, 75, 88, 96 Round 1 corresponds to line 45, R2 to 57, etc. For every "a" round, ZW is P1 at 0; BM is P2 at [line number] For every "b" round, BM is P1 at 0; ZW is P2 at [line number] Round 1a: Infinite. BM got sucked into ZW's code and became another Zebra Warrior. Technically a tie. Round 1b: BM wins after 3 rounds Results: BM gets 1 point, the second point goes to no one as a tie Round 2a: BM wins after 62 rounds Round 2b: BM wins after 6 rounds, again by line attack placement... nice though! Results: BM gets 2 points - sum of 3 pts Round 3a: Infinite. BM got sucked into ZW's code and became another Zebra Warrior. Technically a tie. Round 3b: BM wins after 32 rounds - close though! One round earlier and BM would've been sucked into the Zebra Warrior's snare Results: BM gets another point for 4 pts Round 4a: BM wins after 17 rounds Round 4b: BM wins after 10 rounds Results: BM now at 6 pts Round 5a: ZW wins after 37 rounds! Hooray lol Round 5b: Infinite. BM got sucked into ZW's code and became another Zebra Warrior. Technically a tie. Results: BM at 6 points, ZW at 1 point [with 3 ties where BM got sucked into ZW] Round 6a: ZW wins after 29 rounds, w00t Round 6b: Infinite! Final Results: BM has 6 wins, ZW has 2 wins and 4 suck-ins Conclusions: the array-hopping skill of Zebra Warrior cannot match the brute force and firing power arsenal of the Brutus Maximus. Where the ZW alternates in copying itself and in firing off bombs, the Brute spends most of its time doing the latter, and this gives it the efficiency boost necessary to hunt down the enemy. You may call this a weakness for the system itself but I've found that VNA games are usually very rock-paper-scissors and a good conglomeration of course is where the creativity comes in. There is something that can beat Brutus, but it's not ZW of course. This future enemy must take into account the key weakness of BM, which is its vulnerability to being struck. It slightly overcomes this by having such an extended queue that it may have already killed the enemy before it runs into the bomb in its midst, but still a single bomb will cripple the BM, eventually. So maybe a bomber but once that's not so elongated as BM... a more compact killing machine of some kind. But BM is definitely very strong... and it's not "nonclever". The placement of each individual bombing spot (by threes, in this case, however it's actually 3+n where n is the line distance from the zero line of the program, if you're counting from there to see where they hit relative to line zero) is what can be improved by more cleverness. The success of BM after 3 rounds on Round 1b may seem like luck but it was the many & precise placement of bombs after all that made this possible. So to improve BM I would recommend the fix I recommended earlier, starting from 40 and increasing by 2 each line. This matches the current BM's "by-threes" system except it does it from the starting line, not from the relative line... so that would fix the BM's tendency to bomb very close together close from it, but farther apart as it gets farther from itself. Regarding the "infinite" ones I realized that if they are sufficiently distanced from themselves they can bomb each other still since ZW bombs while hopping. But it specifically avoids bombing the next iteration by bombing 187 plus 0-2ish from the current line, which isn't anywhere near any local iterations. For a long time. Ergo, it will be endless pretty much 99. For fun I extended Round 5b out to 1000 Rounds (the do X rounds is working now btw) and they had filled almost the whole array with Zebra Warrior lines lol. Just in case, I ran all of the "infinite" games out to one thousand rounds and none had ended b that time... it's Turing's "halting problem" of course but I think it's safe to say that they'll go on forever since we know the algorithm in the black box ;D Do you think a program should get a point if the enemy gets sucked in to the trap even though technically neither wins? [uPDATE] I wrote most of the above 'Conclusions' section after round 4 when the outcome looked clear. I just finished Round 6 and BM only has 6/12 points; ZW has 2/12 points... with 4 "suck-ins". So it hinges on what those should be considered as. Ties? Wins? Divided points? If so that can change the pointage from 6-2 to 6-6 to 8-4
  9. on top of that, here's the updated corrected Zebra Warrior (edit in blue) Zebra Warrior add(mul(mod(z,2),3),int(div(z,2))) add(mul(mod(z,2),50),137,int(div(z,2))) 1 z mod(inc(z),5) z 0 135 -2 -2 aaand the VNA.4 emulator code, corrected and fixed and updated: <html> <head> <title>VNA.4 Emulator, by unreality</title> <script LANGUAGE="JavaScript"> /* global declarations */ var vna = new Array(); var alphastring = "abcdefghijklmnopqrstuvwxyz"; var capalphastring = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; var p1vararray = new Array(26); var p2vararray = new Array(26); /* functions */ 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() { document.form1.startline.value = Math.floor(117*Math.random())+42 } function loadArray() { var pr1 = new Array(); var pr2 = new Array(); pr1 = document.form1.p1.value.split("\n"); pr2 = document.form1.p2.value.split("\n"); var nStart = document.form1.startline.value; var error1=""; var error2=""; var error3=""; if (pr1.length > 40) error1 = "Program 1 is too long! "; if (pr2.length > 40) error2 = "Program 2 is too long! "; if (nStart=="") error3 = "You must specify a starting node for P2!"; error3 = error1 + error2 + error3; if (error3 != ""){alert(error3); return;} var iString; var cString = document.form1.fillwith.value; for (ihh=0;ihh<200;ihh++) { iString = cString; if (ihh<pr1.length) {iString = pr1[ihh];} if (ihh>=nStart && ihh<nStart+pr2.length) {iString = pr2[ihh - nStart];} if (iString == undefined) iString = cString; vna[ihh] = iString; } document.form1.vnarray.value = vna.join("\n"); document.form1.point1.value = 0; document.form1.point2.value = nStart; document.form1.rnds.value = 0; document.form1.dornd.disabled = false; document.form1.doxrnd.disabled = false; document.form1.xrd.value = 10; // fill variable arrays for(iww=0;iww<26;iww++) { p1vararray[iww] = 0; p2vararray[iww] = 0; } document.form1.seevars.disabled = false; } function doRound() { // increment round counter document.form1.rnds.value++; // pointer locations var lineOne = document.form1.point1.value*1; var lineTwo = document.form1.point2.value*1; // P1 first var zline = vna[lineOne].toLowerCase(); // count the number of spaces in zline var chratloopy = 0; var numspaces = 0; while (chratloopy < zline.length) { if (zline.charAt(chratloopy) == " ") numspaces++; chratloopy++; } var newline; var paramz = zline.split(" "); var valqa = doFunc(paramz[0]+"",lineOne,1)*1; if (numspaces > 0) var valqb = doFunc(paramz[1]+"",lineOne,1)*1; if (numspaces > 1) var valqc = doFunc(paramz[2]+"",lineOne,1)*1; if (numspaces > 2) var valqd = doFunc(paramz[3]+"",lineOne,1); if (numspaces > 3) var valqe = doFunc(paramz[4]+"",lineOne,1); if (valqd != "!") valqd *= 1; if (valqe != "!") valqe *= 1; switch (numspaces) { case 0: if (zline == "x") { document.form1.dornd.disabled = true; document.form1.doxrnd.disabled = true; alert("Program 2 wins!"); return; } else { newline = doMod(lineOne + valqa); } break; case 1: var firstchar = zline.charAt(0); p1vararray[alphastring.indexOf(firstchar)] = valqb; newline = doMod(lineOne + 1); break; case 2: var replacestring = vna[doMod(lineOne+valqa)]; // check for capital variables var zzingl; var dropfwhenzero = 1; while (dropfwhenzero == 1) { zzingl = replacestring.length; dropfwhenzero = 0; for (eee=0;eee<zzingl;eee++) { if (capalphastring.indexOf(replacestring.charAt(eee)) != -1) { replacestring = replacestring.substring(0,eee) + p1vararray[capalphastring.indexOf(replacestring.charAt(eee))] + replacestring.substring(eee+1); dropfwhenzero = 1; } } } vna[doMod(lineOne+valqb)] = replacestring; newline = doMod(lineOne + valqc); break; case 3: var temptemptemp = vna[doMod(valqa + lineOne)]; vna[doMod(valqa + lineOne)] = vna[doMod(valqb + lineOne)]; vna[doMod(valqb + lineOne)] = temptemptemp; if (vna[doMod(valqa + lineOne)] == vna[doMod(valqb + lineOne)]) { newline = doMod(lineOne + valqc); } else { if (valqd != "!") newline = doMod(lineOne + valqd); if (valqd == "!") newline = doMod(lineOne + valqc); } break; case 4: if (valqa == valqb) {newline = doMod(lineOne + valqc);} if (valqa > valqb) {newline = doMod(lineOne + valqd);} if (valqa < valqb && valqe == "!") {newline = doMod(lineOne + valqd);} if (valqa < valqb && valqe != "!") {newline = doMod(lineOne + valqe);} break; } // // // P2 now // // var zline = vna[lineTwo].toLowerCase(); // count the number of spaces in zline var chratloopy = 0; var numspaces = 0; while (chratloopy < zline.length) { if (zline.charAt(chratloopy) == " ") numspaces++; chratloopy++; } var newxline; paramz = zline.split(" "); valqa = doFunc(paramz[0]+"",lineTwo,2)*1; if (numspaces > 0) var valqb = doFunc(paramz[1]+"",lineTwo,2)*1; if (numspaces > 1) var valqc = doFunc(paramz[2]+"",lineTwo,2)*1; if (numspaces > 2) var valqd = doFunc(paramz[3]+"",lineTwo,2); if (numspaces > 3) var valqe = doFunc(paramz[4]+"",lineTwo,2); if (valqd != "!") valqd *= 1; if (valqe != "!") valqe *= 1; switch (numspaces) { case 0: if (zline == "x") { document.form1.dornd.disabled = true; document.form1.doxrnd.disabled = true; alert("Program 1 wins!"); return; } else { newxline = doMod(lineTwo + valqa); } break; case 1: firstchar = zline.charAt(0); p2vararray[alphastring.indexOf(firstchar)] = valqb; newxline = doMod(lineTwo + 1); break; case 2: var replacestring = vna[doMod(lineTwo+valqa)]; // check for capital variables var zzingl; var dropfwhenzero = 1; while (dropfwhenzero == 1) { zzingl = replacestring.length; dropfwhenzero = 0; for (eee=0;eee<zzingl;eee++) { if (capalphastring.indexOf(replacestring.charAt(eee)) != -1) { replacestring = replacestring.substring(0,eee) + p1vararray[capalphastring.indexOf(replacestring.charAt(eee))] + replacestring.substring(eee+1); dropfwhenzero = 1; } } } vna[doMod(lineTwo+valqb)] = replacestring; newxline = doMod(lineTwo + valqc); break; case 3: var temptemptemp = vna[doMod(valqa + lineTwo)]; vna[doMod(valqa + lineTwo)] = vna[doMod(valqb + lineTwo)]; vna[doMod(valqb + lineTwo)] = temptemptemp; if (vna[doMod(valqa + lineTwo)] == vna[doMod(valqb + lineTwo)]) { newxline = doMod(lineTwo + valqc); } else { if (valqd != "!") newxline = doMod(lineTwo + valqd); if (valqd == "!") newxline = doMod(lineTwo + valqc); } break; case 4: if (valqa == valqb) {newxline = doMod(lineTwo + valqc);} if (valqa > valqb) {newxline = doMod(lineTwo + valqd);} if (valqa < valqb && valqe == "!") {newxline = doMod(lineTwo + valqd);} if (valqa < valqb && valqe != "!") {newxline = doMod(lineTwo + valqe);} break; } // render the VNA document.form1.vnarray.value = vna.join("\n"); document.form1.point1.value = newline; document.form1.point2.value = newxline; } function doMod(zeinput) { while (zeinput < 0) { zeinput += 200; } zeinput = zeinput % 200; return zeinput; } function doFunc(param, qline, zpp) { if (param == "") return ""; if (param == "!") return "!"; if (alphastring.indexOf(param) != -1) { return doSuperFunc(param, zpp); } var tempeval; var closeparen; var funcin; var beforeparstring; var commaloc; var parenloc; var rightloc; var funcname; var inputarray = new Array(); /*var xdata = new Array();*/ // loop until param is just a number while (param*1 != param) { closeparen = param.indexOf(")"); openparen = (param.substring(0,closeparen+1)).lastIndexOf("("); funcin = param.substring(openparen+1,closeparen); beforeparstring = param.substring(0,openparen); commaloc = beforeparstring.lastIndexOf(","); parenloc = beforeparstring.lastIndexOf("("); rightloc = Math.max(commaloc,parenloc); funcname = param.substring(rightloc+1,openparen); funcname = funcname.toLowerCase(); // /*alert(closeparen+" -- "+openparen+" -- "+commaloc+" -- "+parenloc+" -- "+rightloc+" -- "+zpp+qline); alert("Name: "+funcname+", Input: "+funcin);*/ // inputarray = funcin.split(","); for (yyyy=0;yyyy<inputarray.length;yyyy++) { inputarray[yyyy] = doSuperFunc(inputarray[yyyy],zpp); } switch (funcname) { case "sum": case "add": tempeval = 0; for (tttt=0;tttt<inputarray.length;tttt++) { tempeval += inputarray[tttt]; } break; case "prd": case "mul": case "mult": tempeval = 1; for (ssss=0;ssss<inputarray.length;ssss++) { tempeval *= inputarray[ssss]; } break; case "inc": case "incr": tempeval = (inputarray[0] + 1); break; case "dec": case "decr": tempeval = (inputarray[0] - 1); break; case "neg": tempeval = (inputarray[0] * -1); break; case "inv": if (inputarray[0] == 0) {tempeval = 0} else {tempeval = 1 / inputarray[0];} break; case "num": var linetoterm = vna[doMod(qline + inputarray[0])]+""; tempeval = 1; for (ccc=0;ccc<linetoterm.length;ccc++) { if (linetoterm.charAt(ccc) == " ") tempeval++; } if (linetoterm == "x") tempeval = 0; break; case "mod": tempeval = (inputarray[0]*1) % (inputarray[1]*1); break; case "pow": tempeval = Math.pow(inputarray[0],inputarray[1]); break; case "div": tempeval = (inputarray[0]*1) / (inputarray[1]*1); break; case "sub": tempeval = (inputarray[0]*1) - (inputarray[1]*1); break; case "log": tempeval = Math.log(inputarray[1]*1) / Math.log(inputarray[0]*1); break; case "abs": tempeval = Math.abs(inputarray[0]); break; case "int": tempeval = Math.floor(inputarray[0]); break; case "ceil": tempeval = Math.ceil(inputarray[0]); break; } // replace part of param with tempeval... then loop again param = param.substring(0,rightloc+1) + tempeval + param.substring(closeparen+1); } return param; } function doSuperFunc(qwerty, zppp) { var qwertest = alphastring.indexOf(qwerty); if (qwertest != -1) { if (zppp == 1) qwerty = p1vararray[qwertest]; if (zppp == 2) qwerty = p2vararray[qwertest]; } else qwerty *= 1; return qwerty; } function doXRounds() { var getx = document.form1.xrd.value; for (bbb=0;bbb<getx;bbb++) { doRound(); } } function seeVars() { var ystr = "P1:\n"; for (inn=0;inn<26;inn++) { if (p1vararray[inn] != 0) ystr += alphastring.charAt(inn)+" = "+p1vararray[inn]+"\n"; } ystr += "\nP2:\n"; for (inn=0;inn<26;inn++) { if (p2vararray[inn] != 0) ystr += alphastring.charAt(inn)+" = "+p2vararray[inn]+"\n"; } alert(ystr); } /* end of script */ </script> </head> <body> <h1>VNA.4 Emulator, by unreality</h1><form name="form1"> <br><br><br>P1 <br> <textarea name="p1" rows=10 cols=100></textarea> <br>P2<br><textarea name="p2" rows=10 cols=100></textarea> <br> <center><input type="button" value="Switch" onClick="doSwitch();"><input type="button" value="Clear" onClick="doClear();"></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>(range 42 to 158 please) <br><br><br><br><center>Fill with: <input type="text" name="fillwith" length="10" value="x"></center><br><input type="button" value="Load the Virtual Node Array!" onClick="loadArray();"><br><hr><br> VNA:<br><textarea name="vnarray" rows=30 cols=100></textarea><br> P1 Pointer: <input type="text" name="point1" length="10"><br> P2 Pointer: <input type="text" name="point2" length="10"><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"><input type="button" value="See Nonzero Variables" name="seevars" onClick="seeVars();" disabled="true"> </form> </body> </html> Previous postings of the emulator are all defunct. This is the highest version... I wish there were some way to update the OP and post it. Maybe later if any more changes are done I will see if Rookie can edit the OP for me... hmm... anyway, I added a function ceil(n) which is like int(n) except it does the ceiling instead of the floor. Just in case someone needs it at some point, I thought it'd be best to have both of them, since ceiling is NOT always the same thing as floor+1 Also, what I said earlier still applies... we could add a com(a,b,c,d,e) function, but we'd have to remove num(), since the two functions together would be catastrophic and a program could win on the first move. do you want to duel Brutus Maximus vs Zebra Warrior and see if power conquers finesse or vice versa? If so, post here and I'll generate some starting values and run them against each other. Is this is the correct BM?
  10. I did some things to fix any potential scoping problems and also found a gaping error - I forgot to copy over the corrections on the capital-variable stuff into the P2 code... so I just have to do a bit more testing and then I will present the updated, much improved, combat-viable code Sorry about the inconvenience... programming is always a journey ;D hehe
  11. unreality

    let's do it! When?
  12. edit; make that: add(mul(mod(z,2),3),int(div(z,2))) add(mul(mod(z,2),50),137,int(div(z,2))) 1 z mod(inc(z),3) z 0 135 -2 -2
  13. this is my fix for Zebra Warrior: add(mul(mod(z,2),3),div(z,2)) add(mul(mod(z,2),50),137,div(z,2)) 1 z mod(inc(z),3) z 0 135 -2 -2 I had forgotten to add the div(z,2) for the final added parameter instead of just z. Anyway, in testing this, it folds over a line and (possibly because of this) the emulator comes up with an error that seems out of place. So I have to fix that. And also I will change the 'i' variables in various for-loops to others just in case there's any variable naming scope problems. So when I get time, probably tomorrow, I'll post updated code for the emulator... sorry...
  14. Before we do that, I need to fix a fatal flaw in ZW's code... hang on Meanwhile I made a good framework for battles: Six Rounds with Six Seeds: 45, 55, 65, 75, 85, 95. Each of those (+ or -) 5 for a random range of 10 possibilities, ie, the 75 seed can be anywhere from 70-80. Each round is played with that starting line used for P2, then in a round there are two games, in which the players switch P1/P2 position (and thus also starting location) for the second game. [Edit - the reason we only play in the 45-95 range is because 105 is equivalent to 95, et al, since two games are played and they are flipped for each round] Anyway let me see to that bug in ZW... also you might want to do the fix I suggested for Brutus Maximus to make it as brute as possible, but either way it's pretty efficient (if highly vulnerable)
  15. then let's see, we'll pit Zebra Warrior against Brutus Maximus ;D
  16. Nice! Something like that was easy in VNA 3.0 with multiple pointers but not here with only one - I'll have to look over the code later when I have more time To be honest I haven't thoroughly tested any of these, right now I've just making programs and theorizing, not much testing on the emulator yet... anyway, here's something I was thinking of doing: z add(mul(mod(z,2),50),137,z) 2 x z inc(z) x z 4 -4 133 -4 it's based off an idea I had of using the modulus as an "if" system within the COPY structure (since there's no com() function, but that could be added, however at the cost of the num() function since the two would be incompatible together via megastructure... com(a,b,c,d,e) would compare a and b. If a=b, the function returns c. If a>b, it outputs d. And e for a<b. But that could only be implimented if we removed num(). Your thoughts?) anyway... the z inc(z) line of course goes to the bomb and the program dies. So I've been trying to make a new mathematical statement that gives different results for the bombs but allows the SET structure bunched together with the end if structure: z ... (COPY structure) ... 3 x x z inc(z) z 4 -4 133 -4 I've been experimenting with mod(z,5) with division and flooring, but to no avail yet. But I just had a new idea that could work, by using a modulus on the first term of the COPY structure as well: add(mul(mod(z,2),3),z) add(mul(mod(z,2),50),137,z) 1 z mod(inc(z),3) z 0 135 -2 -2 it also covers an error in the other program by resetting z properly to 0 for the next iteration elsewhere. I think this is my best program so far... due to the z variable, I've decided to call it Zebra Warrior It alternates bombing and copying itself (starts out by copying the zeroth line, then bombing, then copying the first line, then bombing, etc, jumping away to the new copy of itself when complete). Zebra Warrior add(mul(mod(z,2),3),z) add(mul(mod(z,2),50),137,z) 1 z mod(inc(z),3) z 0 135 -2 -2
  17. Square Rooter n [NUMBERHERE] z int(pow(n,.5)) z add(z,div(sub(n,mul(z,z)),inc(mul(2,z)))) z mul(.5,add(z,div(n,z))) 1 2 -1 Z replace [NUMBERHERE] with a number to square root. The initial seed for z is based on my own theorem, after that the Babylonian method is used to converge extremely quickly to the desired value ;D Also the int(pow(n,.5)) in the beginning isn't cheating since it's easy to get that floored number by just thinking about it, I wasn't sure how else to express it ;D some other programs... Hopping Bomber: a sum(a,137) 1 a mod(sum(a,1),4) 2 prd(a,50) 1 a 0 134 -3 134 x Tracker a 47 a sum(a,3) num(a) 0 -1 1 -1 a sum(a,-4) a sum(a,1) 1 a -1 x
  18. yeah thanks for catching that! That was one of the things that I planned to go back through, hopefully that's the last such thing lol ;D <html> <head> <title>VNA.4 Emulator, by unreality</title> <script LANGUAGE="JavaScript"> /* global declarations */ var vna = new Array(); var alphastring = "abcdefghijklmnopqrstuvwxyz"; var capalphastring = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; var p1vararray = new Array(26); var p2vararray = new Array(26); /* functions */ 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() { document.form1.startline.value = Math.floor(117*Math.random())+42 } function loadArray() { var pr1 = new Array(); var pr2 = new Array(); pr1 = document.form1.p1.value.split("\n"); pr2 = document.form1.p2.value.split("\n"); var nStart = document.form1.startline.value; var error1=""; var error2=""; var error3=""; if (pr1.length > 40) error1 = "Program 1 is too long! "; if (pr2.length > 40) error2 = "Program 2 is too long! "; if (nStart=="") error3 = "You must specify a starting node for P2!"; error3 = error1 + error2 + error3; if (error3 != ""){alert(error3); return;} var iString; var cString = document.form1.fillwith.value; for (i=0;i<200;i++) { iString = cString; if (i<pr1.length) {iString = pr1[i];} if (i>=nStart && i<nStart+pr2.length) {iString = pr2[i - nStart];} if (iString == undefined) iString = cString; vna[i] = iString; } document.form1.vnarray.value = vna.join("\n"); document.form1.point1.value = 0; document.form1.point2.value = nStart; document.form1.rnds.value = 0; document.form1.dornd.disabled = false; document.form1.doxrnd.disabled = false; document.form1.xrd.value = 10; // fill variable arrays for(i=0;i<26;i++) { p1vararray[i] = 0; p2vararray[i] = 0; } document.form1.seevars.disabled = false; } function doRound() { // increment round counter document.form1.rnds.value++; // pointer locations var lineOne = document.form1.point1.value*1; var lineTwo = document.form1.point2.value*1; // P1 first var zline = vna[lineOne].toLowerCase(); // count the number of spaces in zline var chratloopy = 0; var numspaces = 0; while (chratloopy < zline.length) { if (zline.charAt(chratloopy) == " ") numspaces++; chratloopy++; } var newline; var paramz = zline.split(" "); var valqa = doFunc(paramz[0]+"",lineOne,1)*1; if (numspaces > 0) var valqb = doFunc(paramz[1]+"",lineOne,1)*1; if (numspaces > 1) var valqc = doFunc(paramz[2]+"",lineOne,1)*1; if (numspaces > 2) var valqd = doFunc(paramz[3]+"",lineOne,1); if (numspaces > 3) var valqe = doFunc(paramz[4]+"",lineOne,1); if (valqd != "!") valqd *= 1; if (valqe != "!") valqe *= 1; switch (numspaces) { case 0: if (zline == "x") { document.form1.dornd.disabled = true; document.form1.doxrnd.disabled = true; alert("Program 2 wins!"); return; } else { newline = doMod(lineOne + valqa); } break; case 1: var firstchar = zline.charAt(0); p1vararray[alphastring.indexOf(firstchar)] = valqb; newline = doMod(lineOne + 1); break; case 2: var replacestring = vna[doMod(lineOne+valqa)]; // check for capital variables var zzingl; var dropfwhenzero = 1; while (dropfwhenzero == 1) { zzingl = replacestring.length; dropfwhenzero = 0; for (i=0;i<zzingl;i++) { if (capalphastring.indexOf(replacestring.charAt(i)) != -1) { replacestring = replacestring.substring(0,i) + p1vararray[capalphastring.indexOf(replacestring.charAt(i))] + replacestring.substring(i+1); dropfwhenzero = 1; } } } vna[doMod(lineOne+valqb)] = replacestring; newline = doMod(lineOne + valqc); break; case 3: var temptemptemp = vna[doMod(valqa + lineOne)]; vna[doMod(valqa + lineOne)] = vna[doMod(valqb + lineOne)]; vna[doMod(valqb + lineOne)] = temptemptemp; if (vna[doMod(valqa + lineOne)] == vna[doMod(valqb + lineOne)]) { newline = doMod(lineOne + valqc); } else { if (valqd != "!") newline = doMod(lineOne + valqd); if (valqd == "!") newline = doMod(lineOne + valqc); } break; case 4: if (valqa == valqb) {newline = doMod(lineOne + valqc);} if (valqa > valqb) {newline = doMod(lineOne + valqd);} if (valqa < valqb && valqe == "!") {newline = doMod(lineOne + valqd);} if (valqa < valqb && valqe != "!") {newline = doMod(lineOne + valqe);} break; } // // // P2 now // // var zline = vna[lineTwo].toLowerCase(); // count the number of spaces in zline var chratloopy = 0; var numspaces = 0; while (chratloopy < zline.length) { if (zline.charAt(chratloopy) == " ") numspaces++; chratloopy++; } var newxline; paramz = zline.split(" "); valqa = doFunc(paramz[0]+"",lineTwo,2)*1; if (numspaces > 0) var valqb = doFunc(paramz[1]+"",lineTwo,2)*1; if (numspaces > 1) var valqc = doFunc(paramz[2]+"",lineTwo,2)*1; if (numspaces > 2) var valqd = doFunc(paramz[3]+"",lineTwo,2); if (numspaces > 3) var valqe = doFunc(paramz[4]+"",lineTwo,2); if (valqd != "!") valqd *= 1; if (valqe != "!") valqe *= 1; switch (numspaces) { case 0: if (zline == "x") { document.form1.dornd.disabled = true; document.form1.doxrnd.disabled = true; alert("Program 1 wins!"); return; } else { newxline = doMod(lineTwo + valqa); } break; case 1: firstchar = zline.charAt(0); p2vararray[alphastring.indexOf(firstchar)] = valqb; newxline = doMod(lineTwo + 1); break; case 2: vna[doMod(lineTwo+valqb)] = vna[doMod(lineTwo+valqa)]; newxline = doMod(valqc+lineTwo); break; case 3: var temptemptemp = vna[doMod(valqa + lineTwo)]; vna[doMod(valqa + lineTwo)] = vna[doMod(valqb + lineTwo)]; vna[doMod(valqb + lineTwo)] = temptemptemp; if (vna[doMod(valqa + lineTwo)] == vna[doMod(valqb + lineTwo)]) { newxline = doMod(lineTwo + valqc); } else { if (valqd != "!") newxline = doMod(lineTwo + valqd); if (valqd == "!") newxline = doMod(lineTwo + valqc); } break; case 4: if (valqa == valqb) {newxline = doMod(lineTwo + valqc);} if (valqa > valqb) {newxline = doMod(lineTwo + valqd);} if (valqa < valqb && valqe == "!") {newxline = doMod(lineTwo + valqd);} if (valqa < valqb && valqe != "!") {newxline = doMod(lineTwo + valqe);} break; } // render the VNA document.form1.vnarray.value = vna.join("\n"); document.form1.point1.value = newline; document.form1.point2.value = newxline; } function doMod(zeinput) { while (zeinput < 0) { zeinput += 200; } zeinput = zeinput % 200; return zeinput; } function doFunc(param, qline, zpp) { if (param == "") return ""; if (param == "!") return "!"; if (alphastring.indexOf(param) != -1) { return doSuperFunc(param, zpp); } var tempeval; var closeparen; var funcin; var beforeparstring; var commaloc; var parenloc; var rightloc; var funcname; var inputarray = new Array(); /*var xdata = new Array();*/ // loop until param is just a number while (param*1 != param) { closeparen = param.indexOf(")"); openparen = (param.substring(0,closeparen+1)).lastIndexOf("("); funcin = param.substring(openparen+1,closeparen); beforeparstring = param.substring(0,openparen); commaloc = beforeparstring.lastIndexOf(","); parenloc = beforeparstring.lastIndexOf("("); rightloc = Math.max(commaloc,parenloc); funcname = param.substring(rightloc+1,openparen); funcname = funcname.toLowerCase(); // /*alert(closeparen+" -- "+openparen+" -- "+commaloc+" -- "+parenloc+" -- "+rightloc+" -- "+zpp+qline); alert("Name: "+funcname+", Input: "+funcin);*/ // inputarray = funcin.split(","); for (i=0;i<inputarray.length;i++) { inputarray[i] = doSuperFunc(inputarray[i],zpp); } switch (funcname) { case "sum": case "add": tempeval = 0; for (i=0;i<inputarray.length;i++) { tempeval += inputarray[i]; } break; case "prd": case "mul": case "mult": tempeval = 1; for (i=0;i<inputarray.length;i++) { tempeval *= inputarray[i]; } break; case "inc": case "incr": tempeval = (inputarray[0] + 1); break; case "dec": case "decr": tempeval = (inputarray[0] - 1); break; case "neg": tempeval = (inputarray[0] * -1); break; case "inv": if (inputarray[0] == 0) {tempeval = 0} else {tempeval = 1 / inputarray[0];} break; case "num": var linetoterm = vna[doMod(qline + inputarray[0])]+""; tempeval = 1; for (i=0;i<linetoterm.length;i++) { if (linetoterm.charAt(i) == " ") tempeval++; } if (linetoterm == "x") tempeval = 0; break; case "mod": tempeval = (inputarray[0]*1) % (inputarray[1]*1); break; case "pow": tempeval = Math.pow(inputarray[0],inputarray[1]); break; case "div": tempeval = (inputarray[0]*1) / (inputarray[1]*1); break; case "sub": tempeval = (inputarray[0]*1) - (inputarray[1]*1); break; case "log": tempeval = Math.log(inputarray[1]*1) / Math.log(inputarray[0]*1); break; case "abs": tempeval = Math.abs(inputarray[0]); break; case "int": tempeval = Math.floor(inputarray[0]); break; } // replace part of param with tempeval... then loop again param = param.substring(0,rightloc+1) + tempeval + param.substring(closeparen+1); } return param; } function doSuperFunc(qwerty, zppp) { var qwertest = alphastring.indexOf(qwerty); if (qwertest != -1) { if (zppp == 1) qwerty = p1vararray[qwertest]; if (zppp == 2) qwerty = p2vararray[qwertest]; } else qwerty *= 1; return qwerty; } function doXRounds() { var getx = document.form1.xrd.value; for (i=0;i<getx;i++) { doRound(); } } function seeVars() { var ystr = "P1:\n"; for (i=0;i<26;i++) { if (p1vararray[i] != 0) ystr += alphastring.charAt(i)+" = "+p1vararray[i]+"\n"; } ystr += "\nP2:\n"; for (i=0;i<26;i++) { if (p2vararray[i] != 0) ystr += alphastring.charAt(i)+" = "+p2vararray[i]+"\n"; } alert(ystr); } /* end of script */ </script> </head> <body> <h1>VNA.4 Emulator, by unreality</h1> <br><br><br>P1 ..........................................................................................................P2<br><form name="form1"> <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();"></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>(range 42 to 158 please) <br><br><br><br><center>Fill with: <input type="text" name="fillwith" length="10" value="x"></center><br><input type="button" value="Load the Virtual Node Array!" onClick="loadArray();"><br><hr><br> VNA:<br><textarea name="vnarray" rows=30 cols=60></textarea><br> P1 Pointer: <input type="text" name="point1" length="10"><br> P2 Pointer: <input type="text" name="point2" length="10"><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"><input type="button" value="See Nonzero Variables" name="seevars" onClick="seeVars();" disabled="true"> </form> </body> </html> I hadn't noticed it before since most of my tests have been with one program and P2 being '0'. Thanks again Also, 'Do X Rounds' seems to fail depending on the Browser. Safari does it correctly to the best of my knowledge, Firefox only does two or so, and Chrome only one, depending on your comp speed and other factors. So the 'Do X Rounds' isn't so reliable and nice program, Brutus Maximus. I have yet to test it out, but looks good. Programs of that type tend to be round-efficient and churn out the most bombs/round, but they have a huge vulnerability downside: A single bomb on any of those lines will cripple the entire program. It's a tradeoff to find the right efficiency-per-danger ratio. Also, it has another thing you'll want to fix: lines are relative. So that last line is copying 153 from itself but 191 from "line zero" of the program. If you mark one off per line distance from the zeroeth line, you'd have this: a sum(a,1) 38 sum(40,a) 1 37 sum(42,a) 1 36 sum(44,a) 1 35 sum(46,a) 1 34 sum(48,a) 1 33 sum(50,a) 1 32 sum(52,a) 1 ... etc - the way it works out here is that it goes by twos from 40 instead of threes from 41. Now the numbers you wanted are relative to your line zero I'll post the Hopping Bomber and the Tracker in a bit, first I'm debugging a mathematical program that calculates square roots from the iterative Babylonian method
  19. the upper limit is 40 And the other program is placed anywhere from 42 to 158 lines from your program's starting node Yes... this one I adapted from my VNA 2.0 emulator (which was in turn based on my original javascript VNA emulator, which was in turn based on my hypercard version) but VNA.4 is quite different from 2.0 so I had to tweak some things
  20. VNA.4 ~ Based on VNA/VNA2/VNA3, but you don't need to know anything about those. This is entirely redesigned and simplified ~ Download the VNA.4 emulator, written in HTML/Javascript that runs fine on Firefox 2.0.0.14, Firefox 3.5.1, Safari 1.3 (v312), and Chrome 2.0.172.37 (and 2.0.172.39). It appears to not be working in Internet Explorer whatsoever. Just select all of the above code and copy it, pasting it into a simple text file. Then save the text file as "vna4.html". To run the emulator, just drag the text file onto your browser (for a Mac) or double-click the text file and it will open in your default browser (for Mac or PC) or right-click and select "Open with..." (for a Mac or PC) and then select the browser you want to open it in. Sorry for the inconvenience, I'll try to find out why I can't upload it... Imagine a world where your senses fail you. There is no sound, no smells. There's nothing to taste and nothing to feel. All you can see is an indecipherable infinite hierarchy of data, echoless chambers of information, architectures of code. This cyberscape is constantly changing with iteration by iteration, programs and viruses and shells warring for memory space and processing power. This is the inside of your computer. But now, an arena has been set aside... two programs, two warriors, shall duke it out in the Virtual Node Array... the VNA is a linear, circular memory core with 200 "nodes", or lines. You can keep going in any direction forever because of the VNA's circular disposition. Each node in the VNA has some code, mostly numbers with some letters and short words, written in terms and separated by spaces. Short, simple code. I will explain shortly how to design your program, but first, the setup system... In the beginning,the VNA is empty, constituting either all x's (bombs) or 1's (the command to jump to the next line) or some other simple preset filler. Then, the two warring programs are placed into the VNA, spaced out enough to give each other room. For example, say this is your program: a sum(a,3) 1 a -1 Then the VNA, which previously looked like this: x x x x x x x x ...etc will now look like this: x x x x a sum(a,3) 1 a -1 x x ...etc and your program's "pointer" will be placed at the first line of your program, the ""a sum(a,3)"" line. When the game begins, P1 (Program/Player 1) will go first, then P2, then P1, etc, in alteration. A single "round" is after both P1 and P2 have gone. The VNA updates after one program executes one line of code (so it updates twice each round). When a program executes a line of code, it does something, and then "jumps" the pointer to a new line. Lines are always referred to relative to the current line of interest; there is no absolute line numbering. So line 1 is always the next line. Line 0 is always the current line. Line -3 is always the line three behind you. Line 200 is the same thing as line 0, line 201 = line 1 = line 401 = line 601, line 197 = line -3, etc, since the VNA wraps around in a circular pattern. What the program does is determined by the line of code it executes. There are six "structures" which determine how the program evaluates a line of code. (0) BOMB structure: x *** the BOMB structure is always the single letter 'x'. If a program executes a BOMB structure, it will be terminated and the enemy will win. You can handle BOMB structures and move them around, copy them, etc, and as long as you don't execute one, you're fine... (1) JUMP structure: a *** this does nothing except jump the pointer to line 'a' (2) SET structure: a b *** this sets the variable 'a' to the value 'b', then jumps forward 1 line. You have 26 variables, a-z, and your opponent has 26 variables, a-z. Your variables and your opponent's variables never interact. More on variables in a second (3) COPY structure: a b c *** copy the contents of line 'a' into line 'b', overriding what was previously on line 'b'. Then jump the pointer to line 'c' (4) SWITCH structure: a b c d *** switch the two lines, 'a' and 'b', then jump to line 'c' if 'a' and 'b' were equal. If 'a' and 'b' are not the same, jump to line 'd' (5) IF structure: a b c d e *** compare two quantities, 'a' and 'b'. If a=b, jump to line 'c'. If a>b, jump to line 'd'. If a<b, jump to line 'e' That's it. With this simple system, many good programs can be written concisely, without many lines. For example, I call this the Hopper: 0 137 137 it copies itself 137 nodes forward, then jumps to this copied line for the next round... so each iteration, it jumps 137 nodes forward in the VNA. However, the Hopper's main drawback (other than that it has no offensive capabilities) is that the enemy can get accidentally overwritten by the Hopper and become a hopper as well, hopping for eternity, neither program winning. This is made unlikely by adding one more term to the program: 0 137 137 137 this new-and-improved Hopper is now based on the SWITCH structure. It switches itself with the node 137 lines ahead and then jumps there (regardless of what the other line is). This means that it doesn't leave behind a "hopper trail" that the enemy can get caught up in. But the Hopper is an offensively weak program; it takes no self-initiative to attack the enemy. It just jumps around, trying to avoid destruction and hoping the enemy destroys itself. So let's make a new program that rains BOMBs (the letter x) down over the VNA, attempting to hit the enemy's code We'll call this program 'Bomber'. If the enemy pointer executes a line of code that is a BOMB, the enemy's program will terminate, and the Bomber will win, so the goal is to spread bombs around the VNA... 3 sum(a,20) 1 a sum(a,3) -2 x what does it do? The first node copies line +3 (the BOMB) to the line denoted by the variable 'a' plus 20 [the function sum(1,2,3,4,...) adds everything inside] and then jumps forward 1 line. The next line assigns, to the value a, the quantity a plus 3. In other words, it increments 'a' by 3. The next line jumps backwards 2, and the cycle starts all over again, bombing a spot three nodes later each time. But wait! It is considered inefficient to have more "active lines" (lines that are actually being executed by the program) than you should, for two reasons: (1) The more lines the program is executing, the more susceptible it is to bombing. (2) It takes you longer to do the same task. So how can we shorten it? By switching the order of the lines and using the COPY structure's built-in jump to go back to the start. This new-and-improved Bomber does exactly the same thing as the old one, but more efficiently: a sum(a,3) 1 sum(a,16) -1 x The only function you've seen is the sum() function, and you've only seen it operate on two parameters. But sum() can have any number of entries, and can be substituted with add(), which is the same [just preference which you use]. ie, sum(a,b,c,d) = add(a,b,c,d) What other functions are there? * mul(), mult() and prd() are all the same, and they multiply everything inside. For example, mul(5,2,3) = 30. * the inc(n) or incr(n) functions will output n+1 * the dec(n) or decr(n) functions will output n-1 * the neg(n) function will output n * -1, ie, negative n * the inv(n) function will output 1/n, ie, the reciprocal of n * the mod(n,m) function will output n%m, ie, n modulo m, ie, the remainder when n is divided by m * the pow(n,m) function will output n^m, ie, n raised to the power of m * the div(n,m) function will output n/m, ie, n divided by m * the sub(n,m) function will output n-m, ie, n minus m * the log(n,m) function will output the logarithm base-n of m * the abs(n) function will output the absolute value of n * the int(n) function will output the integer base of n, ie, it will truncate/floor n to the greatest integer less than or equal to n * the num(n) function will output the number of terms in the line 'n' (relative to the current line of course). num(n) will return 0 if 'n' is a BOMB, 1 for JUMP, 2 for SET, 3 for COPY, 4 for SWITCH, and 5 for IF You can nest functions within functions and pass variables as parameters to functions. For example: sum(5,mul(3,mod(8,3)),inv(neg(-.2)),a,inc(inc( ) will output 5 + 3*(8%3) + 1/-(-.2) + a + (b+2) = 5 + 3*2 + 5 + a + b + 2 = a+b+18 ADDITIONAL THINGS ~~~~ What if you want to do a SWITCH structure but the line you jump to after that will be the same no matter what, regardless of whether the switched lines are equal? The answer is simple: in the setup 1 2 3 4, just make the 4th term the exact same as the 3rd term. But what if the term is long and complex or something? Just put a "!" exclamation point for the fourth term, ie: 1 2 3 ! This has no practical effect, it's just a preference thing. For SWITCH, it must be placed in the fourth term, and it just means that the 3rd term is the line that is jumped to, no matter what. The exclamation point is also usable in the IF structure. If you're using the IF structure a b c d e as a=b or a≠b and thus your fourth term is the same as your fifth term, put an exclamation point for the fifth term: 1 2 3 4 ! This means that, if 1=2, jump to 3. Otherwise, jump to 4. Again, the exclamation point just a convenience thing. ~~~~ What if you want to jump to variable 'x'? First of all, why use 'x' as a variable? There are plenty of others. But if you're using x for whatever reason, and you want to jump to the line denoted by the number 'x' is representing, you can't just do this: x since that's a bomb. However, you can just do: 0 0 x which is the same thing. ~~~~ When a line is copied by a COPY structure, it is copied verbatim. ie: 1 2 100 7 9 add(a,2) when run, that will copy the second line EXACTLY AS IT IS. Ie, after the first line is ran, the program will look like this: 1 2 100 7 9 add(a,2) 7 9 add(a,2) But if you want to make it so that a variable is evaluated before being copied, use a CAPITAL letter. Take this program: 1 2 100 7 9 add(A,2) say that the variable 'a' had a value of 3 at the time. Then after the first line runs, the program looks like this: 1 2 100 7 9 add(A,2) 7 9 add(3,2) A capital letter variable has no difference from a lower-case variable when the line is being executed, the only difference from lowercaseness is when the line is being copied... when a line is copied, all of its variables stay variables, unless they are capitalized, in which case they are evaluated then and there for the new line. By the way, a lone capital X is the same thing as a lower case 'x', ie, a bomb, except that if you copy this X, the result will be a number equal to whatever value your variable 'x' has. This makes 'x' a unique variable in that respect. So... two programs. One array. 200 nodes... and only one victor. Post your ideas, your programs, declare duels... I've only written two more programs that I haven't posted here, called "Hopping Bomber" (or "Bombing Hopper", not sure which one sounds better ;D) and "Tracker", so you reading this can probably do better than what I've got so far The emulator is for download at the top of this post. Have at it, test your programs. If you have any questions, feel free to post here!
  21. unreality

    Are you saying Barack Obama is taking vengeance on America for its slavery practices 150 years before? (1) slavery was the acceptable worldwide norm then except for a few liberal future-thinking people (like Obama) called abolitionists, who were against the cruelty and inhumanity of the system, who were mostly in the north of... you guessed it, the United States. And it was in the US that some of the earliest great strides against slavery were taken (2) IMO Obama is doing the best he can considering what's going on in the world today. Change of a colossal scale can't happen overnight. I just heard on the news that we're coming out of the recession, but tbh don't take my word for any of this lol, I tend to be a bit unfocused when it comes to politics
  22. unreality

    I particularly like the end of that third paragraph: It ["phronesis" aka Prudence] is not Science, because matters of conduct admit of variation; and not Art, because doing and making are generically different, since making aims at an end distinct from the act of making, whereas in doing the end cannot be other than the act itself: doing well is in itself the end. also, As for the origin of the word, the root phron at this link, and that evolved into "Phronism". The link attributes the root word to: * "having understanding; being wise and prudent" * "to intend to do something or have purpose doing something" * "to comprehend; to be sensible; to be alive; to be in high-spirits" So we can connect it back through Aristotle and even farther by saying something like: "The word Phronism originates from an ancient Greek root word meaning to think, act, and live with purpose... it morphed into the word phronesis as used by Aristotle to denote a Virtue of highest regard, attributed to wise thinking and rational understanding of the world"
  23. unreality

    That's the other problem, the 'taking off' bit. We've already established that we need some kind of charismatic figure to spearhead the public movement, but do you have any suggestions as to how to make it a publicized religion? Personally, I think that if we make a big deal out of it with a big spokesperson and movements and advertisements and just "leap out of the shadows" roaring, it will make a big splash, a big sensation, and then die off into anonymity fairly quickly. IMO, introducing it to the public would need to be a gradual process, maybe over a 20-year period or so. We would start by insinuating the ideas, the concepts, the backstories, implanting little gems of thought and history into the populace, inserting it into society slowly. The name "Phronism" wouldn't even come up until much later in the process, by the time the background ideas aren't so alien, and that when the religon emerges as true and real, it has sufficient backstory and buildup to be taken seriously.
  24. unreality

    What is the topic? Are we still pondering how to make Phronism palatable for the RD forum?
×
×
  • Create New...