Guest User

Untitled

a guest
Nov 11th, 2014
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. else
  2. hash = {}
  3. puts "Processing: #{ARGV[0]} (input), #{ARGV[1]} (output)"
  4.  
  5. in_file = File.new(ARGV[0], 'r')
  6.  
  7. in_file.each_line.with_index do |line, idx|
  8.  
  9. puts " "
  10. print line
  11. line.chomp.split(' ').map(&:to_i)
  12. if line.include?("S") || line.include?("s")
  13. puts "Square"
  14. nums = line.scan(/\d+/).map(&:to_i)
  15. puts nums
  16. elsif line.include?("R") || line.include?("r")
  17. puts "Rectangle"
  18. elsif line.include?("C") || line.include?("c")
  19. puts "Circle"
  20. elsif line.include?("T") || line.include?("t")
  21. puts "Triangle"
  22. else
  23. puts "else"
  24. end
  25.  
  26.  
  27. end
  28.  
  29. end
Advertisement
Add Comment
Please, Sign In to add comment