Advertisement
Guest User

Untitled

a guest
Jul 21st, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.36 KB | None | 0 0
  1. typealias Chessman = Dictionary<String, (alpha: Character, num: Int)?>
  2.  
  3. var chessmans: Chessman = ["King"       : ("d", 4),
  4.                            "Bishop"     : ("e", 5),
  5.                            "Pawn"       : nil]
  6.  
  7. if let figure = chessmans["King"] {
  8.     print("Figure is alive on \(figure.0) \(figure.1)")
  9. } else {
  10.     print("Figure is dead")
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement