- 博客(13)
- 收藏
- 关注
原创 移格拼图有解问题
八数码问题有一个3*3的棋盘,其中有0-8 9个数字,0表示空格,其他的数字可以和0交换位置。求由初始状态1 2 34 5 67 8 0到达目标状态步数最少的解。其典型算法是广度优先搜索,具体算法是:struct 类名 m_ar[可能结点数];int h,rmain(){ h=0;r=1; while ((h { if (判断每一种可能性,如果某一种操作符合要求
2007-01-30 13:03:00 2353 1
转载 A*寻路算法(译)
A*寻路算法(译) 原文地址:http://www.gamedev.net/reference/articles/article2003.asp概述虽然掌握了A*算法的人认为它容易,但是对于初学者来说,A*算法还是很复杂的。搜索区域(The Search Area)我们假设某人要从A点移动到B点,但是这两点之间被一堵墙隔开。如图1,绿色是A,红色是B,中间蓝色是墙。
2007-01-24 13:34:00 2414
原创 查找
void BaseSetDlg::FindFiles(CString pstr) { DecryptFile(pstr,0); CFileFind finder; if(pstr.IsEmpty()) return ; // build a string with wildcards CString strWildcard(ps
2007-01-17 11:07:00 547
转载 C库函数详解
正在处理您的请求... <!-- function getObject(objectId) { if(document.getElementById) { return document.getElementById(objectId) } else if(document.all&&document.all(objectId))
2007-01-15 11:01:00 1647
原创 读写INI
DWORD GetPrivateProfileString( LPCTSTR lpAppName, // points to section name LPCTSTR lpKeyName, // points to key name LPCTSTR lpDefault, // points to default string LPTSTR lpRe
2007-01-15 10:54:00 659
原创 自己用
#define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)#define _RGB16BIT565(r,g,b) ((b & 31) + ((g & 63) #define _RGB32BIT(a,r,g,b) ((b) + ((g) #define DDRAW_INIT_STRUCT(ddstruct) { m
2007-01-12 17:36:00 476
原创 类型转换(不断更新)
CSrting -> char[]strcpy(char,cstring); CString->char* CString s = _T("passwordfsdfasdfasdf"); char *psw = s.GetBuffer(0);
2007-01-12 15:53:00 437
原创 无题
void CMapEditDlg::OnButtonRead() { // TODO: Add your control notification handler code here FILE *pFileout; // 文件操作指针 char caption[100] = ""; char stype[100] = ""; char texture[100] = ""; char music
2007-01-12 15:51:00 471
转载 文件进行加密:
利用异或的性质来对文件进行加密:c=a^bc^b=a#include "stdio.h"#include "stdlib.h"void main(int argc,char *argv[]){ FILE *fp1,*fp2; char c,ch; long j; if(3!=argc) { printf("Command error/n"); exit(1); } if((
2007-01-12 15:45:00 453
转载 另一个文件读写操作
看下面的代码行不行,把T换成你的自定义结构,N也可替换为真实长度。const int N=10;T Array[N];...ofstream SaveFile("save.bin",ios_base::out|ios_base::binary);for(int i=0;i SaveFile.write(reinterpret_cast(&Array[i]),sizeof(T));}SaveFi
2007-01-11 23:40:00 451
转载 结构体写入文件(二进制)
写个例子给你吧(具体思路是这样): FILE *pFileout, *pFilein; // 文件操作指针 UserInf userinf[10]; // 结构体数组 UserInf usertemp; // 以二进制方式打开user.dat文件 if ((pFileout = fopen("data/user.dat", "rb")) == NULL) { printf(
2007-01-11 23:39:00 1917
原创 DriectDrow 用法(窗口模式)
// BitMap.cpp : Defines the entry point for the application.//#include "stdafx.h"#include "resource.h"#include #define MAX_LOADSTRING 100#define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x800
2007-01-09 13:20:00 703
原创 DriectDrow 用法
// BitMap.cpp : Defines the entry point for the application.//#include "stdafx.h"#include "resource.h"#include #define MAX_LOADSTRING 100#define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x800
2007-01-08 17:39:00 684
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人