Guest User

Untitled

a guest
Apr 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. #- - - - - - - - - - - - - -#
  2. # #
  3. # a bit about falling #
  4. # by: evan #
  5. # #
  6. #- - - - - - - - - - - - - -#
  7.  
  8. # first of all:
  9. def it_is_ok
  10. # ok?
  11. "ok."
  12. end
  13.  
  14. # but:
  15. # when a thing
  16. def hits_the_ground_from the_height
  17. # if we can assume that the
  18. remaining_energy = the_height
  19.  
  20. # then we can say
  21. if remaining_energy
  22. that_the "thing uses some of the #{remaining_energy} to bounce"
  23. # and
  24. rises_to the_next_peak_from(the_height)
  25.  
  26. else
  27. # the thing just
  28. rests
  29. # and that is the
  30. end # of it
  31. end
  32.  
  33. # it should be noted that:
  34.  
  35. # in order to determine the
  36. def the_next_peak_from the_old_height;
  37. unless the_old_height < 0.01
  38. # we assume that
  39. new_height = the_old_height * 0.5
  40. else
  41. # the thing is no longer bouncing
  42. # percievable to this observer, anyway...
  43. end
  44. end
  45.  
  46. # also,
  47. # when a thing
  48. # is dropped
  49. def from a_height # it
  50. hits_the_ground_from a_height
  51. end
  52.  
  53. # likewise,
  54. # when a thing
  55. def rises_to a_new_height
  56. # then it will fall
  57. from a_new_height
  58.  
  59. end
  60.  
  61. # but...
  62.  
  63. # and most importantly.
  64.  
  65. # when the time is just right,
  66.  
  67. # the thing just
  68.  
  69. def rests;
  70.  
  71. and_we_know it_is_ok
  72.  
  73. #the
  74. end
  75.  
  76. #----------------------------------------------#
  77.  
  78. alias :and_we_know :puts
  79. alias :that_the :puts
  80.  
  81. ## when run..
  82.  
  83. hits_the_ground_from 50
  84.  
  85. thing uses some of the 50 to bounce
  86. thing uses some of the 25.0 to bounce
  87. thing uses some of the 12.5 to bounce
  88. thing uses some of the 6.25 to bounce
  89. thing uses some of the 3.125 to bounce
  90. thing uses some of the 1.5625 to bounce
  91. thing uses some of the 0.78125 to bounce
  92. thing uses some of the 0.390625 to bounce
  93. thing uses some of the 0.1953125 to bounce
  94. thing uses some of the 0.09765625 to bounce
  95. thing uses some of the 0.048828125 to bounce
  96. thing uses some of the 0.0244140625 to bounce
  97. thing uses some of the 0.01220703125 to bounce
  98. thing uses some of the 0.006103515625 to bounce
  99. ok.
Add Comment
Please, Sign In to add comment