自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(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 2337 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 2398

原创 查找

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 534

转载 C库函数详解

正在处理您的请求... <!-- function getObject(objectId) { if(document.getElementById) { return document.getElementById(objectId) } else if(document.all&&document.all(objectId))

2007-01-15 11:01:00 1557

原创 读写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 647

原创 自己用

#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 464

原创 类型转换(不断更新)

CSrting -> char[]strcpy(char,cstring); CString->char* CString s = _T("passwordfsdfasdfasdf"); char *psw = s.GetBuffer(0);

2007-01-12 15:53:00 419

原创 无题

 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 461

转载 文件进行加密:

利用异或的性质来对文件进行加密: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 441

转载 另一个文件读写操作

看下面的代码行不行,把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 433

转载 结构体写入文件(二进制)

写个例子给你吧(具体思路是这样):  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 1877

原创 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 685

原创 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 674

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除