Got it, Thanks!Compo wrote:Version 2.1 from December 2016!
...pastebin, huh? Seems convenient for larger scripts, I'll have to remember that. ^_^
Ha! It's news-guy Brian Williams... but no of course (unless it is?). You can view the original scripts here. Short, simple, integer-only Add, Multiply, and Compare... good stuff.
*1 hour later*
I just read through Judago's whole script, lots of stuff we do almost exactly the same. His procedures are shorter, but spend much more time in loops. The script divides using multiple subtraction, and he's using '1s borrow' style subtraction (the hard way, look for 'Austrian subtraction'... you'll never do it the other way again). He stopped where I was originally going to, just consider everything between :math_bas and :math_fnc as a unit, and it's essentially the same, and could be used as such (:math_bas num1|numVar1 num2|numVar2 opCode [returnVar]), I only decided to add the parser after seeing the pseudo-code for 'shunting yard' and it looked fairly easy to implement. I should set up a timing test... there's probably a thread about timing scripts here, right (maybe even with pre-made scripts)?
I'm looking into creating separate macro versions of the main functions (+-*/^) to see if it's possible to eliminate all of the CALLs... for fun, really. It spends so much time in loops that I don't see it really speeding things up much, but it might be nice to be able to insert a division or multiplication directly in a script where it's needed. Which brings a question...
Is there a practical limit to the size of a code block in batch scripts? I understand the 8192 limit for strings (8191?) so the macros can't exceed that, but how about the actual code block (everything inside the outer-most set of parenthesis)... as I understand it the whole thing is parsed at once (which is why %var% remains static) and if I install macros into the parser that thing's gonna get HUGE!
Anyhow, little update to v0.2. Thanks for the links guys, looks like I have some fun reading to do.