constants.hh 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. #ifndef CONSTANTS_HH
  2. #define CONSTANTS_HH
  3. enum Type { O, S, J, Z, L, T, I};
  4. namespace Constants
  5. {
  6. static const int BLOCK_SIZE = 40;
  7. static const int WIDTH = 10;
  8. static const int HEIGHT = 18;
  9. }
  10. static char shapes[7][4][5][5] =
  11. {
  12. {
  13. //O
  14. {
  15. {0,0,0,0,0},
  16. {0,0,0,0,0},
  17. {0,0,1,1,0},
  18. {0,0,1,1,0},
  19. {0,0,0,0,0}
  20. },
  21. {
  22. {0,0,0,0,0},
  23. {0,0,0,0,0},
  24. {0,0,1,1,0},
  25. {0,0,1,1,0},
  26. {0,0,0,0,0}
  27. },
  28. {
  29. {0,0,0,0,0},
  30. {0,0,0,0,0},
  31. {0,0,1,1,0},
  32. {0,0,1,1,0},
  33. {0,0,0,0,0}
  34. },
  35. {
  36. {0,0,0,0,0},
  37. {0,0,0,0,0},
  38. {0,0,1,1,0},
  39. {0,0,1,1,0},
  40. {0,0,0,0,0}
  41. },
  42. },
  43. {
  44. //S
  45. {
  46. {0,0,0,0,0},
  47. {0,0,2,2,0},
  48. {0,2,2,0,0},
  49. {0,0,0,0,0},
  50. {0,0,0,0,0}
  51. },
  52. {
  53. {0,0,0,0,0},
  54. {0,0,2,0,0},
  55. {0,0,2,2,0},
  56. {0,0,0,2,0},
  57. {0,0,0,0,0}
  58. },
  59. {
  60. {0,0,0,0,0},
  61. {0,0,0,0,0},
  62. {0,0,2,2,0},
  63. {0,2,2,0,0},
  64. {0,0,0,0,0}
  65. },
  66. {
  67. {0,0,0,0,0},
  68. {0,2,0,0,0},
  69. {0,2,2,0,0},
  70. {0,0,2,0,0},
  71. {0,0,0,0,0}
  72. },
  73. },
  74. {
  75. //J
  76. {
  77. {0,0,0,0,0},
  78. {0,3,0,0,0},
  79. {0,3,3,3,0},
  80. {0,0,0,0,0},
  81. {0,0,0,0,0}
  82. },
  83. {
  84. {0,0,0,0,0},
  85. {0,0,3,3,0},
  86. {0,0,3,0,0},
  87. {0,0,3,0,0},
  88. {0,0,0,0,0}
  89. },
  90. {
  91. {0,0,0,0,0},
  92. {0,0,0,0,0},
  93. {0,3,3,3,0},
  94. {0,0,0,3,0},
  95. {0,0,0,0,0}
  96. },
  97. {
  98. {0,0,0,0,0},
  99. {0,0,3,0,0},
  100. {0,0,3,0,0},
  101. {0,3,3,0,0},
  102. {0,0,0,0,0}
  103. },
  104. },
  105. {
  106. //Z
  107. {
  108. {0,0,0,0,0},
  109. {0,0,4,4,0},
  110. {0,4,4,0,0},
  111. {0,0,0,0,0},
  112. {0,0,0,0,0}
  113. },
  114. {
  115. {0,0,0,0,0},
  116. {0,0,4,0,0},
  117. {0,0,4,4,0},
  118. {0,0,0,4,0},
  119. {0,0,0,0,0}
  120. },
  121. {
  122. {0,0,0,0,0},
  123. {0,0,0,0,0},
  124. {0,0,4,4,0},
  125. {0,4,4,0,0},
  126. {0,0,0,0,0}
  127. },
  128. {
  129. {0,0,0,0,0},
  130. {0,4,0,0,0},
  131. {0,4,4,0,0},
  132. {0,0,4,0,0},
  133. {0,0,0,0,0}
  134. },
  135. },
  136. {
  137. //L
  138. {
  139. {0,0,0,0,0},
  140. {0,0,0,5,0},
  141. {0,5,5,5,0},
  142. {0,0,0,0,0},
  143. {0,0,0,0,0}
  144. },
  145. {
  146. {0,0,0,0,0},
  147. {0,0,5,0,0},
  148. {0,0,5,0,0},
  149. {0,0,5,5,0},
  150. {0,0,0,0,0}
  151. },
  152. {
  153. {0,0,0,0,0},
  154. {0,0,0,0,0},
  155. {0,5,5,5,0},
  156. {0,5,0,0,0},
  157. {0,0,0,0,0}
  158. },
  159. {
  160. {0,0,0,0,0},
  161. {0,5,5,0,0},
  162. {0,0,5,0,0},
  163. {0,0,5,0,0},
  164. {0,0,0,0,0}
  165. },
  166. },
  167. {
  168. //T
  169. {
  170. {0,0,0,0,0},
  171. {0,0,6,0,0},
  172. {0,6,6,6,0},
  173. {0,0,0,0,0},
  174. {0,0,0,0,0}
  175. },
  176. {
  177. {0,0,0,0,0},
  178. {0,0,6,0,0},
  179. {0,0,6,6,0},
  180. {0,0,6,0,0},
  181. {0,0,0,0,0}
  182. },
  183. {
  184. {0,0,0,0,0},
  185. {0,0,0,0,0},
  186. {0,6,6,6,0},
  187. {0,0,6,0,0},
  188. {0,0,0,0,0}
  189. },
  190. {
  191. {0,0,0,0,0},
  192. {0,0,6,0,0},
  193. {0,6,6,0,0},
  194. {0,0,6,0,0},
  195. {0,0,0,0,0}
  196. },
  197. },
  198. {
  199. //I
  200. {
  201. {0,0,0,0,0},
  202. {0,0,0,0,0},
  203. {0,7,7,7,7},
  204. {0,0,0,0,0},
  205. {0,0,0,0,0}
  206. },
  207. {
  208. {0,0,0,0,0},
  209. {0,0,7,0,0},
  210. {0,0,7,0,0},
  211. {0,0,7,0,0},
  212. {0,0,7,0,0}
  213. },
  214. {
  215. {0,0,0,0,0},
  216. {0,0,0,0,0},
  217. {7,7,7,7,0},
  218. {0,0,0,0,0},
  219. {0,0,0,0,0}
  220. },
  221. {
  222. {0,0,7,0,0},
  223. {0,0,7,0,0},
  224. {0,0,7,0,0},
  225. {0,0,7,0,0},
  226. {0,0,0,0,0}
  227. },
  228. },
  229. };
  230. #endif