Advertisement
HeNrYTG50

mibebe

Dec 12th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. private: void randomizeButtons()
  2. {
  3. int x[] = {142, 49, 142, 49};
  4. int y[] = {128, 128, 83, 83};
  5. int cont = 1, a, b, c, d, e;
  6. while (cont < 5)
  7. {
  8. c = randomButton() - 1;
  9. a = x[c];
  10. b = y[c];
  11. d = x[cont-1];
  12. e = y[cont-1];
  13. switch (cont-1)
  14. {
  15. case 0: C4->Location = System::Drawing::Point(a, b);
  16. switch (c)
  17. {
  18. case 0: C4->Location = System::Drawing::Point(d, e);
  19. break;
  20. case 1: C3->Location = System::Drawing::Point(d, e);
  21. break;
  22. case 2: C2->Location = System::Drawing::Point(d, e);
  23. break;
  24. case 3: C1->Location = System::Drawing::Point(d, e);
  25. break;
  26. }
  27. break;
  28. case 1: C3->Location = System::Drawing::Point(a, b);
  29. switch (c)
  30. {
  31. case 0: C4->Location = System::Drawing::Point(d, e);
  32. break;
  33. case 1: C3->Location = System::Drawing::Point(d, e);
  34. break;
  35. case 2: C2->Location = System::Drawing::Point(d, e);
  36. break;
  37. case 3: C1->Location = System::Drawing::Point(d, e);
  38. break;
  39. }
  40. break;
  41. case 2: C2->Location = System::Drawing::Point(a, b);
  42. switch (c)
  43. {
  44. case 0: C4->Location = System::Drawing::Point(d, e);
  45. break;
  46. case 1: C3->Location = System::Drawing::Point(d, e);
  47. break;
  48. case 2: C2->Location = System::Drawing::Point(d, e);
  49. break;
  50. case 3: C1->Location = System::Drawing::Point(d, e);
  51. break;
  52. }
  53. break;
  54. case 3: C1->Location = System::Drawing::Point(a, b);
  55. switch (c)
  56. {
  57. case 0: C4->Location = System::Drawing::Point(d, e);
  58. break;
  59. case 1: C3->Location = System::Drawing::Point(d, e);
  60. break;
  61. case 2: C2->Location = System::Drawing::Point(d, e);
  62. break;
  63. case 3: C1->Location = System::Drawing::Point(d, e);
  64. break;
  65. }
  66. break;
  67. }
  68. cont++;
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement