Skip to content

Instantly share code, notes, and snippets.

@davatron5000
Forked from mattt/もじれつ.swift
Last active August 29, 2015 14:05
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davatron5000/9d2bff8e37762e2b2b67 to your computer and use it in GitHub Desktop.
Save davatron5000/9d2bff8e37762e2b2b67 to your computer and use it in GitHub Desktop.
struct もじれつ: Printable {
let description: String
init(string: String) {
var mutableString = NSMutableString(string: string) as CFMutableString
if CFStringTransform(mutableString, nil, kCFStringTransformLatinHiragana, 0) == 1 {
self.description = mutableString as NSString
} else {
self.description = string
}
}
}
extension もじれつ: StringLiteralConvertible {
_._
_.-="_- _
_.-=" _- | ||"""""""---._______ __..
___.===""""-.______-,,,,,,,,,,,,`-''----" """"" """"" __'
__.--"" __ ,' o \ __ [__|
__-""=======.--"" ""--.=================================.--"" ""--.=======:
] [w] : / \ : |========================| : / \ : [w] :
V___________:| |: |========================| :| |: _-"
V__________: \ / :_|=======================/_____: \ / :__-"
-----------' ""____"" `-------------------------------' ""____""
}
let s: もじれつ = "hiragana" // ひらがな
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment