Ruby Football
I wrote this quickie to pull names out of a hat to choose the order of our Fantasy Football draft. It ended up being way shorter than what I originally wrote. Sadly, I didn’t keep the original version. In five minutes or so I went through at least six or seven iterations. Go football!
The hat:
puts ARGV.delete_at(rand(ARGV.length)) until ARGV.length == 0
A demo:
cmcavoy@aubrey:~/projects$ ruby football_hat.rb huey dewey louie cat dog mouse
huey
dewey
cat
dog
mouse
louie
Over the weekend, I spent an hour or so playing around with getting a bunch of CSV files from a football statistics site into MySQL via ActiveRecord. Although I know you can use ActiveRecord outside of Rails, I thought I’d just build the scripts inside a Rails app. I checked it into my public repository here http://www.lonelylion.com/mcavoy_public/footballs/trunk/
Because of the limited number of games in a season, football doesn’t bear up to intense statistical analysis the way baseball does. The only sort of stats’y thing I’d like to run against this database is classifying teams as throwing or running teams. It’s kind of trivial, and most of the magazines cover that, so it’s sort of pointless, but…meh…football!
-
Chris
