2
0

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.

わーい、すごーい

2
Posted at

どうしてこのブームがあるかちょっとわからないけど、

とりあえず、fromkk さんの Swift バージョンを元に、中国語のバージョンをやってみました。

import Foundation

enum Friends {
    case wai
    case sugoi
    case tanoshii
    case skill(String)
    func message() -> String {
        switch self {
        case .wai:
            return "哇~"
        case .sugoi:
            return "好厲害~"
        case .tanoshii:
            return "好好玩~"
        case .skill(let skill):
            return "你\(skill)還滿厲害的、你們是朋友唄!!"
        }
    }
}

print([Friends.wai, Friends.sugoi, Friends.tanoshii, Friends.skill("Swift")].map({ $0.message() }).joined(separator: "\n"))

アウトプットはこちら

哇~
好厲害~
好好玩~
你Swift還滿厲害的、你們是朋友唄!!

元ネタ

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?