Search found 46 matches

by CirothUngol
02 Oct 2017 10:57
Forum: DOS Batch Forum
Topic: Batch Maze Game:(Another Major speed improvement)
Replies: 11
Views: 4664

Re: Batch Maze Game:(Another Major speed improvement)

Hello, i think your maze is not really a maze. Hmm, perhaps we have different definitions of what a maze is? It produces output fairly identical to amaze.exe (so perhaps it doesn't produce mazes either?). It also produces output fairly identical to many of the code samples on Rosetta Code (for non-...
by CirothUngol
28 Sep 2017 20:19
Forum: DOS Batch Forum
Topic: Batch Maze Game:(Another Major speed improvement)
Replies: 11
Views: 4664

Re: Batch Maze Game:(Another Major speed improvement)

Thanks for the fun little batch game. I played it for awhile (looks great, quick and fun to play, challenging when the mazes get big) and was checking out neorobin's code... so now I've got mazes on my mind! I've been examining the different algorithms and decided to attempt the easiest depth-first ...
by CirothUngol
22 Sep 2017 18:57
Forum: DOS Batch Forum
Topic: Slide Puzzle game in Batch
Replies: 8
Views: 2512

Re: Slide Puzzle game in Batch

Ok, that was fun. ^_^ Batch games! That's what originally brought me to DOStips... or actually it was Snake , but I stayed for the other goodies... like this! I haven't done one of these since I was a kid. I finally solved it, but it must have taken me 50+ moves. Maybe add a visible move counter, sc...
by CirothUngol
21 Sep 2017 23:46
Forum: DOS Batch Forum
Topic: math.cmd: a math expression parser written in native WinNT batch script
Replies: 17
Views: 5435

Re: math.cmd: a math expression parser written in native WinNT batch script

Version 2.1 from December 2016! Got it, Thanks! ...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 Compar...
by CirothUngol
21 Sep 2017 09:09
Forum: DOS Batch Forum
Topic: math.cmd: a math expression parser written in native WinNT batch script
Replies: 17
Views: 5435

Re: math.cmd: a math expression parser written in native WinNT batch script

No, I was not! I got the seed of this idea from Brian Williams big math batch utilities. Before getting involved in it, I did search for an equivalent online but never found one. I'm most interested in taking a look at his batch script just to see how we have done things differently (or the same), b...
by CirothUngol
19 Sep 2017 06:35
Forum: DOS Batch Forum
Topic: math.cmd: a math expression parser written in native WinNT batch script
Replies: 17
Views: 5435

Re: math.cmd: a math expression parser written in native WinNT batch script

Yes. Sorry, I should have looked at the other thread first.
Didn't really think about using a separator for multiple expressions (like in SET), but that's a good idea. How about a semi-colon ';' ? That should be easy to implement.
by CirothUngol
19 Sep 2017 01:33
Forum: DOS Batch Forum
Topic: .bat file to average 2 columns in .csv file, and print results to the file name.
Replies: 22
Views: 4726

Re: .bat file to average 2 columns in .csv file, and print results to the file name.

aGerman wrote:Because you didn't provide an example of the csv content...
This would be most helpful.

call math "/d2 (CMAA=avg(!CMAA_list:~1!)) > (TAA=avg(!TAA_list:~1!))"
Change the operator in the middle to anything other than assignment and this should work, comparison is probably fastest.
by CirothUngol
19 Sep 2017 01:18
Forum: DOS Batch Forum
Topic: math.cmd: a math expression parser written in native WinNT batch script
Replies: 17
Views: 5435

Re: math.cmd: a math expression parser written in native WinNT batch script

The assignment is legal if it's at the beginning of a clause, ie. following a comma or left parenthesis: CALL :math 32 * (xx=V1-V2) This would put the value of V1 - V2 in variable xx (and the final result into variable math , always). You could assign several operations in this way, as long as the s...
by CirothUngol
16 Sep 2017 12:20
Forum: DOS Batch Forum
Topic: split string into substrings based on delimiter
Replies: 37
Views: 26484

Re: split string into substrings based on delimiter

I realized that my previous method to trim leading and trailing spaces also reduce several spaces between words to just one. ... and that's why I love it! I had previously always used this construct to do the same thing: FOR %%A IN ("!string: =" "!") DO IF "%%~A" NEQ &...
by CirothUngol
16 Sep 2017 11:44
Forum: DOS Batch Forum
Topic: Quickest way to remove trailing zeros from a string?
Replies: 19
Views: 4133

Re: Quickest way to remove trailing zeros from a string?

I think that this method should run faster (and it is much simpler) Faster, I have no doubt. Clever and elegant, sure. Simpler... don't know about all that. I certainly see how it works, but definately falls into the "I'd have never thought of that" category. Love it! My issue with it is ...
by CirothUngol
16 Sep 2017 11:23
Forum: DOS Batch Forum
Topic: math.cmd: a math expression parser written in native WinNT batch script
Replies: 17
Views: 5435

Re: math.cmd: a math expression parser written in native WinNT batch script

Oops again... don't know what happened, probably shouldn't post stuff at 3am. ^_^
by CirothUngol
16 Sep 2017 02:46
Forum: DOS Batch Forum
Topic: math.cmd: a math expression parser written in native WinNT batch script
Replies: 17
Views: 5435

math.cmd: a math expression parser written in native WinNT batch script

OK, I'm ready to start trying to optimize my latest script with some of the goodies found here at Dostips, but before I go tinkering with tools that I know precious little about and wind up wrecking what is at the moment a mostly complete and seemingly working batch script, I thought I might post it...
by CirothUngol
15 Sep 2017 21:24
Forum: DOS Batch Forum
Topic: Quickest way to remove trailing zeros from a string?
Replies: 19
Views: 4133

Re: Quickest way to remove trailing zeros from a string?

Just stopped to post the code being used... :math_trailing numVar -- removes trailing zeros SET m_t=4096 FOR /L %%X in (1,1,13) DO IF DEFINED %~1 FOR %%Y IN (!m_t!) DO ( IF "!%~1:~-%%Y!"=="!zeros:~-%%Y!" SET "%~1=!%~1:~0,-%%Y!" SET /A m_t/=2 ) IF DEFINED %~1 IF "!%...
by CirothUngol
15 Sep 2017 14:54
Forum: DOS Batch Forum
Topic: Quickest way to remove trailing zeros from a string?
Replies: 19
Views: 4133

Re: Quickest way to remove trailing zeros from a string?

I'll probably just use the trailing portion of the original function so that there are no limitations on the size of the string. Thanks for the suggestions guys! As to the categories for a potential Library, I think it would be most prudent to separate functions into ones that do or do not require t...
by CirothUngol
15 Sep 2017 13:36
Forum: DOS Batch Forum
Topic: Quickest way to remove trailing zeros from a string?
Replies: 19
Views: 4133

Re: Quickest way to remove trailing zeros from a string?

Yep, that seems to be exactly what I'm looking for. Using the same type of binary chop down as the strLen function, clever... I probably never would have thought of it, or found it. At the risk of asking this question for the umpteenth time, is there an updated Library of functions and their macro e...