Skip to content

Instantly share code, notes, and snippets.

@samgrover
Created June 3, 2014 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samgrover/3f12c814440ff47eb10d to your computer and use it in GitHub Desktop.
Save samgrover/3f12c814440ff47eb10d to your computer and use it in GitHub Desktop.
Swift example code transliterated in Hindi
// 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