
8th Light's 2009 ruby sparring tournament was posted at the end of August, but I just heard about it last week. I followed the simple instructions for getting started and was quickly rewarded with a very cool limelight app that drives the code you write. The coolest part of the app is that it analyzes your player and assigns a score. The score is based on efficiency, lines of code, test coverage, various metrics and of course how well your player does at hangman. I was immediately sucked in to the fun and challenge of the problem and I have created and refined my own player and submitted it for entry in the tournament. I thought I would share a few of the things I learned that might help others improve the scores of their own hangman players.
- "Simplicity Score" depends on lines of code, including comments, so delete all comments from the code to maximize your simplicity score.
- "Flog Score" is an easy one to maximize. Run flog separately on your code. Anything with a flog score above 9 will cost you points. Refactor bigger methods to smaller ones to keep their flog score below the limit.
- "Time Score" can be tricky to maximize. One approach is to create a performance test to help drive out the bottlenecks in your code. The hangman uses a list of 10,000 words so any time you iterate over that complete list you kick holes in performance.
No comments:
Post a Comment