fork(1) download
  1. # Assignment 9 - Tweeting with Ruby
  2. # J Student
  3.  
  4. # Tweets from Albert Einstein
  5. einstein_tweets = {
  6. einstein1: "Imagination is more important than knowledge.",
  7. einstein2: "Life is like riding a bicycle. To keep your balance you must keep moving.",
  8. einstein3: "Try not to become a man of success, but rather try to become a man of value.",
  9. einstein4: "The important thing is not to stop questioning.",
  10. einstein5: "I have no special talents. I am only passionately curious.",
  11. einstein6: "Reality is merely an illusion, albeit a very persistent one."
  12. }
  13.  
  14. # Tweets from Yoda
  15. yoda_tweets = {
  16. yoda1: "Do or do not. There is no try.",
  17. yoda2: "Train yourself to let go of everything you fear to lose.",
  18. yoda3: "Fear is the path to the dark side.",
  19. yoda4: "In a dark place we find ourselves, and a little more knowledge lights our way.",
  20. yoda5: "Truly wonderful, the mind of a child is.",
  21. yoda6: "The greatest teacher, failure is."
  22. }
  23.  
  24. # Display Einstein's Tweets
  25. puts "A few thoughtful tweets from Albert Einstein:\n\n"
  26. einstein_tweets.each do |key, tweet|
  27. puts "(#{key}) #{tweet}"
  28. end
  29.  
  30. puts "\n\nA few wise tweets from Master Yoda:\n\n"
  31. yoda_tweets.each do |key, tweet|
  32. puts "(#{key}) #{tweet}"
  33. end# your code goes here
Success #stdin #stdout 0.01s 8020KB
stdin
Standard input is empty
stdout
A few thoughtful tweets from Albert Einstein:

(einstein1) Imagination is more important than knowledge.
(einstein2) Life is like riding a bicycle. To keep your balance you must keep moving.
(einstein3) Try not to become a man of success, but rather try to become a man of value.
(einstein4) The important thing is not to stop questioning.
(einstein5) I have no special talents. I am only passionately curious.
(einstein6) Reality is merely an illusion, albeit a very persistent one.


A few wise tweets from Master Yoda:

(yoda1) Do or do not. There is no try.
(yoda2) Train yourself to let go of everything you fear to lose.
(yoda3) Fear is the path to the dark side.
(yoda4) In a dark place we find ourselves, and a little more knowledge lights our way.
(yoda5) Truly wonderful, the mind of a child is.
(yoda6) The greatest teacher, failure is.