Created
June 3, 2014 16:59
-
-
Save samgrover/3f12c814440ff47eb10d to your computer and use it in GitHub Desktop.
Swift example code transliterated in Hindi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Playground - noun: a place where people can play | |
enum Rank: Int { | |
case Ace = 1 | |
case Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten | |
case Jack, Queen, King | |
func description() -> String { | |
switch self { | |
case .Ace: | |
return "ace" | |
case .Jack: | |
return "jack" | |
case .Queen: | |
return "queen" | |
case .King: | |
return "king" | |
default: | |
return String(self.toRaw()) | |
} | |
} | |
} | |
let ace = Rank.Ace | |
ace.description() | |
// Once more, in transliterated Hindi | |
enum रैंक: Int { | |
case ऐस = 1 | |
case ट्व, थ्री, फोर, फाइव, सिक्स, सेवन, एइघ्त, नाइन, टेन | |
case जैक, क्वीन, किंग | |
func डिस्क्रिप्शन() -> String { | |
switch self { | |
case .ऐस: | |
return "ऐस" | |
case .जैक: | |
return "जैक" | |
case .क्वीन: | |
return "क्वीन" | |
case .किंग: | |
return "किंग" | |
default: | |
return String(self.toRaw()) | |
} | |
} | |
} | |
let ऐस = रैंक.ऐस | |
ऐस.डिस्क्रिप्शन() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment