Why bother with binary addition when you can use good old-fashioned subtraction?
-
NebuchadnezzaR, on Oct 24 2004, 03:56 PM, said:
Sorry, i spoke ambiguously. I meant a cron and a mission to do the bit manipulation for entering the system, though i might only need the misn for that, using the onshipdone field. Im still not sure how all of that works. Two more crons to do all of the binary adding (4 bits)... why couldnt you have chosen 7?.
I dont feel like explaining how right now, but i will say iterative cron entry + R() in the onStart. (keep in mind its technically theoretical at the moment, but i see no reason it shouldnt work).
Very, very messy and clumsy. My favorite kind of hack. My ActivateOn field is 198 charachters long.
Actually, i could do all of the counting with one cron... Maybe. If you have iterative entry and iterative exit, will it run the onend field at least once, then check, or would it never run the onend field (since the activateOn would be unsatisfied because it already left the onstart loop)?
View PostHeh, 9 was chosen quite intentionally- just to frustrate you. My basic idea uses 2 crons to control a 3 bit counter, so I can count up to 7, which is effectively 8 for my purposes. When the timer is at 7, the system swaps itself, and the counter doesn't get incremented. So, you can get away with only only a 3 bit counter and still do it every 9th time.
As far as the iterative entry/exit, I'm almost certain it iterates until it's done on the onstart, and then iterates until it's done on the onEnd- no mixing it up.
Anyway, it sounds like a bit control nightmare, your 1-cron counter. However, I think I have an inkling as to how it works... might have to play with that a bit.
-
Im a fan of formal logic though, so its more of an adventure than a nightmare. In a bad way. Seven consecutive parenthesis still irks me.
I think i can explain it. a**** is the bits you want to increment and b**** is a buffer. The terminology should be sorta self explanatory, but in retrospect it isnt too clear. Ask about any part and ill clarify.
if the bit is set to add, and the following conditions are not met, randomise every bit in the buffer:
a0111 and b1000 or (the top bits are the same & ( (a011 and b100) or the next set of bits are the same etc...
so it checks for a carry, essentially, and everything above the carry it makes sure is exactly the same. It rerandoms the buffer until b is equal to a+1. I guess i could use 3 bit adding as use suggested, but since 4 bit adding fits in the onstart field, and i already have it all typed out, ill leave it.
The other cron is easier of course.
while the bit is set to finish adding, rerandomise a**** until a****==b****
(naturally in the onend fields of these are the appropriate 'clear the adding bit, and set the finishadding bit' etc)
I think i wasnt clear (suprise) about my question regarding crons. My question is which of these two setups they use:
while(enableOn){onstart} while(enableOn){onend}
while(enableOn){onstart} do{onend}while(enableOn)if its the first one, the onend field will clearly never be evaluated because for it to get there, the onstart field must have already satisfied the ending conditions of the iterative loop. If its the second one, it evals onend once before checking if it should iterate. I think i can make a complete binary adder (and possibly subtracter combo) with one cron if its the second case, but i would need two crons if it were the first. Naturally, the char limit of the fields gets in the way, so id be only 3 bit.
-
Mine does. Assume xxx to be an invisible counter outfit and yyy to be some bit. Basically, you have an invisible misn with a specialship and a shipgoal of Observe. Availability = Oxxx. OnStart = !byyy. OnShipDone = Dxxx, abort itself, and restart itself. Now, make a cron that activates on !Oxxx. Set the duration, preholdoff, and postholdoff to 0. OnStart = Gxxx Gxxx Gxxx Gxxx Gxxx Gxxx Gxxx Gxxx Gxxx byyy. Set the pers to appear in the system 100% of the time, and set it to only show up if byyy evaluates to true.
-
Yep, that sounds exactly like what i was thinking of at the bottom of the previous page
That should work perfectly well. You know, i think, if Masumune can do it with 3 bits, I think i might not be able to beat him rescource wise. My fancy cron trick only saves space if you use 4 bits, as it can add (with wrapping (at any number, even 9)) using only 2 crons. I still need to get a working version of mine, though, to see if i cant streamline it. If you were using mission xxx, can you put Axxx Sxxx Byyy in the onshipdone field, or does the mission not want to abort itself while itself is still being activated?
Ill try a bunch of things about now... like the iterative cron thingy i asked above.
-
NebuchadnezzaR, the mission can abort and restart (refresh) itself in this way. I've used this a couple of times while playing around with Nova.
-
Cool, thanks. Then i really can do it with 2 cron and 1 misn. (and the sys/dude whatnot)
Ive still yet to get a version working, though.
But i did make a retarded flash game (not that the internet needs any more).
Once my host works I'll embarras myself with it(/off topic)