سلام دوستان من دارم بازی فکر بکر رو مینویسم با سی شارپ اما تو مقایسه تصاویری که کاربر حدس زده با تصاویری که بطور تصادفی ایجاد شده مشکل دارم و برنامه ام جواب نمیده
کسی میتونه کمک کنه؟
ممنونم خیلی نیاز دارم
pictureBox48.BackgroundImage این تصویریه که کاربر حدس زده
pictureBox93.BackgroundImage اینم تصویری که رندوم ایجاد شده
که اگر دقیقا رنگی که کاربر حدس زده با رنگی که رندوم ایجاد شده یکی بود بعد تو پنل result اون محل سبز میشه
اینم کد
کد:
int c1=0,c2=0,c3=0,c4=0;
//{
if (pictureBox93.BackgroundImage == pictureBox48.BackgroundImage)
c1 = 1;
if (pictureBox92.BackgroundImage == pictureBox48.BackgroundImage)
c1 = 2;
if (pictureBox91.BackgroundImage == pictureBox48.BackgroundImage)
c1 = 2;
if (pictureBox90.BackgroundImage == pictureBox48.BackgroundImage)
c1 = 2;
//************
if (pictureBox93.BackgroundImage == pictureBox47.BackgroundImage)
c2 = 2;
if (pictureBox92.BackgroundImage == pictureBox47.BackgroundImage)
c2 = 1;
if (pictureBox91.BackgroundImage == pictureBox47.BackgroundImage)
c2 = 2;
if (pictureBox90.BackgroundImage == pictureBox47.BackgroundImage)
c2 = 2;
//*************
if (pictureBox93.BackgroundImage == pictureBox46.BackgroundImage)
c3 = 2;
if (pictureBox92.BackgroundImage == pictureBox46.BackgroundImage)
c3 = 2;
if (pictureBox91.BackgroundImage == pictureBox46.BackgroundImage)
c3 = 1;
if (pictureBox90.BackgroundImage == pictureBox46.BackgroundImage)
c3 = 2;
//*********
if (pictureBox93.BackgroundImage == pictureBox45.BackgroundImage)
c4 = 2;
if (pictureBox92.BackgroundImage == pictureBox45.BackgroundImage)
c4 = 2;
if (pictureBox91.BackgroundImage == pictureBox45.BackgroundImage)
c4 = 2;
if (pictureBox90.BackgroundImage == pictureBox45.BackgroundImage)
c4 = 1;
//***********
if (c1 == 1)
pictureBox52.BackgroundImage = pictureBox94.Image;
if(c2==1)
pictureBox51.BackgroundImage = pictureBox94.Image;