Skip to content

Instantly share code, notes, and snippets.

@photomattmills
Created November 3, 2010 17:55
Show Gist options
  • Save photomattmills/661430 to your computer and use it in GitHub Desktop.
Save photomattmills/661430 to your computer and use it in GitHub Desktop.
A simple ruby script for writing NaNoWriMo entries.
words = 0
puts "How many words today?"
nwords = gets.chomp.to_i
word_string = ""
todays = File.new("NaNoWriMo" + Time.now.strftime('%b-%d'), "w" )
while words < nwords do
word_string << gets
words = word_string.scan(/\w+/).length
todays.write(word_string)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment