인공지능(AI) - a_star_알고리즘 퍼즐
- 최초 등록일
- 2009.06.16
- 최종 저작일
- 2007.11
- C언어
- 가격 7,000원
소개글
인공지능(AI) - a_star_알고리즘 퍼즐
#include
#include
#include
#include
#include
#define max 10 //max number of row or column
#define delay_time 2000
void Delay(clock_t wait);
void main()
{
double puz; //number of puzzle
int lim; //number of limit (row & column)
int r; //row number
int c; //column number
int i; //loop operand
int j; //loop operand
int k; //loop operand
int f_l; //diffrence with goal state and left state
int f_u; //diffrence with goal state and up state
int f_r; //diffrence with goal state and right state
int f_d; //diffrence with goal state and down state
int t_num=0; //temp number
int s_num=0; //state number
int m_num=0; //move state(left=1,up=2,right=3,down=4)
int bm_num=0; //before move state(left=1,up=2,right=3,down=4)
int find=0; //if find the goal that 'find = 1'
int *s_state[max][max]; //maximum size of start state = (10 * 10)
int *g_state[max][max]; //maximum size of goal state = (10 * 10)
int *p_state[max][max]; //maximum size of present state = (10 * 10)
int *t_state[max][max]; //maximum size of temp state = (10 * 10)
int *t2_state[max][max]; //maximum size of temp2 state = (10 * 10)
printf("Put in the puzzle number with blank (max = %d) : ", max*max);
scanf("%lf", &puz);
lim = sqrt(puz); //row = 0 ~ lim, column = 0 ~ lim
컴파일 실행환경
비주얼 스튜디오 6.0 C언어
참고 자료
없음