Premature trigger stop

Luth

Lex Luthor!
Reaction score
41
I have a simple trigger that runs a simple loop circa 15,000 times. However, it just dies out and quits after around 5k-6k into the loop. Any way around that?
 

corvusHaunt

New Member
Reaction score
96
Run a quick sleep action. Either add an "if" to your loop, seeing if your forloopindex is 5,000;10,000;15,000 whatever, or just use three loops, seperated by a wait.
 

Luth

Lex Luthor!
Reaction score
41
Heh, was just coming back to say I figured out that Sleeping would keep it going. ;) Thx corvus.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Quite frankly, I don't think I want to know what kinda loop requires 15000 iterations...
And, if you hit the trigger execution time limit... there's a reason.
Not to mention that you probably want to go even higher.

Very evil :p
 

Luth

Lex Luthor!
Reaction score
41
I'm not a fan of brute force either, but there are sometimes no other ways. :-/
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
[Off topic]

Did you know?

17 * 42
= (1 * 10 + 7) * (4 * 10 + 2)
= 1 * 4 * 10 * 10 + 1 * 2 * 10 + 4 * 7 * 10 + 2 * 7
= 4 * 100 + (2 + 28) * 10 + 14
= 4 * 100 + 30 * 10 + 14
= 4 * 100 + 3 * 100 + 1 * 10 + 4
= 7 * 100 + 1 * 10 + 4
= 714?
 

corvusHaunt

New Member
Reaction score
96
Yah I totally knew that.

By the way, you made my World Editor crash:
Code:
17 * 42 = (1 * 10 + 7) * (4 * 10 + 2) = 1 * 4 * 10 * 10 + 1 * 2 * 10 + 4 * 7 * 10 + 2 * 7 = 4 * 100 + (2 + 28) * 10 + 14 = 4 * 100 + 30 * 10 + 14 [SIZE=4][B])[/B][/SIZE] = 4 * 100 + 3 * 100 + 1 * 10 + 4 = 7 * 100 + 1 * 10 + 4 = 714?
 

SFilip

Gone but not forgotten
Reaction score
634
> Curious....what are you doing that requires that much looping :confused:
i'm guessing its for vexorian's contest :p
 

martix

There is no spoon
Reaction score
49
Contest, what contest?
Oh, and I really wanna know what this trigger is supposed to do!
 

SFilip

Gone but not forgotten
Reaction score
634

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> I'm guessing it's for Vexorian's contest

All the more reason to stop looping...

If you're hitting time problems at 15000, how long you think it will run with 1000000? What about 1000000000?
 

martix

There is no spoon
Reaction score
49
This is actually more of a mathematical problem, than proggraming one.
Either way, when I go home, if it continues to be more about logic and less proggraming, I might learn JASS well enough to take part in it.
And there is definately a better algorithm, just requires a little bit more thinking.
Edit:
Oh, yeah I finally got it, took some time to remember, but no matter...
Your's is too brute force, you're not trying to crack a password, are you? :)
Its simple anyway, you just have to think a bit!
S=n/2*(2+(n-1)) - this would be your case. And this thing is called arithmetic proggresion. If its that simple then this is no contest at all...
 

emjlr3

Change can be a good thing
Reaction score
395
first off its only lvl 1 of the contest, and second off, once you get integers above that level, like 2500000000, they bug out, so you gotta find some way to work around that, which I have yet to be able to do :(
 

Luth

Lex Luthor!
Reaction score
41
Thats the equation, but you still run into problems, as emj said, with n >=~ MAXINT^.5. I suppose one solution would be to break down n into its factors, but if you're given a prime number >=~ MAXINT^.5 then you're screwed six ways from sunday. :cool:

But, its entirely possible to do; if I can do it, you can. The hardest part is, as stated, working around JASS's limitations.

PS: If you do get a work-around working with the formula that works for ALL number, I'd be very happy to see it. :) [I've since submitted my solution, and have stated for public record as much, so dont worry about me trying to cheat and steal your genius. I'm merely insanely curious as how someone managed to work-around with the equation.]
 

emjlr3

Change can be a good thing
Reaction score
395
a few ppl got it already, Pip, Blue, 1 other i think, but i dont know it yet, I thought I had it, but it ended up not working for me :(

I really am not sure what to do heh
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Haven't really been reading post #9, have you?

It started with multiplying two 2 digit numbers.
And yet, the biggest multiply inside that calculation was 4 times 7, which is half the size.

Some bigger example maybe:

Let's say you want to multiply 1234 by 5678.
Unfortunately, your calculator is from before WWI and refuses to multiply anything, unless it's in the range 0 - 99.

What to do?

Well, you might notice that 1234 is 12 * 100 + 34, and 5678 is 56 * 100 + 78.
Those 4 factors, 12, 34, 56 and 78, are each within 0 - 99.

1234 * 5678
= (12 * 100 + 34) * (56 * 100 + 78)

multiplying it all out, with a bit of grouping back:

= 12 * 56 * 100 * 100 + 12 * 78 * 100 + 34 * 56 * 100 + 34 * 78
= 12 * 56 * 100 * 100 + (12 * 78 + 34 * 56) * 100 + 34 * 78
= 672 * 100 * 100 + (936 + 1904) * 100 + 2652
= 672 * 100 * 100 + 2840 * 100 + 2652

some of the factors in here are too large, and need readjusting:

= 672 * 100 * 100 + (28 * 100 + 40) * 100 + (26 * 100 + 52)
= 672 * 100 * 100 + 28 * 100 * 100 + 40 * 100 + 26 * 100 + 52
= (672 + 28) * 100 * 100 + (40 + 26) * 100 + 52

leading to the final result:

= 700 * 100 * 100 + 66 * 100 + 52
= 7006652

where the actual result is really just writing out the factors one after the other, ignoring the "100"s.

Somewhat longish maybe, but, your 0-99 calc was enough to get the job done!
You may notice that I didn't really do anything with all those "* 100", that's because they are only needed so I remember the correct positions.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top