Created
July 16, 2012 19:36
-
-
Save benwilson512/3124563 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
last_file = Dir.open('.').select{|d| d.include?("output")}.sort.last | |
current_session = last_file ? last_file.match(/[0-9]{1,}/).to_s.to_i + 1 : 0 | |
File.open("output#{current_session}.txt", 'a') do |f| | |
puts "Session: #{current_session}" | |
while thought = gets != "that's all for now\n" | |
print "\e[2J\e[f" # clear the screen. | |
f.write(thought) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment