[dirGames-L] code counter
Duck
duck at robotduck.com
Thu Oct 13 19:31:20 EDT 2005
Hi Guys,
Just thought I'd share this small tidbit with you. Yesterday evening I was asked about how many lines of code go into a game, and more interestingly, how many A4 pages it would take up without all the line breaks!
I had Dave Mennenoh's old codecount tool around, but that couldn't tell me the number of characters, and I wasn't sure whether it was counting comments on the same line as code, empty lines, etc, so I knocked this together:
http://www.robotduck.com/content/misc/utilities/codeCounter/
It counts code & comments separately (even if they share a line) and gives a nice breakdown of each, as well as an estimate of A4 pages it would take up if printed at 12pt times new roman with default MS word page margins!
Stick the .dir file in your Director app xtras folder, restart director, load your own .dir, then run the tool from the xtras menu. Enjoy!
Sample output:
________________________________________________________________
Code Count Totals:
Total Functions: 429
Total Code Lines: 9465 (271698 chars)
Total Comment Lines: 1213 (52767 chars)
Total Blank Lines: 4815
Code to comment ratio: 8:1
--------------------------------------------------
12pt Times New Roman A4 pages (blank lines omitted)
As written: 213 pages
Line breaks removed: 95 pages
--------------------------------------------------
Top 10 Largest scripts (% by character count):
22% : "rd tools" (2389 lines, 81 functions)
5% : "External Asset Loader" (602 lines, 6 functions)
5% : "generate level" (479 lines, 3 functions)
4% : "system test bhv" (577 lines, 8 functions)
4% : "player script" (485 lines, 6 functions)
4% : "Overlay / Backdrop Manager Behaviour" (372 lines, 15 functions)
3% : "game world" (355 lines, 10 functions)
3% : "dropdowns" (377 lines, 16 functions)
3% : "keys" (334 lines, 11 functions)
3% : "camera script" (294 lines, 4 functions)
--------------------------------------
Finished. (took 5824 ms)
- Ben
_______________________
duck_at_robotduck.com
www.robotduck.com
More information about the dirGames-L
mailing list