亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? aicommon.c

?? 通過人工智能算法快速實現神經網絡識別
?? C
字號:
#include "Toolbox.h"#include "AICommon.h"		TWindow							tbWindow;	ai_World						MainWorld;	ai_Entity						entityList[kMaxEntities];		TBitmap							terrainBMP;	TBitmap							objectsBMP;	TBitmap							objectsMaskBMP;	TBitmap							offscreenBMP;	TRect								unitRect;	TRect								humanRect;	TRect								trollRect;	TRect								treeRect;	TRect								terrainRect[kMaxTiles];	TRect								screenRect;	TRect								destRect[kMaxRows][kMaxCols];	TBoolean						terrainBackup[kMaxRows][kMaxCols];	TBoolean	terrain[kMaxRows][kMaxCols]={		2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,		2,1,1,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,1,1,2,1,1,1,1,2,1,1,1,2,		2,1,1,1,1,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,1,2,1,1,1,2,		2,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,2,1,1,1,2,		2,2,2,1,2,2,2,1,1,1,2,1,1,1,2,2,2,1,2,2,2,2,2,1,2,2,1,1,1,2,		2,1,1,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,1,1,2,1,1,1,1,2,1,1,1,2,		2,1,1,1,1,1,2,2,2,2,2,2,1,2,2,1,1,1,1,1,2,1,1,1,1,2,2,1,2,2,		2,1,1,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,1,2,1,1,1,2,		2,1,1,1,1,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,1,2,		2,2,2,1,2,2,2,1,1,1,2,1,1,1,1,1,1,1,1,1,2,1,1,1,1,2,1,1,1,2,		2,1,1,1,1,1,2,1,1,1,1,1,1,1,2,2,2,2,2,2,2,1,1,1,1,2,1,1,1,2,		2,1,1,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,		2,1,1,1,1,1,1,1,1,1,2,2,1,2,2,1,1,1,1,1,2,1,1,1,1,2,1,1,1,2,		2,2,2,2,2,2,2,2,1,2,2,1,1,1,2,1,1,1,1,1,2,2,2,2,2,2,1,1,1,2,		2,1,1,1,2,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,1,2,1,1,1,2,		2,1,1,1,2,1,1,1,1,1,1,1,1,1,2,2,2,2,1,2,2,1,1,1,1,2,1,1,1,2,		2,1,1,1,1,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,1,2,		2,1,1,1,2,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1,2,1,1,1,1,2,1,1,1,2,		2,1,1,1,2,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1,2,1,1,1,1,2,1,1,1,2,		2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,	};// ----------------------------------------------------------------- //ai_Entity::ai_Entity()// ----------------------------------------------------------------- //{	int					i;	int					j;	int					r;	int					c;		for (i=0;i<kMaxEntities;i++)		{			entityList[i].row=-1;			entityList[i].col=-1;			entityList[i].type=-1;			entityList[i].state=-1;			entityList[i].startRow=-1;			entityList[i].startCol=-1;			entityList[i].endRow=-1;			entityList[i].endCol=-1;			entityList[i].target=-1;			entityList[i].timeToMove=0;			entityList[i].direction=4;		}	entityList[0].New(kHuman,kPlayer,2,10,0,0);	entityList[1].New(kTroll,kPatrolling,1,1,18,8);			}// ----------------------------------------------------------------- //ai_Entity::~ai_Entity()// ----------------------------------------------------------------- //{}// ----------------------------------------------------------------- //void ai_Entity::New(int theType, int theState, int theStartRow, int theStartCol, int theEndRow, int theEndCol)// ----------------------------------------------------------------- //{	int							i;		type=theType;	row=theStartRow;	col=theStartCol;	state=theState;	startRow=theStartRow;	startCol=theStartCol;	endRow=theEndRow;	endCol=theEndCol;	pathPtr=0;	for (i=0;i<kMaxPathLength;i++)		{			pathRow[i]=-1;			pathCol[i]=-1;		}	pathRowTarget=-1;	pathColTarget=-1;	for (i=0;i<kMaxTrailLength;i++)		{			trailRow[i]=-1;			trailCol[i]=-1;		}	if (state==kChasing)		for (i=0;i<kMaxEntities;i++)			if (entityList[i].state==kPlayer)				target=i;}// ----------------------------------------------------------------- //ai_World::ai_World()// ----------------------------------------------------------------- //{	TRect				r;	int					i;	int					j;		tb_InitializeToolbox();	showPath=false;		// offscreen buffer	tb_SetRect(&screenRect,0,0,720,480);	offscreenBMP=tb_CreateBitmap(&screenRect, -1, kScreenDepth);		// terrain graphics	terrainBMP=tb_CreateBitmap(&r, 128, kScreenDepth);	// terrain graphics	objectsBMP=tb_CreateBitmap(&r, 129, kScreenDepth);	objectsMaskBMP=tb_CreateBitmap(&r, 130, kScreenDepth);		tb_SetRect(&unitRect,1,1,49,63);	tb_SetRect(&humanRect,1,1,49,63);	tb_SetRect(&trollRect,50,1,98,63);	tb_SetRect(&treeRect,99,1,147,63);	for (i=kGround;i<=kCrump15;i++)		tb_SetRect(&terrainRect[i],1+(25*(i-1)),1,(25*(i-1))+25,25);	for (i=0;i<kMaxRows;i++)		for (j=0;j<kMaxCols;j++)			{				tb_SetRect(&destRect[i][j],(24*j),(24*i),(24*j)+25,(24*i)+25);				terrainBackup[i][j]=terrain[i][j];			}}// ----------------------------------------------------------------- //ai_World::~ai_World()// ----------------------------------------------------------------- //{}// ----------------------------------------------------------------- //void ai_World::SimpleShowPath(int Ax, int Ay, int Bx, int By, int *nextRow, int *nextCol)// ----------------------------------------------------------------- //{	if (Ax<Bx)		Ax++;	else if (Ax>Bx)		Ax--;	if (Ay<By)		Ay++;	else if (Ay>By)		Ay--;	*nextRow=Ax;	*nextCol=Ay;}// ----------------------------------------------------------------- //void ai_World::UpdateWorld(void)// ----------------------------------------------------------------- //	{	int				i;	int				j;	int				newRow;	int				newCol;	int				tempRow;	int				tempCol;	int				showRowStart;	int				showColStart;	int				showRowEnd;	int				showColEnd;	int				r;	int				c;	int				foundCrump;	int				terrainAnalysis[9];	int				maxTerrain=0;	int				maxIndex=0;	for (i=0;i<kMaxRows;i++)		for (j=0;j<kMaxCols;j++)			terrain[i][j]=terrainBackup[i][j];	// move entities	for (i=0;i<kMaxEntities;i++)		{			if ((entityList[i].state==kPatrolling))// entity is patrolling				if (TickCount()>entityList[i].timeToMove)					{							entityList[i].timeToMove=TickCount()+kEntitySpeed;						r=entityList[i].row;						c=entityList[i].col;						if (entityList[i].direction==4) // moving right							{								if (terrain[r-1][c]==1)									{										entityList[i].row--;										entityList[i].direction=2;									}								else if (terrain[r][c+1]==1)									{										entityList[i].col++;										entityList[i].direction=4;									}								else if (terrain[r+1][c]==1)									{										entityList[i].row++;										entityList[i].direction=6;									}								else if (terrain[r][c-1]==1)									{										entityList[i].col--;										entityList[i].direction=8;									}							}														else if (entityList[i].direction==6) // moving down							{								if (terrain[r][c+1]==1) // left									{										entityList[i].col++;										entityList[i].direction=4;									}								else if (terrain[r+1][c]==1) // straight									{										entityList[i].row++;										entityList[i].direction=6;									}								else if (terrain[r][c-1]==1) // right									{										entityList[i].col--;										entityList[i].direction=8;									}								else if (terrain[r-1][c]==1) // back									{										entityList[i].row--;										entityList[i].direction=2;									}							}						else if (entityList[i].direction==8) // moving left							{								if (terrain[r+1][c]==1) // left									{										entityList[i].row++;										entityList[i].direction=6;									}								else if (terrain[r][c-1]==1) // straight									{										entityList[i].col--;										entityList[i].direction=8;									}								else if (terrain[r-1][c]==1) // right									{										entityList[i].row--;										entityList[i].direction=2;									}								else if (terrain[r][c+1]==1) // back									{										entityList[i].col++;										entityList[i].direction=4;									}							}						else if (entityList[i].direction==2) // moving up							{								if (terrain[r][c-1]==1) // left									{										entityList[i].col--;										entityList[i].direction=8;									}								else if (terrain[r-1][c]==1) // straight									{										entityList[i].row--;										entityList[i].direction=2;									}								else if (terrain[r][c+1]==1) // right									{										entityList[i].col++;										entityList[i].direction=4;									}								else if (terrain[r+1][c]==1) // back									{										entityList[i].row++;										entityList[i].direction=6;									}							}						if (entityList[i].row<0)							entityList[i].row=0;						if (entityList[i].col<0)							entityList[i].col=0;						if (entityList[i].row>=kMaxRows)							entityList[i].row=kMaxRows-1;						if (entityList[i].col>=kMaxCols)							entityList[i].col=kMaxCols-1;					}		}	Redraw();	}// ----------------------------------------------------------------- //void ai_World::DropBreadCrump(void)// ----------------------------------------------------------------- //	{	int				i;		for (i=kMaxTrailLength-1;i>0;i--)		{			entityList[0].trailRow[i]=entityList[0].trailRow[i-1];			entityList[0].trailCol[i]=entityList[0].trailCol[i-1];		}	entityList[0].trailRow[0]=entityList[0].row;	entityList[0].trailCol[0]=entityList[0].col;			}// ----------------------------------------------------------------- //void ai_World::KeyDown(int key)// ----------------------------------------------------------------- //	{	int							i;		if (key==kUpKey)		for (i=0;i<kMaxEntities;i++)			if (entityList[i].state==kPlayer)				if (TickCount()>entityList[i].timeToMove)					if (entityList[i].row>0)						{							entityList[i].row--;							entityList[i].timeToMove=TickCount()+kPlayerSpeed;							DropBreadCrump();						}							if (key==kDownKey)		for (i=0;i<kMaxEntities;i++)			if (entityList[i].state==kPlayer)				if (entityList[i].row<(kMaxRows-1))					if (TickCount()>entityList[i].timeToMove)						{							entityList[i].row++;							entityList[i].timeToMove=TickCount()+kPlayerSpeed;							DropBreadCrump();						}	if (key==kLeftKey)		for (i=0;i<kMaxEntities;i++)			if (entityList[i].state==kPlayer)				if (entityList[i].col>0)					if (TickCount()>entityList[i].timeToMove)						{							entityList[i].col--;							entityList[i].timeToMove=TickCount()+kPlayerSpeed;							DropBreadCrump();						}	if (key==kRightKey)		for (i=0;i<kMaxEntities;i++)			if (entityList[i].state==kPlayer)				if (entityList[i].col<(kMaxCols-1))					if (TickCount()>entityList[i].timeToMove)						{							entityList[i].col++;							entityList[i].timeToMove=TickCount()+kPlayerSpeed;							DropBreadCrump();						}}// ----------------------------------------------------------------- //void ai_World::Redraw(void)// ----------------------------------------------------------------- //	{	int					i;	int					j;	TRect				objectDest;		// draw terrain	for (i=0;i<kMaxRows;i++)		for (j=0;j<kMaxCols;j++)			tb_CopyBitmap(terrainBMP,offscreenBMP,&terrainRect[terrain[i][j]],&destRect[i][j],false);	for (i=0;i<kMaxEntities;i++)		{					if (entityList[i].type==kHuman)	// draw human				{					objectDest=unitRect;					tb_OffsetRect(&objectDest,destRect[entityList[i].row][entityList[i].col].left-14,destRect[entityList[i].row][entityList[i].col].top-42);					tb_CopyMaskBitmap(objectsBMP,objectsMaskBMP,offscreenBMP,&humanRect,&humanRect,&objectDest);				}			if (entityList[i].type==kTroll)	// draw troll				{					objectDest=unitRect;					tb_OffsetRect(&objectDest,destRect[entityList[i].row][entityList[i].col].left-14,destRect[entityList[i].row][entityList[i].col].top-42);					tb_CopyMaskBitmap(objectsBMP,objectsMaskBMP,offscreenBMP,&trollRect,&trollRect,&objectDest);				}			if (entityList[i].type==kTree)	// draw troll				{					objectDest=unitRect;					tb_OffsetRect(&objectDest,destRect[entityList[i].row][entityList[i].col].left-14,destRect[entityList[i].row][entityList[i].col].top-42);					tb_CopyMaskBitmap(objectsBMP,objectsMaskBMP,offscreenBMP,&treeRect,&treeRect,&objectDest);				}						}		tb_CopyBitmap(offscreenBMP,tbWindow,&screenRect,&screenRect,false);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产91乱码一区二区三区 | 狠狠狠色丁香婷婷综合久久五月| 国产毛片一区二区| 一本一道久久a久久精品综合蜜臀| 欧美另类videos死尸| 国产精品视频一二| 蜜乳av一区二区三区| 一本色道久久综合精品竹菊| 精品国产一区二区三区不卡| 亚洲国产一区二区三区青草影视| 国产美女av一区二区三区| 欧美日韩国产首页| 亚洲精品国产第一综合99久久 | 大桥未久av一区二区三区中文| 欧美日韩一区二区三区在线 | 日韩一区二区免费在线电影| 国产精品久久久久久久久免费丝袜 | 精品国产凹凸成av人网站| 亚洲一区二区三区视频在线| www.av亚洲| 国产精品午夜久久| 国产精品18久久久久久久久| 欧美成人国产一区二区| 日韩电影在线看| 欧美精品自拍偷拍动漫精品| 亚洲午夜久久久| 欧美视频在线不卡| 一区二区三区91| 91久久国产综合久久| 亚洲视频一二区| 91论坛在线播放| 一区二区三区在线看| 色婷婷av一区二区三区gif| 亚洲丝袜制服诱惑| 色一情一伦一子一伦一区| 亚洲伦在线观看| 欧美性一二三区| 视频一区视频二区中文字幕| 制服丝袜亚洲精品中文字幕| 天天av天天翘天天综合网色鬼国产 | 欧美顶级少妇做爰| 天天综合网天天综合色| 宅男噜噜噜66一区二区66| 奇米影视一区二区三区| 日韩精品一区二区三区中文不卡 | 亚洲福利国产精品| 欧美精品九九99久久| 美女mm1313爽爽久久久蜜臀| 日韩女优视频免费观看| 国产一区二区三区高清播放| 国产欧美日产一区| 在线观看视频一区二区欧美日韩| 亚洲成人免费看| 精品卡一卡二卡三卡四在线| 粉嫩一区二区三区在线看| 久久精品二区亚洲w码| 日韩久久精品一区| 成人自拍视频在线| 亚洲成av人综合在线观看| 日韩欧美亚洲国产精品字幕久久久| 国模无码大尺度一区二区三区| 中文在线一区二区| 欧美日韩国产一级| 国产99久久久国产精品免费看| 亚洲精品视频一区二区| 日韩手机在线导航| 99re视频这里只有精品| 日韩国产精品久久| 国产精品不卡一区二区三区| 91精品久久久久久久久99蜜臂| 国产精品一区二区视频| 亚洲综合成人网| 久久久综合精品| 欧美日韩国产三级| 懂色av噜噜一区二区三区av| 日韩成人一区二区三区在线观看| 国产午夜精品美女毛片视频| 欧美午夜精品久久久| 国产经典欧美精品| 午夜精品国产更新| 最新日韩av在线| 久久久亚洲国产美女国产盗摄| 在线视频欧美区| 国产成人啪免费观看软件| 午夜视频一区在线观看| 中文字幕一区二区三区色视频| 日韩午夜中文字幕| 欧美最新大片在线看| 成人午夜激情片| 国产一区二区在线观看免费| 亚洲国产视频在线| 亚洲欧美日韩国产另类专区| 久久免费国产精品| 日韩亚洲欧美高清| 欧美亚洲丝袜传媒另类| av激情综合网| 成人网在线免费视频| 99久久精品久久久久久清纯| 国产激情一区二区三区四区| 蜜臀久久99精品久久久画质超高清 | 欧美亚洲一区二区三区四区| 成人美女视频在线看| 国产风韵犹存在线视精品| 久久精品久久99精品久久| 日韩精品成人一区二区在线| 亚洲精品视频在线观看免费| 成人欧美一区二区三区1314| 欧美韩国日本综合| 国产精品素人视频| 欧美国产禁国产网站cc| 久久久一区二区| 国产亚洲人成网站| 国产日韩欧美在线一区| 久久久一区二区| 国产欧美日韩不卡| 国产精品久久久久三级| 国产精品乱码一区二区三区软件| 国产欧美日韩视频一区二区| 亚洲国产精品精华液2区45| 亚洲国产精华液网站w | 成人午夜伦理影院| 成人av免费观看| 91麻豆swag| 欧美日韩免费观看一区三区| 欧美日韩极品在线观看一区| 欧美老年两性高潮| 欧美变态tickle挠乳网站| 久久综合资源网| 国产精品理论片| 亚洲伊人伊色伊影伊综合网| 视频一区二区中文字幕| 久久99精品久久久久久动态图 | 亚洲h动漫在线| 香港成人在线视频| 麻豆精品国产91久久久久久| 久久精品理论片| 成人毛片视频在线观看| 91久久精品一区二区三| 日韩一区二区免费电影| 久久久精品tv| 洋洋成人永久网站入口| 青青草成人在线观看| 国产传媒欧美日韩成人| 91福利在线播放| 精品国产人成亚洲区| 国产精品久久久久天堂| 日韩精品一二三区| 高清成人免费视频| 欧美日韩精品专区| 国产色一区二区| 夜夜精品视频一区二区| 久草这里只有精品视频| 色婷婷激情一区二区三区| 日韩一区二区三区视频在线| 国产精品久久久久aaaa| 午夜精品国产更新| 成人激情图片网| 日韩午夜三级在线| 亚洲色图20p| 国产一级精品在线| 欧美三级三级三级爽爽爽| 久久精品一区二区三区不卡牛牛 | 久久精品二区亚洲w码| 99麻豆久久久国产精品免费优播| 3d成人动漫网站| 亚洲精品中文字幕乱码三区| 国产在线精品一区二区夜色| 在线免费观看日韩欧美| 国产农村妇女精品| 蜜臀av一区二区三区| 在线一区二区三区四区| 国产午夜亚洲精品午夜鲁丝片| 亚洲成av人影院| 91久久精品一区二区三区| 亚洲国产精品黑人久久久| 极品少妇一区二区| 欧美天天综合网| 亚洲人亚洲人成电影网站色| 久久激情五月婷婷| 欧美一区午夜视频在线观看| 亚洲视频免费观看| 成人午夜短视频| 久久久亚洲精品一区二区三区| 日本色综合中文字幕| 精品视频123区在线观看| 亚洲欧洲综合另类在线| av一二三不卡影片| 国产精品色哟哟网站| 国产成人8x视频一区二区| 精品美女一区二区| 久久99最新地址| 欧美videossexotv100| 三级久久三级久久| 欧美久久一二三四区| 亚洲成人免费电影| 在线播放亚洲一区| 免费黄网站欧美| 欧美精品一区二区精品网| 久久国产精品无码网站| 欧美成人vr18sexvr|