سورس بازی پازل به زبان C
در این پست شما می توانید سورس بازی پازل را از ما دریافت کنید. پازل یا جورچین نوعی ابزار سرگرمی است که بدون شک همه ی ما بارها آن را انجام داده و لذت برده ایم. در این بازی فکری و دستی، بازیکن باید قطعات کوچک بریده شده که اغلب از جنس مقوا هستن را در کنار هم قرار دهند تا تصویر اولیه ساخته شود.
تصویر نهایی بازی پازل معمولا جالب و زیباست که شاید قبلا آن را در جایی دایده باشید. می توانیم از پازل ها به عنوان ابزار های کمک آموزشی اسفاده کنیم که صد درصد برای ذهن نیز موثر خواهد بود.
جهت مشاهده جزئیات کامل سورس بازی پازل به زبان C لطفا به ادامه مطلب مراجعه فرمائید.
تکه کد سورس بازی پازل به زبان C:
1 | <span style="color: #ff0000;"><strong>جهت دریافت کد کامل این برنامه لطفا از بخش خرید محصول اقدام کنید</strong></span> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | #include <graphics.h> #include <time.h> #include <stdlib.h> #include <conio.h> #include <values.h> #include <alloc.h> #include <dos.h> /* Define maximum depth of the tree */ #define MAXDEPTH 12 enum DIR {LEFT, RIGHT, UP, DOWN}; /* Enumerate directions */ struct queue { char m[3][3]; /* stores the 3 X 3 matrix; used char to save space */ int parent; /* index no. of the node's parent in the queue */ char level; /* level of the node in the tree */ char r8, c8; /* row, column no. of the blank tile */ enum DIR action; /* stores what direction was taken to reach current state. Used for avoiding 'undoing' and for displaying */ }; /* Global Varibles */ struct queue *q; /* stores the states of the BFS tree */ int front, rear; /* point to the front and rear of the queue */ int path[MAXDEPTH]; /* stores the path from the root to the leaf that was selected by the heuristic */ enum DIR valid[5]; /* valid[1] thru valid[4] store the directions the blank tile can take from the current state. Moves that cause 'undoing' are invalid. valid[0] stores the number of such valid moves */ /* Function Declarations */ void init(void); void get_valid_moves(void); void jumble(void); void move(enum DIR dir); void move_rear(enum DIR dir); int iswin(void); int heuristic(int n); void getpath(int i, int *k); void init_display(void); void display(int n, unsigned int no_moves); /* Main Function */ |
هیچ نظری ثبت نشده است