Skip to content

Instantly share code, notes, and snippets.

@sandinist
Created April 5, 2016 06:51
Show Gist options
  • Save sandinist/6f346c400dc00e4f77e575a5be9ac6f4 to your computer and use it in GitHub Desktop.
Save sandinist/6f346c400dc00e4f77e575a5be9ac6f4 to your computer and use it in GitHub Desktop.
ZundokoSwift
import UIKit
var a = UInt32.max
while a&0x1f != 1{
a = (a<<1)|arc4random_uniform(2)
print(a&1==1 ?"ズン":"ドコ")
}
print("キ・ヨ・シ!")
var b = Array<Int>()
while(b.suffix(5) != [0,0,0,0,1]){
b.append((Int)(arc4random_uniform(2)))
print(["ズン", "ドコ"][b.last!])
}
print("キ・ヨ・シ!")
@sandinist
Copy link
Author

1行で

import UIKit;var a = UInt32.max;while a&0x1f != 1{a = (a<<1)|arc4random_uniform(2);print(a&1==1 ?"ズン":"ドコ")};print("キ・ヨ・シ!")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment