Programlama | Programlama Dilleri | C Programlama Dili |C++

Anasayfa Programlama Dört At Problemi ve Simülasyonu Devam


Dört At Problemi ve Simülasyonu Devam

Parça2:


  1. void __fastcall TForm1::Image8DragDrop(TObject *Sender, TObject *Source,
  2.       int X, int Y)
  3. {
  4. if(Source==Image10 && a!=2)
  5. {  Image8->Tag=1;
  6.    Image8->Picture=Image10->Picture;
  7.    Image8->Enabled=false;
  8.    Image1->Enabled=false;
  9.    Image3->Enabled=false;
  10.    Image7->Enabled=false;
  11.    Image9->Enabled=false; a++;
  12. }
  13. if(Source==Image12 && b!=2)
  14. {  Image8->Tag=2;
  15.    Image8->Picture=Image12->Picture;
  16.    Image8->Enabled=false;
  17.    Image1->Enabled=false;
  18.    Image3->Enabled=false;
  19.    Image7->Enabled=false;
  20.    Image9->Enabled=false; b++;
  21. }
  22. if (a==2 && b==2)
  23.   BitBtn1->Enabled=true;
  24. }
  25. //---------------------------------------------------------------------------
  26. void __fastcall TForm1::BitBtn2Click(TObject *Sender)
  27. {
  28. //Bu k?s?m yeniden düzenlecek
  29. /*
  30.   if((f==1||d==1)&&z==0) Image20->Name="Image1";
  31.   if((c==1||e==1)&&z==0) Image20->Name="Image2";
  32. f=0;  // ilk tersten iki ad?ml?k
  33. a=0; // yerle?tirme kontrolü
  34. b=0; // yerle?tirme kontrolü
  35. c=0; //  ortadan tersten iki ad?ml?k
  36. d=0; // ilk ba?lama durumu
  37. e=0; // ortadan ba?lama durumu
  38. z=0;
  39. al=0;
  40. ak=0;
  41. Image1->Left=70; Image1->Top=35;  Image2->Left=185; Image2->Top=35;
  42. Image3->Left=300; Image3->Top=35; Image4->Left=70;  Image4->Top=145;
  43. Image6->Left=300; Image6->Top=145;Image7->Left=70; Image7->Top=255;
  44. Image8->Left=185; Image8->Top=255; Image9->Left=300; Image9->Top=255;
  45. Image1->Picture=Image11->Picture;
  46. Image2->Picture=Image11->Picture;
  47. Image3->Picture=Image11->Picture;
  48. Image4->Picture=Image11->Picture;
  49. Image6->Picture=Image11->Picture;
  50. Image7->Picture=Image11->Picture;
  51. Image8->Picture=Image11->Picture;
  52. Image9->Picture=Image11->Picture;
  53. Image1->Enabled=true;
  54. Image2->Enabled=true;
  55. Image3->Enabled=true;
  56. Image4->Enabled=true;
  57. Image6->Enabled=true;
  58. Image7->Enabled=true;
  59. Image8->Enabled=true;
  60. Image9->Enabled=true;
  61. BitBtn1->Enabled=false;
  62. Image1->Tag=0; Image2->Tag=0; Image3->Tag=0; Image4->Tag=0;
  63. Image6->Tag=0; Image7->Tag=0; Image8->Tag=0; Image9->Tag=0;*/
  64. }
  65. //---------------------------------------------------------------------------
  66.  
  67. void __fastcall TForm1::BitBtn1Click(TObject *Sender)
  68. {
  69. if((Image1->Tag==1&&Image3->Tag==2&&Image7->Tag==2&&Image9->Tag==1)||(Image1->Tag==2&&Image3->Tag==1&&Image7->Tag==1&&Image9->Tag==2))
  70.   {f++; Image1->Name="Image20";} // Birinci tersten 2 ad?ml?k durum
  71.   else {
  72. if(Image1->Tag==1||Image1->Tag==2)
  73.  { d++; Image1->Name="Image20";} } // birinci ba?lang?ç durumu
  74. if((Image2->Tag==2&&Image4->Tag==1&&Image6->Tag==1&&Image8->Tag==2)||(Image2->Tag==1&&Image4->Tag==2&&Image6->Tag==2&&Image8->Tag==1))
  75.   {c++; Image2->Name="Image20";}  // ortadan Tersten 2 ad?ml?k durum
  76.  else
  77.  {
  78. if (Image2->Tag==1||Image2->Tag==2)
  79.    {e++; Image2->Name="Image20";}}  // ortadan ba?lama durumu
  80.   BitBtn1->Enabled=false; BitBtn2->Enabled=false;
  81.   Timer1->Enabled=true;
  82. }
  83. //--------------------------------------------------------------------------- 
  84.  

 SONRAK? SAYFA

 

Yorumlar (0)
Sadece kayıtlı kullanıcılar yorum yazabilir!
Son Güncelleme ( Salı, 07 Ağustos 2012 23:21 )  
404 Not Found

404

Not Found

The resource requested could not be found on this server!


Proudly powered by LiteSpeed Web Server

Please be advised that LiteSpeed Technologies Inc. is not a web hosting company and, as such, has no control over content found on this site.