1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

わーい、すごーい

Last updated at Posted at 2017-02-10

たーのしー

friends.lua
Friends = {}
Friends.new = function(skill)
    local this = {}
    this.skill = skill
    this.message = ''

    this.wai = function(self)
        self.message = self.message .. "わーい\n"
        return self
    end
    this.sugoi = function(self)
        self.message = self.message .. "すごい\n"
        return self
    end
    this.tanoshii = function(self)
        self.message = self.message .. "たのしー\n"
        return self
    end
    this.friends = function(self)
        self.message = self.message .."君は" .. self.skill .. "がとくいな、フレンズなんだね!!\n"
        return self
    end
    
    return this
end

Friends = Friends.new('クソリプ')
print(Friends:wai():sugoi():tanoshii():friends().message)

元ネタ

PHP: http://qiita.com/t_ishida/items/bae7e62950d81f427f13
Scala: http://qiita.com/YukiAsu/items/d75b5e16f641c9d4bbf2
Golang: http://qiita.com/sakajunquality/items/5c4a2dc6967e584193ad
Ruby: http://qiita.com/844196/items/debc0cd1d39a6c3e32c7
Python: http://qiita.com/Nao-Y/items/f544a96cbd09b135c7e7
Bash: http://qiita.com/fk_2000/items/afd5f4ca8f5bb25011c7
Java: http://qiita.com/hanakayui0628/items/97242465693bda8cacd2
Swift: http://qiita.com/fromkk/items/0797bdf3923622073a4f

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?