Advertisement
qwubvz

MathDungeons.swift

Jun 20th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 2.64 KB | None | 0 0
  1. // Do not touch this code.
  2. // By Ruen Khan, Shiloh Reyes and Valentina Arrubla
  3. // Questions by Shiloh Reyes and Valentina Arrubla
  4. // Code by Ruen Khan
  5.  
  6. // Do not touch this code.
  7. var pts = 0
  8. var q1 = askForDecimal("79.5 ÷ 1 =")
  9. if q1 == 79.5 {
  10.     show("Correct! +1")
  11.     pts = pts + 1
  12. } else {
  13.     show("Incorrect")
  14. }
  15. q1 = askForDecimal("79.5 ÷ 10 =")
  16. if q1 == 7.95 {
  17.     show("Correct! +1")
  18.     pts = pts + 1
  19. } else {
  20.     show("Incorrect")
  21. }
  22. q1 = askForDecimal("79.5 ÷ 100 =")
  23. if q1 == 0.795 {
  24.     show("Correct! +1")
  25.     pts = pts + 1
  26. } else {
  27.     show("Incorrect")
  28. }
  29. q1 = askForDecimal("2.4 ÷ 3 =")
  30. if q1 == 0.8 {
  31.     show("Correct! +1")
  32.     pts = pts + 1
  33. } else {
  34.     show("Incorrect")
  35. }
  36. q1 = askForDecimal("6.0 ÷ 5 =")
  37. if q1 == 1.2 {
  38.     show("Correct! +1")
  39.     pts = pts + 1
  40. } else {
  41.     show("Incorrect")
  42. }
  43. q1 = askForDecimal("17.9 ÷ 9 (estimate) =")
  44. if q1 == 2 {
  45.     show("Correct! +1")
  46.     pts = pts + 1
  47. } else {
  48.     show("Incorrect")
  49. }
  50. q1 = askForDecimal("150 ÷ 10¹ =")
  51. if q1 == 15 {
  52.     show("Correct! +1")
  53.     pts = pts + 1
  54. } else {
  55.     show("Incorrect")
  56. }
  57. q1 = askForDecimal("150 ÷ 10² =")
  58. if q1 == 1.5 {
  59.     show("Correct! +1")
  60.     pts = pts + 1
  61. } else {
  62.     show("Incorrect")
  63. }
  64. q1 = askForDecimal("150 ÷ 10³ =")
  65. if q1 == 0.15 {
  66.     show("Correct! +1")
  67.     pts = pts + 1
  68. } else {
  69.     show("Incorrect")
  70. }
  71. q1 = askForDecimal("0.40 ÷ 0.05 =")
  72. if q1 == 8 {
  73.     show("Correct! +1")
  74.     pts = pts + 1
  75. } else {
  76.     show("Incorrect")
  77. }
  78. q1 = askForDecimal("261 ÷ 6 =")
  79. if q1 == 43.5 {
  80.     show("Correct! +1")
  81.     pts = pts + 1
  82. } else {
  83.     show("Incorrect")
  84. }
  85. q1 = askForDecimal("6.51 ÷ 3 =")
  86. if q1 == 2.17 {
  87.     show("Correct! +1")
  88.     pts = pts + 1
  89. } else {
  90.     show("Incorrect")
  91. }
  92. q1 = askForDecimal("38.5 ÷ 7 =")
  93. if q1 == 5.5 {
  94.     show("Correct! +1")
  95.     pts = pts + 1
  96. } else {
  97.     show("Incorrect")
  98. }
  99. q1 = askForDecimal("12.16 ÷ 4 =")
  100. if q1 == 3.04 {
  101.     show("Correct! +1")
  102.     pts = pts + 1
  103. } else {
  104.     show("Incorrect")
  105. }
  106. q1 = askForDecimal("8.64 ÷ 4 =")
  107. if q1 == 2.16 {
  108.     show("Correct! +1")
  109.     pts = pts + 1
  110. } else {
  111.     show("Incorrect")
  112. }
  113. q1 = askForDecimal("34 ÷ 4 =")
  114. if q1 == 8.5 {
  115.     show("Correct! +1")
  116.     pts = pts + 1
  117. } else {
  118.     show("Incorrect")
  119. }
  120. // Estimate Questions
  121. q1 = askForDecimal("2.8 ÷ 6 (Estimate) =")
  122. if q1 == 4 {
  123.     show("Correct! +1")
  124.     pts = pts + 1
  125. } else {
  126.     show("Incorrect")
  127. }
  128. q1 = askForDecimal("19.7 ÷ 3 (Estimate) =")
  129. if q1 == 6 {
  130.     show("Correct! +1")
  131.     pts = pts + 1
  132. } else {
  133.     show("Incorrect")
  134. }
  135. show("Completed Game!")
  136. show(pts)
  137. show("out of 18")
  138. //#end-hidden-code
  139. // No.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement