Advertisement
Guest User

code

a guest
Mar 12th, 2025
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.95 KB | None | 0 0
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6. Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  7. Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.Imaging.pngimage,
  8. Vcl.StdCtrls;
  9.  
  10. type
  11. TForm1 = class(TForm)
  12. Spielbrett: TImage;
  13. Button1: TButton;
  14. Label1: TLabel;
  15. Label2: TLabel;
  16. Button2: TButton;
  17. G1: TImage;
  18. G2: TImage;
  19. G3: TImage;
  20. G4: TImage;
  21. G13: TImage;
  22. G5: TImage;
  23. G6: TImage;
  24. G7: TImage;
  25. G8: TImage;
  26. G9: TImage;
  27. G10: TImage;
  28. G11: TImage;
  29. G12: TImage;
  30. G15: TImage;
  31. G14: TImage;
  32. G16: TImage;
  33. G17: TImage;
  34. G19: TImage;
  35. G18: TImage;
  36. G20: TImage;
  37. G21: TImage;
  38. G22: TImage;
  39. G23: TImage;
  40. G24: TImage;
  41. G25: TImage;
  42. G26: TImage;
  43. G27: TImage;
  44. G28: TImage;
  45. G29: TImage;
  46. G30: TImage;
  47. G51: TImage;
  48. G52: TImage;
  49. G54: TImage;
  50. G53: TImage;
  51. G47: TImage;
  52. G48: TImage;
  53. G31: TImage;
  54. G32: TImage;
  55. G33: TImage;
  56. G34: TImage;
  57. G38: TImage;
  58. G37: TImage;
  59. G36: TImage;
  60. G35: TImage;
  61. G42: TImage;
  62. G41: TImage;
  63. G40: TImage;
  64. G39: TImage;
  65. G50: TImage;
  66. G49: TImage;
  67. G46: TImage;
  68. G45: TImage;
  69. G44: TImage;
  70. G43: TImage;
  71. Image1: TImage;
  72. Button3: TButton;
  73. Image2: TImage;
  74. Image3: TImage;
  75. Image4: TImage;
  76. Label3: TLabel;
  77. procedure FormCreate(Sender: TObject);
  78. procedure Button1Click(Sender: TObject);
  79. procedure Button2Click(Sender: TObject);
  80. procedure G1Click(Sender: TObject);
  81. procedure G2Click(Sender: TObject);
  82. procedure G3Click(Sender: TObject);
  83. procedure G4Click(Sender: TObject);
  84. procedure G5Click(Sender: TObject);
  85. procedure G6Click(Sender: TObject);
  86. procedure G7Click(Sender: TObject);
  87. procedure G8Click(Sender: TObject);
  88. procedure G9Click(Sender: TObject);
  89. procedure G10Click(Sender: TObject);
  90. procedure G11Click(Sender: TObject);
  91. procedure G12Click(Sender: TObject);
  92. procedure G13Click(Sender: TObject);
  93. procedure G14Click(Sender: TObject);
  94. procedure G15Click(Sender: TObject);
  95. procedure G16Click(Sender: TObject);
  96. procedure G17Click(Sender: TObject);
  97. procedure G18Click(Sender: TObject);
  98. procedure G19Click(Sender: TObject);
  99. procedure G20Click(Sender: TObject);
  100. procedure G21Click(Sender: TObject);
  101. procedure G22Click(Sender: TObject);
  102. procedure G23Click(Sender: TObject);
  103. procedure G24Click(Sender: TObject);
  104. procedure G25Click(Sender: TObject);
  105. procedure G26Click(Sender: TObject);
  106. procedure G27Click(Sender: TObject);
  107. procedure G28Click(Sender: TObject);
  108. procedure G29Click(Sender: TObject);
  109. procedure G30Click(Sender: TObject);
  110. procedure G31Click(Sender: TObject);
  111. procedure G32Click(Sender: TObject);
  112. procedure G33Click(Sender: TObject);
  113. procedure G34Click(Sender: TObject);
  114. procedure G35Click(Sender: TObject);
  115. procedure G36Click(Sender: TObject);
  116. procedure G37Click(Sender: TObject);
  117. procedure G38Click(Sender: TObject);
  118. procedure G39Click(Sender: TObject);
  119. procedure G40Click(Sender: TObject);
  120. procedure G41Click(Sender: TObject);
  121. procedure G42Click(Sender: TObject);
  122. procedure G43Click(Sender: TObject);
  123. procedure G44Click(Sender: TObject);
  124. procedure G46Click(Sender: TObject);
  125. procedure G45Click(Sender: TObject);
  126. procedure G51Click(Sender: TObject);
  127. procedure G52Click(Sender: TObject);
  128. procedure G54Click(Sender: TObject);
  129. procedure G53Click(Sender: TObject);
  130. procedure G47Click(Sender: TObject);
  131. procedure G50Click(Sender: TObject);
  132. procedure G49Click(Sender: TObject);
  133. procedure G48Click(Sender: TObject);
  134. private
  135. { Private-Deklarationen }
  136. public
  137. { Public-Deklarationen }
  138. end;
  139.  
  140. var
  141. Form1: TForm1;
  142. feld :array[1..54] of integer;
  143. wuerfel,ergebnis, gergebnis :integer;
  144. markiert :integer;
  145. markiertesfeld :integer;
  146.  
  147. implementation
  148.  
  149. {$R *.dfm}
  150.  
  151. procedure zeichne;
  152. begin
  153. if feld[1]=0 then form1.g1.canvas.draw(0,0,form1.image4.picture.bitmap);
  154. if feld[1]=1 then form1.g1.canvas.draw(0,0,form1.image1.picture.bitmap);
  155. if feld[1]=2 then form1.g1.canvas.draw(0,0,form1.image2.picture.bitmap);
  156. if feld[1]=3 then form1.g1.canvas.draw(0,0,form1.image3.picture.bitmap);
  157.  
  158. if feld[46]=0 then form1.g46.canvas.draw(0,0,form1.image4.picture.bitmap);
  159. if feld[46]=1 then form1.g46.canvas.draw(0,0,form1.image1.picture.bitmap);
  160. if feld[46]=2 then form1.g46.canvas.draw(0,0,form1.image2.picture.bitmap);
  161. if feld[46]=3 then form1.g46.canvas.draw(0,0,form1.image3.picture.bitmap);
  162. if feld[2]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  163. if feld[2]=1 then form1.g1.picture:=form1.image1.picture;
  164. // if feld[2]=2 then form1.g1.picture:=form1.image1.picture;
  165. // if feld[2]=3 then form1.g1.picture:=form1.image1.picture;
  166. if feld[3]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  167. if feld[3]=1 then form1.g1.picture:=form1.image1.picture;
  168. // if feld[3]=2 then form1.g1.picture:=form1.image1.picture;
  169. // if feld[3]=3 then form1.g1.picture:=form1.image1.picture;
  170. if feld[4]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  171. if feld[4]=1 then form1.g1.picture:=form1.image1.picture;
  172. // if feld[4]=2 then form1.g1.picture:=form1.image1.picture;
  173. // if feld[4]=3 then form1.g1.picture:=form1.image1.picture;
  174. if feld[5]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  175. if feld[5]=1 then form1.g1.picture:=form1.image1.picture;
  176. // if feld[5]=2 then form1.g1.picture:=form1.image1.picture;
  177. // if feld[5]=3 then form1.g1.picture:=form1.image1.picture;
  178. if feld[6]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  179. if feld[6]=1 then form1.g1.picture:=form1.image1.picture;
  180. // if feld[6]=2 then form1.g1.picture:=form1.image1.picture;
  181. // if feld[6]=3 then form1.g1.picture:=form1.image1.picture;
  182. if feld[7]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  183. if feld[7]=1 then form1.g1.picture:=form1.image1.picture;
  184. // if feld[7]=2 then form1.g1.picture:=form1.image1.picture;
  185. // if feld[7]=3 then form1.g1.picture:=form1.image1.picture;
  186. if feld[8]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  187. if feld[8]=1 then form1.g1.picture:=form1.image1.picture;
  188. // if feld[8]=2 then form1.g1.picture:=form1.image1.picture;
  189. // if feld[8]=3 then form1.g1.picture:=form1.image1.picture;
  190. if feld[9]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  191. if feld[9]=1 then form1.g1.picture:=form1.image1.picture;
  192. // if feld[9]=2 then form1.g1.picture:=form1.image1.picture;
  193. // if feld[9]=3 then form1.g1.picture:=form1.image1.picture;
  194. if feld[10]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  195. if feld[10]=1 then form1.g1.picture:=form1.image1.picture;
  196. // if feld[10]=2 then form1.g1.picture:=form1.image1.picture;
  197. // if feld[10]=3 then form1.g1.picture:=form1.image1.picture;
  198. if feld[11]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  199. if feld[11]=1 then form1.g1.picture:=form1.image1.picture;
  200. // if feld[11]=2 then form1.g1.picture:=form1.image1.picture;
  201. // if feld[11]=3 then form1.g1.picture:=form1.image1.picture;
  202. if feld[12]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  203. if feld[12]=1 then form1.g1.picture:=form1.image1.picture;
  204. // if feld[12]=2 then form1.g1.picture:=form1.image1.picture;
  205. // if feld[12]=3 then form1.g1.picture:=form1.image1.picture;
  206. if feld[13]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  207. if feld[13]=1 then form1.g1.picture:=form1.image1.picture;
  208. // if feld[13]=2 then form1.g1.picture:=form1.image1.picture;
  209. // if feld[13]=3 then form1.g1.picture:=form1.image1.picture;
  210. if feld[14]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  211. if feld[14]=1 then form1.g1.picture:=form1.image1.picture;
  212. // if feld[14]=2 then form1.g1.picture:=form1.image1.picture;
  213. // if feld[14]=3 then form1.g1.picture:=form1.image1.picture;
  214. if feld[15]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  215. if feld[15]=1 then form1.g1.picture:=form1.image1.picture;
  216. // if feld[15]=2 then form1.g1.picture:=form1.image1.picture;
  217. // if feld[15]=3 then form1.g1.picture:=form1.image1.picture;
  218. if feld[16]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  219. if feld[16]=1 then form1.g1.picture:=form1.image1.picture;
  220. // if feld[16]=2 then form1.g1.picture:=form1.image1.picture;
  221. // if feld[16]=3 then form1.g1.picture:=form1.image1.picture;
  222. if feld[17]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  223. if feld[17]=1 then form1.g1.picture:=form1.image1.picture;
  224. // if feld[17]=2 then form1.g1.picture:=form1.image1.picture;
  225. // if feld[17]=3 then form1.g1.picture:=form1.image1.picture;
  226. if feld[18]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  227. if feld[18]=1 then form1.g1.picture:=form1.image1.picture;
  228. // if feld[18]=2 then form1.g1.picture:=form1.image1.picture;
  229. // if feld[18]=3 then form1.g1.picture:=form1.image1.picture;
  230. if feld[19]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  231. if feld[19]=1 then form1.g1.picture:=form1.image1.picture;
  232. // if feld[19]=2 then form1.g1.picture:=form1.image1.picture;
  233. // if feld[19]=3 then form1.g1.picture:=form1.image1.picture;
  234. if feld[20]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  235. if feld[20]=1 then form1.g1.picture:=form1.image1.picture;
  236. // if feld[20]=2 then form1.g1.picture:=form1.image1.picture;
  237. // if feld[20]=3 then form1.g1.picture:=form1.image1.picture;
  238. if feld[21]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  239. if feld[21]=1 then form1.g1.picture:=form1.image1.picture;
  240. // if feld[21]=2 then form1.g1.picture:=form1.image1.picture;
  241. // if feld[21]=3 then form1.g1.picture:=form1.image1.picture;
  242. if feld[22]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  243. if feld[22]=1 then form1.g1.picture:=form1.image1.picture;
  244. // if feld[22]=2 then form1.g1.picture:=form1.image1.picture;
  245. // if feld[22]=3 then form1.g1.picture:=form1.image1.picture;
  246. if feld[23]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  247. if feld[23]=1 then form1.g1.picture:=form1.image1.picture;
  248. // if feld[23]=2 then form1.g1.picture:=form1.image1.picture;
  249. // if feld[23]=3 then form1.g1.picture:=form1.image1.picture;
  250. if feld[24]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  251. if feld[24]=1 then form1.g1.picture:=form1.image1.picture;
  252. // if feld[24]=2 then form1.g1.picture:=form1.image1.picture;
  253. // if feld[24]=3 then form1.g1.picture:=form1.image1.picture;
  254. if feld[25]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  255. if feld[25]=1 then form1.g1.picture:=form1.image1.picture;
  256. // if feld[25]=2 then form1.g1.picture:=form1.image1.picture;
  257. // if feld[25]=3 then form1.g1.picture:=form1.image1.picture;
  258. if feld[26]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  259. if feld[26]=1 then form1.g1.picture:=form1.image1.picture;
  260. // if feld[26]=2 then form1.g1.picture:=form1.image1.picture;
  261. // if feld[26]=3 then form1.g1.picture:=form1.image1.picture;
  262. if feld[27]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  263. if feld[27]=1 then form1.g1.picture:=form1.image1.picture;
  264. // if feld[27]=2 then form1.g1.picture:=form1.image1.picture;
  265. // if feld[27]=3 then form1.g1.picture:=form1.image1.picture;
  266. if feld[28]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  267. if feld[28]=1 then form1.g1.picture:=form1.image1.picture;
  268. // if feld[28]=2 then form1.g1.picture:=form1.image1.picture;
  269. // if feld[28]=3 then form1.g1.picture:=form1.image1.picture;
  270. if feld[29]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  271. if feld[29]=1 then form1.g1.picture:=form1.image1.picture;
  272. // if feld[29]=2 then form1.g1.picture:=form1.image1.picture;
  273. // if feld[29]=3 then form1.g1.picture:=form1.image1.picture;
  274. if feld[30]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  275. if feld[30]=1 then form1.g1.picture:=form1.image1.picture;
  276. // if feld[30]=2 then form1.g1.picture:=form1.image1.picture;
  277. // if feld[30]=3 then form1.g1.picture:=form1.image1.picture;
  278. if feld[31]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  279. if feld[31]=1 then form1.g1.picture:=form1.image1.picture;
  280. // if feld[31]=2 then form1.g1.picture:=form1.image1.picture;
  281. // if feld[31]=3 then form1.g1.picture:=form1.image1.picture;
  282. if feld[32]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  283. if feld[32]=1 then form1.g1.picture:=form1.image1.picture;
  284. // if feld[32]=2 then form1.g1.picture:=form1.image1.picture;
  285. // if feld[32]=3 then form1.g1.picture:=form1.image1.picture;
  286. if feld[33]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  287. if feld[33]=1 then form1.g1.picture:=form1.image1.picture;
  288. // if feld[33]=2 then form1.g1.picture:=form1.image1.picture;
  289. // if feld[33]=3 then form1.g1.picture:=form1.image1.picture;
  290. if feld[34]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  291. if feld[34]=1 then form1.g1.picture:=form1.image1.picture;
  292. // if feld[34]=2 then form1.g1.picture:=form1.image1.picture;
  293. // if feld[34]=3 then form1.g1.picture:=form1.image1.picture;
  294. if feld[35]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  295. if feld[35]=1 then form1.g1.picture:=form1.image1.picture;
  296. // if feld[35]=2 then form1.g1.picture:=form1.image1.picture;
  297. // if feld[35]=3 then form1.g1.picture:=form1.image1.picture;
  298. if feld[36]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  299. if feld[36]=1 then form1.g1.picture:=form1.image1.picture;
  300. // if feld[36]=2 then form1.g1.picture:=form1.image1.picture;
  301. // if feld[36]=3 then form1.g1.picture:=form1.image1.picture;
  302. if feld[37]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  303. if feld[37]=1 then form1.g1.picture:=form1.image1.picture;
  304. // if feld[37]=2 then form1.g1.picture:=form1.image1.picture;
  305. // if feld[37]=3 then form1.g1.picture:=form1.image1.picture;
  306. if feld[38]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  307. if feld[38]=1 then form1.g1.picture:=form1.image1.picture;
  308. // if feld[38]=2 then form1.g1.picture:=form1.image1.picture;
  309. // if feld[38]=3 then form1.g1.picture:=form1.image1.picture;
  310. if feld[39]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  311. if feld[39]=1 then form1.g1.picture:=form1.image1.picture;
  312. // if feld[39]=2 then form1.g1.picture:=form1.image1.picture;
  313. // if feld[39]=3 then form1.g1.picture:=form1.image1.picture;
  314. if feld[40]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  315. if feld[40]=1 then form1.g1.picture:=form1.image1.picture;
  316. // if feld[40]=2 then form1.g1.picture:=form1.image1.picture;
  317. // if feld[40]=3 then form1.g1.picture:=form1.image1.picture;
  318. if feld[41]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  319. if feld[41]=1 then form1.g1.picture:=form1.image1.picture;
  320. // if feld[41]=2 then form1.g1.picture:=form1.image1.picture;
  321. // if feld[41]=3 then form1.g1.picture:=form1.image1.picture;
  322. if feld[42]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  323. if feld[42]=1 then form1.g1.picture:=form1.image1.picture;
  324. // if feld[42]=2 then form1.g1.picture:=form1.image1.picture;
  325. // if feld[42]=3 then form1.g1.picture:=form1.image1.picture;
  326. if feld[43]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  327. if feld[43]=1 then form1.g1.picture:=form1.image1.picture;
  328. // if feld[43]=2 then form1.g1.picture:=form1.image1.picture;
  329. // if feld[43]=3 then form1.g1.picture:=form1.image1.picture;
  330. if feld[44]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  331. if feld[44]=1 then form1.g1.picture:=form1.image1.picture;
  332. // if feld[44]=2 then form1.g1.picture:=form1.image1.picture;
  333. // if feld[44]=3 then form1.g1.picture:=form1.image1.picture;
  334. if feld[45]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  335. if feld[45]=1 then form1.g1.picture:=form1.image1.picture;
  336. // if feld[45]=2 then form1.g1.picture:=form1.image1.picture;
  337. // if feld[45]=3 then form1.g1.picture:=form1.image1.picture;
  338. if feld[46]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  339. if feld[46]=1 then form1.g1.picture:=form1.image1.picture;
  340. // if feld[46]=2 then form1.g1.picture:=form1.image1.picture;
  341. // if feld[46]=3 then form1.g1.picture:=form1.image1.picture;
  342. if feld[47]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  343. if feld[47]=1 then form1.g1.picture:=form1.image1.picture;
  344. // if feld[47]=2 then form1.g1.picture:=form1.image1.picture;
  345. // if feld[47]=3 then form1.g1.picture:=form1.image1.picture;
  346. if feld[48]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  347. if feld[48]=1 then form1.g1.picture:=form1.image1.picture;
  348. // if feld[48]=2 then form1.g1.picture:=form1.image1.picture;
  349. // if feld[48]=3 then form1.g1.picture:=form1.image1.picture;
  350. if feld[49]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  351. if feld[49]=1 then form1.g1.picture:=form1.image1.picture;
  352. // if feld[49]=2 then form1.g1.picture:=form1.image1.picture;
  353. // if feld[49]=3 then form1.g1.picture:=form1.image1.picture;
  354. if feld[50]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  355. if feld[50]=1 then form1.g1.picture:=form1.image1.picture;
  356. // if feld[50]=2 then form1.g1.picture:=form1.image1.picture;
  357. // if feld[50]=3 then form1.g1.picture:=form1.image1.picture;
  358. if feld[51]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  359. if feld[51]=1 then form1.g1.picture:=form1.image1.picture;
  360. // if feld[51]=2 then form1.g1.picture:=form1.image1.picture;
  361. // if feld[51]=3 then form1.g1.picture:=form1.image1.picture;
  362. if feld[52]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  363. if feld[52]=1 then form1.g1.picture:=form1.image1.picture;
  364. // if feld[52]=2 then form1.g1.picture:=form1.image1.picture;
  365. // if feld[52]=3 then form1.g1.picture:=form1.image1.picture;
  366. if feld[53]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  367. if feld[53]=1 then form1.g1.picture:=form1.image1.picture;
  368. // if feld[53]=2 then form1.g1.picture:=form1.image1.picture;
  369. // if feld[53]=3 then form1.g1.picture:=form1.image1.picture;
  370. if feld[54]=0 then form1.g1.picture.bitmap:=form1.image4.picture.bitmap;
  371. if feld[54]=1 then form1.g1.picture:=form1.image1.picture;
  372. // if feld[54]=2 then form1.g1.picture:=form1.image1.picture;
  373. // if feld[54]=3 then form1.g1.picture:=form1.image1.picture;
  374. end;
  375.  
  376. procedure klick(platz :integer);
  377. begin
  378. if markiert=0 then
  379. begin
  380. markiert:=feld[platz];
  381. if markiert<>0 then markiertesfeld:=platz;
  382. end
  383. else
  384. begin
  385. feld[platz]:=markiert;
  386. feld[markiertesfeld]:=0;
  387. form1.label3.caption:='neuer Platz: '+inttostr(platz)+', alter Platz: '+inttostr(markiertesfeld)+', Fiugur: '+inttostr(markiert);
  388. markiert:=0;
  389. markiertesfeld:=0;
  390.  
  391. zeichne;
  392.  
  393. end;
  394. end;
  395.  
  396. procedure neuesspiel;
  397. var i :integer;
  398. begin
  399. for i:=1 to 43 do feld[i]:=0;
  400. feld[44]:=1;
  401. feld[45]:=1;
  402. feld[46]:=1;
  403. feld[47]:=1;
  404. feld[48]:=2;
  405. feld[49]:=2;
  406. feld[49]:=2;
  407. feld[50]:=2;
  408. feld[51]:=3;
  409. feld[52]:=3;
  410. feld[53]:=3;
  411. feld[54]:=3;
  412.  
  413.  
  414. end;
  415.  
  416. procedure TForm1.Button1Click(Sender: TObject);
  417. begin
  418. ergebnis:=random(6)+1;
  419. label1.caption:= inttostr(ergebnis);
  420.  
  421. end;
  422.  
  423. procedure TForm1.Button2Click(Sender: TObject);
  424. var
  425. gwuerfel :integer;
  426. begin
  427. gwuerfel:=random(100)+1;
  428. if gwuerfel<=5 then gergebnis:=10;
  429. if (gwuerfel>=6) and (gwuerfel<=10) then gergebnis:=9;
  430. if (gwuerfel>=11) and (gwuerfel<=15) then gergebnis:=8;
  431. if (gwuerfel>=16) and (gwuerfel<=25) then gergebnis:=7;
  432. if (gwuerfel>=26) and (gwuerfel<=45) then gergebnis:=-6;
  433. if (gwuerfel>=46) and (gwuerfel<=55) then gergebnis:=-5;
  434. if (gwuerfel>=56) and (gwuerfel<=65) then gergebnis:=-4;
  435. if (gwuerfel>=66) and (gwuerfel<=75) then gergebnis:=-3;
  436. if (gwuerfel>=76) and (gwuerfel<=80) then gergebnis:=-2;
  437. if (gwuerfel>=81) and (gwuerfel<=100) then gergebnis:=-1;
  438. label2.caption:= inttostr (gergebnis);
  439.  
  440. end;
  441.  
  442. procedure TForm1.FormCreate(Sender: TObject);
  443. begin
  444. randomize;
  445. neuesspiel;
  446. end;
  447.  
  448.  
  449. procedure TForm1.G1Click(Sender: TObject);
  450. begin
  451. form1.label3.caption:='Klick auf G1.';
  452. klick(1);
  453. end;
  454.  
  455.  
  456. procedure TForm1.G2Click(Sender: TObject);
  457. begin
  458. klick(2);
  459. end;
  460.  
  461.  
  462.  
  463. procedure TForm1.G3Click(Sender: TObject);
  464. begin
  465. klick(3);
  466. end;
  467.  
  468.  
  469.  
  470. procedure TForm1.G4Click(Sender: TObject);
  471. begin
  472. klick(4);
  473. end;
  474.  
  475.  
  476.  
  477. procedure TForm1.G5Click(Sender: TObject);
  478. begin
  479. klick(5);
  480. end;
  481.  
  482. procedure TForm1.G6Click(Sender: TObject);
  483. begin
  484. klick(6);
  485. end;
  486.  
  487. procedure TForm1.G7Click(Sender: TObject);
  488. begin
  489. klick(7);
  490. end;
  491.  
  492. procedure TForm1.G8Click(Sender: TObject);
  493. begin
  494. klick(8);
  495. end;
  496.  
  497. procedure TForm1.G9Click(Sender: TObject);
  498. begin
  499. klick(9);
  500. end;
  501.  
  502. procedure TForm1.G10Click(Sender: TObject);
  503. begin
  504. klick(10);
  505.  
  506. end;
  507. procedure TForm1.G11Click(Sender: TObject);
  508. begin
  509. klick(11);
  510. end;
  511.  
  512. procedure TForm1.G12Click(Sender: TObject);
  513. begin
  514. klick(12);
  515. end;
  516.  
  517. procedure TForm1.G13Click(Sender: TObject);
  518. begin
  519. klick(13);
  520. end;
  521.  
  522. procedure TForm1.G14Click(Sender: TObject);
  523. begin
  524. klick(14);
  525. end;
  526.  
  527. procedure TForm1.G15Click(Sender: TObject);
  528. begin
  529. klick(15);
  530. end;
  531.  
  532. procedure TForm1.G16Click(Sender: TObject);
  533. begin
  534. klick(16);
  535. end;
  536.  
  537. procedure TForm1.G17Click(Sender: TObject);
  538. begin
  539. klick(17);
  540. end;
  541.  
  542. procedure TForm1.G18Click(Sender: TObject);
  543. begin
  544. klick(18);
  545. end;
  546.  
  547. procedure TForm1.G19Click(Sender: TObject);
  548. begin
  549. klick(19);
  550. end;
  551.  
  552. procedure TForm1.G20Click(Sender: TObject);
  553. begin
  554. klick(20);
  555. end;
  556.  
  557. procedure TForm1.G21Click(Sender: TObject);
  558. begin
  559. klick(21);
  560. end;
  561.  
  562. procedure TForm1.G22Click(Sender: TObject);
  563. begin
  564. klick(22);
  565. end;
  566.  
  567. procedure TForm1.G23Click(Sender: TObject);
  568. begin
  569. klick(23);
  570. end;
  571.  
  572. procedure TForm1.G24Click(Sender: TObject);
  573. begin
  574. klick(24);
  575. end;
  576.  
  577. procedure TForm1.G25Click(Sender: TObject);
  578. begin
  579. klick(25);
  580. end;
  581.  
  582. procedure TForm1.G26Click(Sender: TObject);
  583. begin
  584. klick(26);
  585. end;
  586.  
  587. procedure TForm1.G27Click(Sender: TObject);
  588. begin
  589. klick(27);
  590. end;
  591.  
  592. procedure TForm1.G28Click(Sender: TObject);
  593. begin
  594. klick(28);
  595. end;
  596.  
  597. procedure TForm1.G29Click(Sender: TObject);
  598. begin
  599. klick(29);
  600. end;
  601.  
  602. procedure TForm1.G30Click(Sender: TObject);
  603. begin
  604. klick(30);
  605. end;
  606.  
  607. procedure TForm1.G31Click(Sender: TObject);
  608. begin
  609. klick(31);
  610. end;
  611.  
  612. procedure TForm1.G32Click(Sender: TObject);
  613. begin
  614. klick(32);
  615. end;
  616.  
  617. procedure TForm1.G33Click(Sender: TObject);
  618. begin
  619. klick(33);
  620. end;
  621.  
  622. procedure TForm1.G34Click(Sender: TObject);
  623. begin
  624. klick(34);
  625. end;
  626.  
  627. procedure TForm1.G35Click(Sender: TObject);
  628. begin
  629. klick(35);
  630. end;
  631.  
  632. procedure TForm1.G36Click(Sender: TObject);
  633. begin
  634. klick(36);
  635. end;
  636.  
  637. procedure TForm1.G37Click(Sender: TObject);
  638. begin
  639. klick(37);
  640. end;
  641.  
  642. procedure TForm1.G38Click(Sender: TObject);
  643. begin
  644. klick(38);
  645. end;
  646.  
  647. procedure TForm1.G39Click(Sender: TObject);
  648. begin
  649. klick(39);
  650. end;
  651.  
  652. procedure TForm1.G40Click(Sender: TObject);
  653. begin
  654. klick(40);
  655. end;
  656.  
  657. procedure TForm1.G41Click(Sender: TObject);
  658. begin
  659. klick(41);
  660. end;
  661.  
  662. procedure TForm1.G42Click(Sender: TObject);
  663. begin
  664. klick(42);
  665. end;
  666.  
  667. procedure TForm1.G43Click(Sender: TObject);
  668. begin
  669. klick(43);
  670. end;
  671.  
  672. procedure TForm1.G44Click(Sender: TObject);
  673. begin
  674. klick(44);
  675. end;
  676.  
  677. procedure TForm1.G45Click(Sender: TObject);
  678. begin
  679. klick(45);
  680. end;
  681.  
  682. procedure TForm1.G46Click(Sender: TObject);
  683. begin
  684. form1.label3.caption:='Klick auf G46.';
  685. klick(46);
  686. end;
  687.  
  688. procedure TForm1.G47Click(Sender: TObject);
  689. begin
  690. klick(47);
  691. end;
  692.  
  693. procedure TForm1.G48Click(Sender: TObject);
  694. begin
  695. klick(48);
  696. end;
  697.  
  698. procedure TForm1.G49Click(Sender: TObject);
  699. begin
  700. klick(49);
  701. end;
  702.  
  703. procedure TForm1.G50Click(Sender: TObject);
  704. begin
  705. klick(50);
  706. end;
  707.  
  708. procedure TForm1.G51Click(Sender: TObject);
  709. begin
  710. klick(51);
  711. end;
  712.  
  713. procedure TForm1.G52Click(Sender: TObject);
  714. begin
  715. klick(52);
  716. end;
  717.  
  718. procedure TForm1.G53Click(Sender: TObject);
  719. begin
  720. klick(53);
  721. end;
  722.  
  723. procedure TForm1.G54Click(Sender: TObject);
  724. begin
  725. klick(54);
  726. end;
  727.  
  728. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement