Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.20 KB | None | 0 0
  1. Game Load
  2.  
  3. START
  4. IF Directory Doesnt Exist 'AppData\MatchGame'
  5. Create it
  6. ENDIF
  7.  
  8. Build Buttons
  9. Load Stats
  10.  
  11. For Every Button That Is A MatchButton
  12. Disable Them
  13. EndIF
  14. END
  15.  
  16. Build Buttons
  17.  
  18. START
  19. Fill Up DataTable with numbers from 1 - 18 twice
  20.  
  21. For Every Built Button in a 6x6 Cell
  22. Give them a number each
  23.  
  24. Do Until Proposed Value is NOT Taken THEN
  25. Use Proposed Value
  26. Loop
  27.  
  28. Actual Value = Proposed Value
  29. Proposed Value = '???'
  30. Adjust Default Settings
  31. Bring Buttons to Front
  32. Add them to control list
  33. ENDFOR
  34.  
  35. END
  36.  
  37. ______
  38.  
  39. Save Stats
  40.  
  41. START
  42. Copy Without DataGridView Header
  43. Select All Entries In DataGridView
  44. Write Them to Directory 'Appdata\MatchGame'
  45. Clear Selected Entries
  46. END
  47.  
  48. ______
  49. Load Stats
  50.  
  51. START
  52. Clear DataGridView
  53.  
  54. IF Directory Does Exist 'AppData\MatchGame'
  55. For Each Row And Column In DataGridView
  56. Add Seperated Data As Row To DataGridView
  57. ENDFOR
  58. ENDIF
  59. END
  60.  
  61. ______
  62.  
  63. Match Timer Tick
  64.  
  65. START
  66. INPUT: TimeLeft, StreakCount, Matches
  67. Subtract 100ms FROM TimeLeft
  68. Time Left Label = TimeLeft
  69.  
  70. IF TimeLeft Is EqualTo or Less Than 0 THEN
  71. For Every MatchButton In Controls
  72. Disable MatchButton
  73. Time Left Label = 'Times Up!'
  74. Stop Timer Ticking
  75.  
  76. Output: Date, Score, TimeLeft To DataGridView New Row
  77. Save Stats
  78. ENDFOR
  79.  
  80. ELSEIF TimeLeft Is Greater Than 0 THEN
  81. IF Matches Are Equal To 18
  82. Stop Timer Ticking
  83. Output Date, Score, TimeLeft to DataGridView New Row
  84. Save Stats
  85. ENDIF
  86. ENDIF
  87. END
  88.  
  89.  
  90. __________
  91. Handling Point Calculation
  92.  
  93. START
  94. INPUT: StreakStart, StreakCount, TimeLeft
  95. IF StreakStart - TimeLeft Is Greater Than 3 Then
  96. StreakCount + 1
  97. Score + 1000 * TimeLeft * 0.1 * StreakCount
  98. ELSE
  99. StreakCount = 0
  100. Score += 1000 * TimeLeft * 0.1
  101. ENDIF
  102.  
  103. Output: Matches + 1, StreakStart = TimeLeft
  104. END
  105.  
  106. __________
  107. MatchButtonClick
  108.  
  109. START
  110. IF Selected Data Is Not Nothing Then
  111. MatchButton = ActualValue
  112. Disable MatchButton
  113. MatchButton Background Color = White
  114.  
  115. IF ActualValue = DataSelected THEN
  116. Handle Point Calculation
  117.  
  118. For Each MatchButton In Controls
  119. IF MatchButton Actual Value = Selected Data THEN
  120. Disable MatchButton
  121. MatchButton SuccessfullyMatched = True
  122. MatchButton Background Color = LimeGreen
  123. MatchButton Foreground Color = White
  124. END
  125. ENDFOR
  126. ELSE
  127. Selected Data = MatchButton ActualValue
  128.  
  129. IF LastSelectedMatchButton Is NOT SuccessFullyMatched THEN
  130. Enable LastSelectedMatchButton
  131. LastSelectedMatchButton Text = '???'
  132. LastSelectedMatchButton Background Color = Default
  133. END
  134.  
  135. LastSelectedMatchButton = MatchButton
  136. END
  137. ELSE
  138. MatchButton = ActualValue
  139. MatchButton Background Color = White
  140. Selected Data = MatchButton Text
  141. LastSelectedMatchButton = MatchButton
  142. Disable LastSelectedMatchButton
  143. ENDIF
  144. END
  145.  
  146. _________________
  147. BtnStart Click
  148.  
  149. START
  150. IF NOT Already Started Once THEN
  151. Reset Data
  152. Start Timer Tick
  153. Started Once = True
  154. ELSE
  155. Restart Form
  156. END
  157. END
  158. _________________
  159. BtnPauseContinue Click
  160.  
  161. START
  162. IF Button Text = 'Pause' THEN
  163. Stop Timer Tick
  164. Button Text = 'Continue'
  165.  
  166. For Each MatchButton In Controls
  167. Disconnect MatchButton Handler
  168. ENDFOR
  169. ELSE
  170. Start Timer Tick
  171. Button Text = 'Pause'
  172.  
  173. For Each MatchButton In Controls
  174. Reconnect MatchButton Handler
  175. ENDFOR
  176. END
  177. END
  178. _________________
  179. ResetData
  180.  
  181. START
  182. INPUT: All Variables
  183.  
  184. For Each MatchButton In Controls
  185. IF MatchButton Is Matched Then
  186. MatchButton Text = '???'
  187. MatchButton Background Color = Default
  188. MatchButton Foreground Color = Default
  189. ENDIF
  190. ENDFOR
  191.  
  192. OUTPUT: All Variables To Default States
  193. END
  194. _________________
  195. BtnMinimize Click
  196.  
  197. START
  198. Game WindowState = Minimized
  199. END
  200. _________________
  201. BtnClose
  202.  
  203. START
  204. Exit Application
  205. END
  206. _________________
  207. FormHandle Mouse Down
  208.  
  209. START
  210. MoveWindow
  211. END
  212.  
  213. _________________
  214. Move Window
  215.  
  216. START
  217. IF Button Is MouseButton Left THEN
  218. Release Capture
  219. Send Message To Move Form With Handle
  220. END
  221. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement