Created
January 24, 2018 06:51
-
-
Save kashfifahim/b6a231a8427aab3969eb2baba11e9cfc 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
// our method is called startNewRound and it does not take any parameters | |
func startNewRound( ) { | |
targetValue = 1 + Int(arc4random_uniform(100)) | |
// This generates a new random number between 1 and 100 | |
currentValue = 50 | |
slider.value = Float(currentValue) | |
// So when a new round starts, the slider and the currentValue | |
// are both reset to 50 or the middle of the slider | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment