80的回憶【Ruby篇】

#!/usr/bin/env ruby
#
# 文件名: post80g.rb
# 描述:

#        使用Ruby語言實現80後的回憶,謹以此程序獻給中國所有的80後朋友!

#
# 生成日期: 2010年4月28日

#
# 作者: 默之

#


# 80後羣體
class Post80G
def initialize(name)
            @post80_name = name # 80後姓名
end

def set_dream_boat(name)

            @dream_boat = name  # 戀人

end

# 憶往昔,感慨系之矣。
def remind
           puts "#{@post80_name} had beautiful days with #{@dream_boat}."
           puts "But they are strangers now ..."
           puts "When we were young, we thought it's just an emotional feeling and gave it up. "
           puts "We realized that it's our whole life later."
           puts "Didn't acquainted with each other at first. Didn't admitted with each other at last."
           puts "This program is given to the Chinese Post 80's Generations !"
end
end

p = Post80G.new("GG")
p.set_dream_boat("MM")
p.remind

往事不堪回首:

曾經和你一起度過美好的時光;
然而,如今已成陌生人......

年輕時我們放棄,以爲那只是一段感情,後來才知道,那其實是一生。

最初不相識,最終不相認。

謹以此程序獻給中國所有的80後們!


ps:上述程序中的GG、MM,讀者自己去實例化。運行環境,Ruby 1.8.7 以上版本。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章