Guest User

Untitled

a guest
Dec 17th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. //VARIABLES
  2. var currentQuestion = 0
  3. var rightAnswerPlacement:UInt32 = 0
  4. var points:UInt32 = 0
  5.  
  6. //SCORE
  7.  
  8. @IBOutlet weak var score: UILabel!
  9.  
  10. //QUESTION
  11. @IBOutlet weak var lbl: UILabel!
  12.  
  13.  
  14. //BUTTON
  15. @IBAction func action(_ sender: AnyObject)
  16. {
  17. if (sender.tag == Int(rightAnswerPlacement))
  18. {
  19. print("Right")
  20. points += 1
  21. }
  22. else
  23. {
  24. print("Wrong")
  25. }
  26.  
  27. if (currentQuestion != questions.count)
  28. {
  29. newQuestion()
  30. }
  31. else
  32. {
  33. score.text = points
  34. }
  35. }
Add Comment
Please, Sign In to add comment