Skip to content

Instantly share code, notes, and snippets.

@audy
Created July 21, 2010 02:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save audy/483932 to your computer and use it in GitHub Desktop.
Save audy/483932 to your computer and use it in GitHub Desktop.
# Playing code-golf
# Averages sequences in a FASTA file (wrapped or unwrapped)
a,b=0,[];File.new(ARGV.shift).each do |i|;if i[0]!=62;a+=i.length;else;b.push a;a=0;end;end;puts b.inject{|s,v|s+=v}/b.length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment