Last active
July 30, 2016 15:55
-
-
Save hoang-tran/4987fa39dd28f6eb89f4d3b52c985623 to your computer and use it in GitHub Desktop.
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
import Foundation | |
class Gun: NSObject { | |
var bullets = 0 | |
init(bullets: Int) { | |
self.bullets = bullets | |
} | |
func shoot() { | |
if self.bullets > 0 { | |
self.bullets -= 1 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment