Artificial Intelligence - هوش مصنوعی  
انجمن را در گوگل محبوب کنيد :

بازگشت   Artificial Intelligence - هوش مصنوعی > مقدمات هوش مصنوعی > حل مسائل معروف هوش مصنوعي


 
تبليغات سايت
Iranian Association for the Advancement of Artificial Intelligence
 
 
LinkBack ابزارهاي تاپيک نحوه نمايش
قديمي ۰۱-۲۴-۱۳۹۳, ۰۹:۳۹ قبل از ظهر   #8 (لینک دائم)
عضو جدید
 
آواتار khalas
 
تاريخ عضويت: فروردين ۱۳۹۳
پست ها: 1
تشكرها: 0
0 تشكر در 0 پست
Question

نقل قول:
نوشته اصلي بوسيله reyhane نمايش پست

كد:
#include
#include
#include
#include
#include

#define true 1
#define false 0

unsigned int a,b,c,d,e,f,g,h;
void main(void)
{
 unsigned char chk_crash(unsigned char,unsigned char,unsigned char);
 void draw_puzzle(void);
 clrscr();
 for (a=1;a<=8;a++);
  for (b=1;b<=8;b++);
   if (chk_crash(a,b,1))
     for (c=1;c<=8;c++)
      if ((chk_crash(c,b,1)) && (chk_crash(c,a,2)))
       for (d=1;d<=8;d++)
    if ((chk_crash(d,c,1)) && (chk_crash(d,b,2)) && (chk_crash(d,a,3)))
     for(e=1;e<=8;e++)
      if  ((chk_crash(e,d,1)) && (chk_crash(e,c,2)) && (chk_crash(e,b,3)) && (chk_crash(e,a,4)))
       for (f=1;f<=8;f++)
        if ((chk_crash(f,e,1)) && (chk_crash(f,d,2)) && (chk_crash(f,c,3)) && (chk_crash(f,b,4)) && (chk_crash(f,a,5)))
         for (g=1;g<=8;g++)
          if ((chk_crash(g,f,1)) && (chk_crash(g,e,2)) && (chk_crash(g,d,3)) && (chk_crash(g,c,4)) && (chk_crash(g,b,5)) && (chk_crash(g,a,6)))
           for (h=1;h<=8;h++)
        if ((chk_crash(h,g,1)) && (chk_crash(h,f,2)) && (chk_crash(h,e,3)) && (chk_crash(h,d,4)) && (chk_crash(h,c,5)) && (chk_crash(h,b,6)) && (chk_crash(h,a,7)))
        {
        draw_puzzle();
        getch();
        }
          getch();
 }
 unsigned char chk_crash(unsigned char i,unsigned char j,unsigned char d)
  {
   if ((i==j) || (abs(i-j)==d))
    return(false);
   else
    return(true);
  }
  void draw_puzzle(void)
  {
   unsigned char a1,b1,a2,b2,i,v;
   clrscr();
   for (a1=1;a1<=16;a1++)
    for (b1=18;b<=65;b1++)
     {
      gotoxy(b1,a1+d);
      a2=(a1-1)/2+1;
      b2=(b1-18)/6+1;
      if (((a2+b2)%2)==0)
       textcolor(11);
      else
       textcolor(1);
      cprintf("a\0");
      for (i=0;i<8;i++)
       {
    switch(i)
     {
      case 0:{v=a;break;}
      case 1:{v=b;break;}
      case 2:{v=c;break;}
      case 3:{v=d;break;}
      case 4:{v=e;break;}
      case 5:{v=f;break;}
      case 6:{v=g;break;}
      case 7:{v=h;break;}
     }
       gotoxy(15+6*v,5+i*2);
       cprintf("*\0");
       }
}
}






سلام
چرا برنامه اجرا نمیشه؟همش ارور میده؟
khalas آفلاين است   پاسخ با نقل قول
 

Tags
8-puzzle



كاربران در حال ديدن تاپيک: 1 (0 عضو و 1 مهمان)
 

قوانين ارسال
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is فعال
شکلکها فعال است
كد [IMG] فعال است
كدهاي HTML غير فعال است
Trackbacks are فعال
Pingbacks are فعال
Refbacks are فعال




زمان محلي شما با تنظيم GMT +3.5 هم اکنون ۰۵:۵۶ قبل از ظهر ميباشد.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.

Teach and Learn at Hexib | Sponsored by www.Syavash.com and Product In Review

استفاده از مطالب انجمن در سایر سایت ها، تنها با ذکر انجمن هوش مصنوعي به عنوان منبع و لینک مستقیم به خود مطلب مجاز است

Inactive Reminders By Icora Web Design