Created
November 3, 2010 17:55
-
-
Save photomattmills/661430 to your computer and use it in GitHub Desktop.
A simple ruby script for writing NaNoWriMo entries.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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