LoginSignup
0
0

More than 5 years have passed since last update.

わーい、すごーい

Last updated at Posted at 2017-02-10
class Friends
    let env: Env
    var message: String
    new create(env': Env) =>
        env = env'
        message = ""

    fun ref wai(): Friends =>
        message = message.add("わーい\n")
        this

    fun ref sugoi(): Friends =>
        message = message.add("すごーい\n")
        this

    fun ref tanoshii(): Friends =>
        message = message.add("たのしー\n")
        this

    fun ref friends(skill: String): Friends =>
        message = message.add("君は" + consume skill + "がとくいなフレンズなんだね!!")
        this

    fun string(): String =>
        message

actor Main
    new create(env: Env) =>
        env.out.print(Friends(env).wai().sugoi().tanoshii().friends("クソリプ").string())

元ネタ: http://qiita.com/t_ishida/items/bae7e62950d81f427f13

0
0
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
0
0