//: Playground - noun: a place where people can play
importCocoa structpoint{ varx=0; vary=init(x:Int,y:Int){ self.x= x; y= y; } varscale:Int{ get{ returnx/x; } set{ x*=newValue; y*=newValue; } }
} varpt =point(x:1,y:3); varv1 =pt.scale; pt.scale=2; varv2 =pt.scale; |