5
5

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.

アヒルコード with Swift

Last updated at Posted at 2014-06-04

Swiftでアヒルコードはじめました。 :smiley:
元ネタからアヒルの数を増やしながらSwiftの名前空間を漂ってみました。
アヒルちゃんの数を増やす競争が楽しめそうですね。 :thumbsup:

#アヒルコード

duckTyping.swift
import Foundation

typealias 🐣🐣 = String
func 🐣🐣🐣(🐣🐣🐣🐣:🐣🐣) -> 🐣🐣 {
    var 🐣🐣🐣:🐣🐣 = 🐣🐣🐣🐣
    for 🐣 in 🐣🐣🐣🐣 {🐣🐣🐣 = 🐣🐣🐣 + 🐣}
    return 🐣🐣🐣
}
let 🐣🐣🐣🐣:🐣🐣 = 🐣🐣🐣(🐣🐣🐣("🐣🐣🐣"))
println(🐣🐣🐣(🐣🐣🐣🐣))

#実行結果

🐣🐣🐣🐣🐣🐣🐣🐣🐣🐣🐣🐣🐣🐣🐣🐣🐣🐣🐣🐣🐣🐣🐣🐣
Program ended with exit code: 0

#ref.

5
5
5

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?