Board Thread:General Mod Discussion/@comment-25330335-20170525141701

Everyone knows the template on the mainpage that says "Did you know that this mod has over 150000 lines of code?", right? Well, I was thinking, and I decided to find out whether or not that was true.

First I downloaded a java decompiler for the command line so that I could use the terminal instead of messing with guis. I was able to extract the LOTR mod source without too much trouble.

Then I looked up commands for searching. Most on the Unix command line use grep. I ran this command: grep -rnw ./lotr -e ';' > semicolons.txt It should have spit out every line and line number that had a semicolon in it into the file semicolons.txt. It didn't so I used ack instead.

The first thing I tried I screwed up big time. See, I ran the command in the same directory as my output file. So naturally, it started going through that directory finding lines with semi-colons. When it got to the output file, it started going down it reading it, and writing to it farther down at the same time. If I'd let that go on it would have filled up my hard drive.

I did successfully run the command, and I got 136,487 lines of java source that have a semicolon after them. Now, there are a lot of lines of code (probably the most important ones) that don't have semicolons. That would effectively double the number of lines of code, so I think the template is actually a little under at this point.

Can anyone think of a better way to search, in order to exclude whitespace?

 