LoginSignup
0

More than 5 years have passed since last update.

ズンドコキヨシ with Swift

Last updated at Posted at 2016-03-16

変数(var)は使用しない縛りで


import Foundation

let zundoko = ["ズン", "ドコ"]
let ex = ["ズン", "ズン", "ズン", "ズン", "ドコ"]

func zunzunzundoko(list: [String])
{
    if list == ex {
        print("キ・ヨ・シ!")
        return
    }

    let t = zundoko[Int(arc4random_uniform(2))]
    print(t)

    zunzunzundoko(list[1...4] + [t])
}

zunzunzundoko(["", "", "", "", ""])

普通?

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