Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: thepenguin77 on September 02, 2012, 01:36:09 pm

Title: How prolific are you?
Post by: thepenguin77 on September 02, 2012, 01:36:09 pm
Everyone wants to know how many lines of code they've written in their lifetime right? Well now you can.

Assuming you have all of your source files in one giant folder make a batch file that looks like this and run it.
Code: [Select]
mkdir summation
del summation\summation.txt
for %%f in (*.z80) do type "%%f" >> summation\summation.txt

A folder called summation will appear and inside will be all of your programs all joined together.

Spoiler For tweaks:
If you don't use the file extension ".z80", you can change that part to ".asm", or whatever you use. If you use all kinds of extensions, you can make it ".*", but that will try to sum all files of all extensions, including .exe's and whatnot.

If you have your source in folders, you can sum that too, but you're going to need to include each folder yourself. The code for a folder is

for %%f in (folder\*.z80) do type "%%f" >> summation\summation.txt


Spoiler For my batch file:

mkdir summation
del summation\summation.txt
for %%f in (*.z80) do type "%%f" >> summation\summation.txt
for %%f in (blue2\*.z80) do type "%%f" >> summation\summation.txt
for %%f in (flashCards\*.z80) do type "%%f" >> summation\summation.txt
for %%f in (missile\*.z80) do type "%%f" >> summation\summation.txt
for %%f in (osPatcher\*.z80) do type "%%f" >> summation\summation.txt
for %%f in (zrox\*.z80) do type "%%f" >> summation\summation.txt
for %%f in (zstart\*.z80) do type "%%f" >> summation\summation.txt


My summation.txt had 3,072,590 characters and was 234,453 lines long. How long is yours?
Title: Re: How prolific are you?
Post by: Sorunome on September 02, 2012, 01:39:50 pm
That's a lot of lines! :P
Mine is 0 lines..../me hides
But nice idea to make your line-counting and word-counting easy!
Title: Re: Re: How prolific are you?
Post by: DJ Omnimaga on September 02, 2012, 03:10:35 pm
Darn, with short lines in BASIC programs and the large amount I made, I can't imagine how many lines I wrote in my life. On top of that I had a few extra programs I no longer have due to data loss years ago.
Title: Re: How prolific are you?
Post by: cooliojazz on September 02, 2012, 03:29:59 pm
Here, have a modified version that works with directories and multiple extensions
Code: [Select]
del sum.txt
FOR /F "delims=`" %A IN ('dir /b /s ^| findstr ".ext1 .ext2 .ext3"') DO type "%A" >> sum.txt
Replace .ext1, .ext2, etc. with all the extensions you want to search for, eg ".z80 .asm .inc"

I did it with like every project i have on this computer (java and php stuff mostly) and got 18,447,077 characters and 366,780 lines.  I wish I could include all the TI programs I've ever written too, and the few vb ones i wrote a long time ago that are floating around somewhere... then it would probably be more like 20 million characters =P
Title: Re: How prolific are you?
Post by: thepenguin77 on September 07, 2012, 05:50:42 pm
I'm glad to see someone knows DOS.

Also, you beat me by like 6x.
Title: Re: How prolific are you?
Post by: cooliojazz on September 07, 2012, 07:52:59 pm
Haha, only because I've been using it so much for a project the last couple weeks XD  And do you realize how many text editors fail at opening a 18.5m char file, or don't have a word counting utility?  I actually had to go and download like a fifth one just to do that.
Title: Re: How prolific are you?
Post by: Link on September 07, 2012, 07:56:09 pm
Hmm, currently at 38798 lines, including all projects (c/c++/ruby and so on)