spacepaste

  1.  
  2. #!/bin/ruby
  3. module Ex25
  4. # This function will break up words for us.
  5. # Sorts the words.
  6. # Prints the first word after shifting one back.
  7. # Prints the last word after popping it off.
  8. # Takes in a full sentence and returns the sorted words.
  9. # Prints the first and last words of the sentence.
  10. # Sorts the words then prints the first and last one.
  11. # Break it, pop a couple off the end and add fucker to the end, than return new sentence.
  12. # Shift 4 off the beginning, add death and put back together. Return new sentence.
  13. # Combines the two end changes above and prints out.
  14. puts "Let's practice everyfuckingthing."
  15. puts "\n"
  16. \tThe lovely world
  17. with logic so firmly planted
  18. cannot discern \n the needs of love
  19. nor comprehend passion from intuition
  20. and requires an explanation
  21. \n\t\twhere there is none.
  22. END
  23. puts "--------------"
  24. puts poem
  25. puts "--------------"
  26. puts "\n"
  27. five = 10 - 2 + 3 - 6
  28. puts "This should say #{five}."
  29. puts "\n"
  30. def secret_formula(started)
  31. start_point = 10000
  32. puts "start point is: #{start_point}"
  33. puts "With a starting point of: #{start_point}"
  34. puts "\n"
  35. puts "start point is: #{start_point}"
  36. puts "\n"
  37. puts "Now fer' the other way:"
  38. puts "With a starting point of: #{start_point}"
  39. puts "\n"
  40. sentence = "fuck all good things come to those who wait."
  41. puts sentence
  42. puts "\n"
  43. words = Ex25.break_words(sentence)
  44. sorted_words = Ex25.sort_words(words)
  45. puts "print first than last:"
  46. Ex25.print_first_word(words)
  47. Ex25.print_last_word(words)
  48. puts "\n"
  49. puts "Print first and last sorted:"
  50. Ex25.print_first_word(sorted_words)
  51. Ex25.print_last_word(sorted_words)
  52. sorted_words = Ex25.sort_sentence(sentence)
  53. puts "\n"
  54. puts "Print first and last:"
  55. Ex25.print_first_last(sentence)
  56. puts "\n"
  57. puts "Print first and last sorted."
  58. Ex25.print_first_last_sorted(sentence)
  59. puts "\n"
  60. puts "pop two off the end and add fucker."
  61. Ex25.add_fucker(sentence)
  62. puts sentence
  63. puts "\n"
  64. puts "shift four off the beginning and add death."
  65. Ex25.add_death(sentence)
  66. puts sentence
  67. puts "\n"
  68. puts "Print the sentence with both changes."
  69.