黑白棋源码
Ⅰ 急求俄罗斯方块等小游戏的源代码
俄罗斯方块——java源代码提供
import java.awt.*;
import java.awt.event.*;
//俄罗斯方块类
public class ERS_Block extends Frame{
public static boolean isPlay=false;
public static int level=1,score=0;
public static TextField scoreField,levelField;
public static MyTimer timer;
GameCanvas gameScr;
public static void main(String[] argus){
ERS_Block ers = new ERS_Block("俄罗斯方块游戏 V1.0 Author:Vincent");
WindowListener win_listener = new WinListener();
ers.addWindowListener(win_listener);
}
//俄罗斯方块类的构造方法
ERS_Block(String title){
super(title);
setSize(600,480);
setLayout(new GridLayout(1,2));
gameScr = new GameCanvas();
gameScr.addKeyListener(gameScr);
timer = new MyTimer(gameScr);
timer.setDaemon(true);
timer.start();
timer.suspend();
add(gameScr);
Panel rightScr = new Panel();
rightScr.setLayout(new GridLayout(2,1,0,30));
rightScr.setSize(120,500);
add(rightScr);
//右边信息窗体的布局
MyPanel infoScr = new MyPanel();
infoScr.setLayout(new GridLayout(4,1,0,5));
infoScr.setSize(120,300);
rightScr.add(infoScr);
//定义标签和初始值
Label scorep = new Label("分数:",Label.LEFT);
Label levelp = new Label("级数:",Label.LEFT);
scoreField = new TextField(8);
levelField = new TextField(8);
scoreField.setEditable(false);
levelField.setEditable(false);
infoScr.add(scorep);
infoScr.add(scoreField);
infoScr.add(levelp);
infoScr.add(levelField);
scorep.setSize(new Dimension(20,60));
scoreField.setSize(new Dimension(20,60));
levelp.setSize(new Dimension(20,60));
levelField.setSize(new Dimension(20,60));
scoreField.setText("0");
levelField.setText("1");
//右边控制按钮窗体的布局
MyPanel controlScr = new MyPanel();
controlScr.setLayout(new GridLayout(5,1,0,5));
rightScr.add(controlScr);
//定义按钮play
Button play_b = new Button("开始游戏");
play_b.setSize(new Dimension(50,200));
play_b.addActionListener(new Command(Command.button_play,gameScr));
//定义按钮Level UP
Button level_up_b = new Button("提高级数");
level_up_b.setSize(new Dimension(50,200));
level_up_b.addActionListener(new Command(Command.button_levelup,gameScr));
//定义按钮Level Down
Button level_down_b =new Button("降低级数");
level_down_b.setSize(new Dimension(50,200));
level_down_b.addActionListener(new Command(Command.button_leveldown,gameScr));
//定义按钮Level Pause
Button pause_b =new Button("游戏暂停");
pause_b.setSize(new Dimension(50,200));
pause_b.addActionListener(new Command(Command.button_pause,gameScr));
//定义按钮Quit
Button quit_b = new Button("退出游戏");
quit_b.setSize(new Dimension(50,200));
quit_b.addActionListener(new Command(Command.button_quit,gameScr));
controlScr.add(play_b);
controlScr.add(level_up_b);
controlScr.add(level_down_b);
controlScr.add(pause_b);
controlScr.add(quit_b);
setVisible(true);
gameScr.requestFocus();
}
}
//重写MyPanel类,使Panel的四周留空间
class MyPanel extends Panel{
public Insets getInsets(){
return new Insets(30,50,30,50);
}
}
//游戏画布类
class GameCanvas extends Canvas implements KeyListener{
final int unitSize = 30; //小方块边长
int rowNum; //正方格的行数
int columnNum; //正方格的列数
int maxAllowRowNum; //允许有多少行未削
int blockInitRow; //新出现块的起始行坐标
int blockInitCol; //新出现块的起始列坐标
int [][] scrArr; //屏幕数组
Block b; //对方快的引用
//画布类的构造方法
GameCanvas(){
rowNum = 15;
columnNum = 10;
maxAllowRowNum = rowNum - 2;
b = new Block(this);
blockInitRow = rowNum - 1;
blockInitCol = columnNum/2 - 2;
scrArr = new int [32][32];
}
//初始化屏幕,并将屏幕数组清零的方法
void initScr(){
for(int i=0;i<rowNum;i++)
for (int j=0; j<columnNum;j++)
scrArr[j]=0;
b.reset();
repaint();
}
//重新刷新画布方法
public void paint(Graphics g){
for(int i = 0; i < rowNum; i++)
for(int j = 0; j < columnNum; j++)
drawUnit(i,j,scrArr[j]);
}
//画方块的方法
public void drawUnit(int row,int col,int type){
scrArr[row][col] = type;
Graphics g = getGraphics();
tch(type){ //表示画方快的方法
case 0: g.setColor(Color.black);break; //以背景为颜色画
case 1: g.setColor(Color.blue);break; //画正在下落的方块
case 2: g.setColor(Color.magenta);break; //画已经落下的方法
}
g.fill3DRect(col*unitSize,getSize().height-(row+1)*unitSize,unitSize,unitSize,true);
g.dispose();
}
public Block getBlock(){
return b; //返回block实例的引用
}
//返回屏幕数组中(row,col)位置的属性值
public int getScrArrXY(int row,int col){
if (row < 0 || row >= rowNum || col < 0 || col >= columnNum)
return(-1);
else
return(scrArr[row][col]);
}
//返回新块的初始行坐标方法
public int getInitRow(){
return(blockInitRow); //返回新块的初始行坐标
}
//返回新块的初始列坐标方法
public int getInitCol(){
return(blockInitCol); //返回新块的初始列坐标
}
//满行删除方法
void deleteFullLine(){
int full_line_num = 0;
int k = 0;
for (int i=0;i<rowNum;i++){
boolean isfull = true;
L1:for(int j=0;j<columnNum;j++)
if(scrArr[j] == 0){
k++;
isfull = false;
break L1;
}
if(isfull) full_line_num++;
if(k!=0 && k-1!=i && !isfull)
for(int j = 0; j < columnNum; j++){
if (scrArr[j] == 0)
drawUnit(k-1,j,0);
else
drawUnit(k-1,j,2);
scrArr[k-1][j] = scrArr[j];
}
}
for(int i = k-1 ;i < rowNum; i++){
for(int j = 0; j < columnNum; j++){
drawUnit(i,j,0);
scrArr[j]=0;
}
}
ERS_Block.score += full_line_num;
ERS_Block.scoreField.setText(""+ERS_Block.score);
}
//判断游戏是否结束方法
boolean isGameEnd(){
for (int col = 0 ; col <columnNum; col ++){
if(scrArr[maxAllowRowNum][col] !=0)
return true;
}
return false;
}
public void keyTyped(KeyEvent e){
}
public void keyReleased(KeyEvent e){
}
//处理键盘输入的方法
public void keyPressed(KeyEvent e){
if(!ERS_Block.isPlay)
return;
tch(e.getKeyCode()){
case KeyEvent.VK_DOWN:b.fallDown();break;
case KeyEvent.VK_LEFT:b.leftMove();break;
case KeyEvent.VK_RIGHT:b.rightMove();break;
case KeyEvent.VK_SPACE:b.leftTurn();break;
}
}
}
//处理控制类
class Command implements ActionListener{
static final int button_play = 1; //给按钮分配编号
static final int button_levelup = 2;
static final int button_leveldown = 3;
static final int button_quit = 4;
static final int button_pause = 5;
static boolean pause_resume = true;
int curButton; //当前按钮
GameCanvas scr;
//控制按钮类的构造方法
Command(int button,GameCanvas scr){
curButton = button;
this.scr=scr;
}
//按钮执行方法
public void actionPerformed (ActionEvent e){
tch(curButton){
case button_play:if(!ERS_Block.isPlay){
scr.initScr();
ERS_Block.isPlay = true;
ERS_Block.score = 0;
ERS_Block.scoreField.setText("0");
ERS_Block.timer.resume();
}
scr.requestFocus();
break;
case button_levelup:if(ERS_Block.level < 10){
ERS_Block.level++;
ERS_Block.levelField.setText(""+ERS_Block.level);
ERS_Block.score = 0;
ERS_Block.scoreField.setText(""+ERS_Block.score);
}
scr.requestFocus();
break;
case button_leveldown:if(ERS_Block.level > 1){
ERS_Block.level--;
ERS_Block.levelField.setText(""+ERS_Block.level);
ERS_Block.score = 0;
ERS_Block.scoreField.setText(""+ERS_Block.score);
}
scr.requestFocus();
break;
case button_pause:if(pause_resume){
ERS_Block.timer.suspend();
pause_resume = false;
}else{
ERS_Block.timer.resume();
pause_resume = true;
}
scr.requestFocus();
break;
case button_quit:System.exit(0);
}
}
}
//方块类
class Block {
static int[][] pattern = {
{0x0f00,0x4444,0x0f00,0x4444},//用十六进至表示,本行表示长条四种状态
{0x04e0,0x0464,0x00e4,0x04c4},
{0x4620,0x6c00,0x4620,0x6c00},
{0x2640,0xc600,0x2640,0xc600},
{0x6220,0x1700,0x2230,0x0740},
{0x6440,0x0e20,0x44c0,0x8e00},
{0x0660,0x0660,0x0660,0x0660}
};
int blockType; //块的模式号(0-6)
int turnState; //块的翻转状态(0-3)
int blockState; //快的下落状态
int row,col; //块在画布上的坐标
GameCanvas scr;
//块类的构造方法
Block(GameCanvas scr){
this.scr = scr;
blockType = (int)(Math.random() * 1000)%7;
turnState = (int)(Math.random() * 1000)%4;
blockState = 1;
row = scr.getInitRow();
col = scr.getInitCol();
}
//重新初始化块,并显示新块
public void reset(){
blockType = (int)(Math.random() * 1000)%7;
turnState = (int)(Math.random() * 1000)%4;
blockState = 1;
row = scr.getInitRow();
col = scr.getInitCol();
dispBlock(1);
}
//实现“块”翻转的方法
public void leftTurn(){
if(assertValid(blockType,(turnState + 1)%4,row,col)){
dispBlock(0);
turnState = (turnState + 1)%4;
dispBlock(1);
}
}
//实现“块”的左移的方法
public void leftMove(){
if(assertValid(blockType,turnState,row,col-1)){
dispBlock(0);
col--;
dispBlock(1);
}
}
//实现块的右移
public void rightMove(){
if(assertValid(blockType,turnState,row,col+1)){
dispBlock(0);
col++;
dispBlock(1);
}
}
//实现块落下的操作的方法
public boolean fallDown(){
if(blockState == 2)
return(false);
if(assertValid(blockType,turnState,row-1,col)){
dispBlock(0);
row--;
dispBlock(1);
return(true);
}else{
blockState = 2;
dispBlock(2);
return(false);
}
}
//判断是否正确的方法
boolean assertValid(int t,int s,int row,int col){
int k = 0x8000;
for(int i = 0; i < 4; i++){
for(int j = 0; j < 4; j++){
if((int)(pattern[t][s]&k) != 0){
int temp = scr.getScrArrXY(row-i,col+j);
if (temp<0||temp==2)
return false;
}
k = k >> 1;
}
}
return true;
}
//同步显示的方法
public synchronized void dispBlock(int s){
int k = 0x8000;
for (int i = 0; i < 4; i++){
for(int j = 0; j < 4; j++){
if(((int)pattern[blockType][turnState]&k) != 0){
scr.drawUnit(row-i,col+j,s);
}
k=k>>1;
}
}
}
}
//定时线程
class MyTimer extends Thread{
GameCanvas scr;
public MyTimer(GameCanvas scr){
this.scr = scr;
}
public void run(){
while(true){
try{
sleep((10-ERS_Block.level + 1)*100);
}
catch(InterruptedException e){}
if(!scr.getBlock().fallDown()){
scr.deleteFullLine();
if(scr.isGameEnd()){
ERS_Block.isPlay = false;
suspend();
}else
scr.getBlock().reset();
}
}
}
}
class WinListener extends WindowAdapter{
public void windowClosing (WindowEvent l){
System.exit(0);
}
}
Ⅱ 小游戏程序设计代码内容
http://www.pudn.com/
[我的早期C程序源代码]黑白棋
#include<io.h>
#include<stdio.h>
#include<dos.h>
#include<string.h>
#include<math.h>
#include<bios.h>
#include<mem.h>
#include<fcntl.h>
#include<stdlib.h>
#include<conio.h>
#include <graphics.h>
#define HH '0'
#define N 6
int Q=0;
char key;
int fine=1;
int A=0,B=0;
char s[N][N],m[N][N];
void *ball;
int maxx;
unsigned int size;
loading()
{ int z=1;
while(z)
{ if(z>77)break;
printf("<");
delay(5000);
z++;
}
delay(2000);
cleardevice();
}
unsigned char Get_Ascii_Key(void)
{
if(bioskey(1))
return(bioskey(0));
else return(0);
}
int Test_Ascii_Key(int ascii)
{
if(Get_Ascii_Key()==ascii)
return(1);
else
return(0);
}
void tu(){
maxx=getmaxx();
size=imagesize(210,390,450,420);
ball=malloc(size);
setfillstyle(1,10);
bar(160,170,473,253);
setfillstyle(1,9);
bar(163,173,470,250);
setcolor(13);
outtextxy(200,200,"Welcome to BLACK & WHITE chess");
setcolor(14);
outtextxy(250,220,"Developer :Wu siyuan ");
outtextxy(290,240,"2002.8");
outtextxy(210,390,"Press any key to contunue...");
getimage(210,390,450,420,ball);
while(!kbhit()){
putimage(210,390,ball,XOR_PUT);
delay(30000);
}
cleardevice();
}
void sou(void){
}
void print()
{ int i=0,j=30;
setcolor(11);
outtextxy(35,20," 0 1 2 3 4 5");
outtextxy(14,50,"0");
outtextxy(14,100,"1");
outtextxy(14,150,"2");
outtextxy(14,200,"3");
outtextxy(14,250,"4");
outtextxy(14,300,"5");
setbkcolor(0);
setlinestyle(SOLID_LINE,0,2);
for(i=0;i<7;i++)
{ setcolor(GREEN);
line (j,30,j,330);
j+=50;
}
j=30;
for(i=0;i<7;i++)
{ setcolor(GREEN);
line(30,j,330,j);
j+=50;
}
for(i=0;i<6;i++)
for(j=0;j<6;j++)
{ if(s[i][j]=='o')
{
setcolor(WHITE);
circle(55+j*50,55+i*50,15);
}
else if(s[i][j]=='x')
{ setcolor(RED);
circle(55+j*50,55+i*50,15); }
}
}
int cal(char z)
{ int *p=0;
int num=0,i,j;
for(i=0;i<N;i++)
for(j=0;j<N;j++)
if(s[i][j]==z)num++;
p=#
return(*p);
}
void save()
{int i,j;
for(i=0;i<N;i++)
for(j=0;j<N;j++)
m[i][j]=s[i][j];
}
void load()
{ int i,j;
for(i=0;i<N;i++)
for(j=0;j<N;j++)
s[i][j]=m[i][j];
}
snew(int x,int y,char z1,char z2)
{int i,j,a;int can[]={0,0,0,0,0,0,0,0,0},k[N*N];
if(s[x][y-1]==z1&&(y-1)>=0)
{
i=0;
while(i<y)
{
if(s[x][i]==z2){ can[1]=1;break; }
i++;
}
}
if(s[x][y+1]==z1)
{
i=y+2;
while(i<N)
{
if(s[x][i]==z2){ can[2]=1;break;}
i++;
}
}
if(s[x-1][y]==z1&&(x-1)>=0)
{
i=0;
while(i<x)
{
if(s[i][y]==z2){can[3]=1;break;}
i++;
}
}
if(s[x+1][y]==z1)
{i=x+2;
while(i<N)
{
if(s[i][y]==z2){can[4]=1;break;}
i++;
}
}
if(s[x-1][y+1]==z1&&(x-1)>=0)
{i=2;
while(y+i<N&&(x-i>=0))
{if(s[x-i][y+i]==z2){can[5]=1;break;}
i++;
}
}
if(s[x+1][y-1]==z1&&(y-1)>=0)
{i=2;
while(i<N&&(y-i>=0))
{if(s[x+i][y-i]==z2)
{can[6]=1;break;}
i++;
}
}
if(s[x-1][y-1]==z1&&(x-1)*(y-1)>=0)
{i=2;
while(x-i>=0&&y-i>=0)
{if(s[x-i][y-i]==z2)
{can[7]=1;
break;}
i++;
}
}
if(s[x+1][y+1]==z1)
{i=2;
while(i+x<N)
{if(s[x+i][y+i]==z2)
{can[8]=1;
break;}
i++;
}
}
for(i=1,j=0;i<=8;i++)
if(can[i]==0)j++;
if(j==8&&Q==1)
{printf("error!");
exit(1); }
else if(j!=8)s[x][y]=z2;
if(can[1]==1)
{ i=1;
while(s[x][y-i]==z1)
{s[x][y-i]=z2;
i++;
}
can[1]=0;
}
if(can[2]==1)
{i=1;
while(s[x][y+i]==z1)
{s[x][y+i]=z2;
i++;
}
can[2]=0;
}
if(can[3]==1)
{i=1;
while(s[x-i][y]==z1)
{ s[x-i][y]=z2;
i++;
}
can[3]=0;
}
if(can[4]==1)
{i=1;
while(s[x+i][y]==z1)
{s[x+i][y]=z2;
i++;
}
can[4]=0;
}
if(can[5]==1)
{i=1;
while(s[x-i][y+i]==z1)
{s[x-i][y+i]=z2;
i++;
}
can[5]=0;
}
if(can[6]==1)
{i=1;
while(s[x+i][y-i]==z1)
{s[x+i][y-i]=z2;
i++;
}
can[6]=0;
}
if(can[7]==1)
{i=1;
while(s[x-i][y-i]==z1)
{s[x-i][y-i]=z2;
i++;
}
can[7]=0;
}
if(can[8]==1)
{i=1;
while(s[x+i][y+i]==z1)
{s[x+i][y+i]=z2;
i++;
}
can[8]=0;
}
} /* snew */
void one()
{ int a,b;char g='o';
load();
setcolor(15);
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("\n To exit the Game press the 'q' key.\n");
print();
printf("Please input x (0 to 5):");
while(1){
a=Get_Ascii_Key();
if(a==113||a==81){
printf("\nQuit?(y or n)");
while(1)
{
if(Test_Ascii_Key(89)||Test_Ascii_Key(121))
exit(0);
else if(Test_Ascii_Key(110)||Test_Ascii_Key(78))
{printf("\n\tWelcome to return the Game !\n");break; }
}}
if(a>=48&&a<=53){printf("\tGood! x has get!\n");
break;}
}
a=a-48;
printf("Please input y (0 to 5):");
while(1){
b=Get_Ascii_Key();
if(b==113||b==81)
{
printf("\nQuit?(y or Y)");
while(1)
{
if(Test_Ascii_Key(89)||Test_Ascii_Key(121))
exit(0);
else if(Test_Ascii_Key(110)||Test_Ascii_Key(78))
break;
}}
if(b>=48&&a<=53){printf("\tGood! y has get!");break;}
}
b=b-48;
Q=1;
snew(a,b,'x','o');
Q=0;
save();
A=cal(g);
B=cal('x');
/* printf("\t\t\t\t\t\t\rA=%d,B=%d",A,B);*/
}/* one */
void search()
{
int i,j,r=0;
for(i=0;i<N;i++)
for(j=0;j<N;j++)
if(s[i][j]==HH)
r++;
if(r==0)fine=0;
}
void two()
{ char h='x';int row[N*N],col[N*N];
int a=1,ii,j,t,t1,k[N*N];
load();
for(ii=0;ii<N;ii++)
for(j=0;j<N;j++)
if(s[ii][j]==HH)
{
row[a]=ii;
col[a]=j;
a++;
}
/* space right */
for(ii=1;ii<a;ii++)
{
load(); /*two*/
snew(row[ii],col[ii],'o','x');
k[ii]=cal(h);
}
t=k[1];
ii--;
t1=ii;
while(ii)
{
if(t<=k[ii])
{t=k[ii];t1=ii;}
ii--;
}
a=t1;
A=cal('o');
B=t;
load();
snew(row[a],col[a],'o','x');
save();
cleardevice();
printf("\n\n\t\t\t\t\t Computer located :%d,%d",row[a],col[a]);
}
main()
{ int i,j;
int gd=DETECT,gm;
clrscr();
initgraph(&gd,&gm,"d:\\tc\\bgi");
setbkcolor(BLACK);
tu();
sou();
setbkcolor(0);
for(i=0;i<N;i++)
for(j=0;j<N;j++)
s[i][j]='0';
s[2][2]=s[3][3]='x';
s[2][3]=s[3][2]='o';
save();
loading();
cleardevice();
while(fine)
{
print();
one();
two();
search();
if(key==113||key==81)
{
printf("\nQuit?(y or Y)");
while(!Test_Ascii_Key(89)&&!Test_Ascii_Key(121));
break;
}
}
if(A>B)outtextxy(400,200, " You win!");
else if(A<B)outtextxy(400,200," I win!");
else outtextxy(400,200," It's a draw!");
printf("\n You:%d I:%d",A,B);
getch();
}
Ⅲ 求黑白棋算法。
优先级算法(1-8)x( a-h)
对这64个格分别定义优先级,优先级高的先落子,同优先级的(同优先级的格子非常少)考虑吃子数。
算法简单极易实现,做的AI保证无敌。
当然 这64个格子的具体优先级,需要精通黑白棋的人来分析了。
Ⅳ 五子棋源代码html
js代码:
定义canvas及黑白棋变量
<font color="#2f4f4f" face="微软雅黑" size="3">var canvas;
var context;
var isWhite = true;//设置是否该轮到白棋
var isWell = false;//设置该局棋盘是否赢了,如果赢了就不能再走了
var img_b = new Image();
img_b.src = "images/b.png";//白棋图片
var img_w = new Image();
img_w.src = "images/c.png";//黑棋图片</font>
为棋盘的二维数组用来保存棋盘信息
<font color="#2f4f4f" face="微软雅黑" size="3"> var chessData = new Array(15);//初始化0为没有走过的,1为白棋走的,2为黑棋走的
for (var x = 0; x < 15; x++) {
chessData[x] = new Array(15);
for (var y = 0; y < 15; y++) {
chessData[x][y] = 0;
}
}</font>
绘制棋盘的线
<font color="#2f4f4f" face="微软雅黑" size="3"> for (var i = 0; i <= 640; i += 40) {
context.beginPath();
context.moveTo(0, i);
context.lineTo(640, i);
context.closePath();
context.stroke();
context.beginPath();
context.moveTo(i, 0);
context.lineTo(i, 640);
context.closePath();
context.stroke();
}
}</font>
判断该棋局的输赢
<font color="#2f4f4f" face="微软雅黑" size="3"> if (count1 >= 5 || count2 >= 5 || count3 >= 5 || count4 >= 5) {
if (chess == 1) {
alert("白棋赢了");
}
else {
alert("黑棋赢了");
}
isWell = true;//设置该局棋盘已经赢了,不可以再走了
}</font>
html代码:
<font color="#2f4f4f" face="微软雅黑" size="3"><body onload="drawRect()">
<div>
<canvas width="640" id="canvas" onmousedown="play(event)" height="640">你的浏览器不支持HTML5 canvas ,请使用 google chrome 浏览器 打开.
</canvas>
</div>
</body></font>
Ⅳ 高分求一个“黑白棋”的汇编源码
//我这有个源代码,不过是VC++的。你对照API就可以修改的。
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Chinese (P.R.C.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
#ifdef _WIN32
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
#pragma code_page(936)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 4, 2\r\n"
"#pragma code_page(936)\r\n"
"#endif //_WIN32\r\n"
"#include ""res\\bw.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""l.chs\\afxres.rc"" // Standard components\r\n"
"#include ""l.chs\\afxprint.rc"" // printing/print preview resources\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "res\\bw.ico"
IDR_BWTYPE ICON DISCARDABLE "res\\bwDoc.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Toolbar.bmp"
IDB_BOARD BITMAP DISCARDABLE "res\\board1.bmp"
IDB_EMPTY BITMAP DISCARDABLE "res\\empty.bmp"
IDB_WHITE BITMAP DISCARDABLE "res\\white.bmp"
IDB_BLACK BITMAP DISCARDABLE "res\\black.bmp"
IDB_LAST BITMAP DISCARDABLE "res\\bitmap1.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Toolbar
//
IDR_MAINFRAME TOOLBAR DISCARDABLE 16, 16
BEGIN
BUTTON ID_BLACK
BUTTON ID_WHITE
BUTTON ID_REG
SEPARATOR
BUTTON ID_ONE
BUTTON ID_TWO
BUTTON ID_THREE
SEPARATOR
BUTTON ID_APP_ABOUT
END
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_MAINFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "棋局(&F)"
BEGIN
MENUITEM "执黑先手(&B)\tCtrl+B", ID_BLACK
MENUITEM "执白后手(&W)\tCtrl+W", ID_WHITE
MENUITEM "悔棋(&S)\tCtrl+S", ID_REG
MENUITEM SEPARATOR
MENUITEM "退出(&X)", ID_APP_EXIT
END
POPUP "选项(&O)"
BEGIN
MENUITEM "低难度", ID_ONE
MENUITEM "中难度", ID_TWO
MENUITEM "高难度", ID_THREE
END
POPUP "查看(&V)"
BEGIN
MENUITEM "工具栏(&T)", ID_VIEW_TOOLBAR
MENUITEM "状态栏(&S)", ID_VIEW_STATUS_BAR
END
POPUP "帮助(&H)"
BEGIN
MENUITEM "关于 黑白棋(&A)...", ID_APP_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
BEGIN
"N", ID_FILE_NEW, VIRTKEY, CONTROL
"O", ID_FILE_OPEN, VIRTKEY, CONTROL
"S", ID_FILE_SAVE, VIRTKEY, CONTROL
"P", ID_FILE_PRINT, VIRTKEY, CONTROL
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL
"X", ID_EDIT_CUT, VIRTKEY, CONTROL
"C", ID_EDIT_COPY, VIRTKEY, CONTROL
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT
VK_F6, ID_NEXT_PANE, VIRTKEY
VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 223, 49
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "关于 黑白棋"
FONT 9, "宋体"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,21,21
LTEXT "黑白棋 ",IDC_STATIC,38,14,119,8,SS_NOPREFIX
LTEXT "版权所有 (C) 2002",IDC_STATIC,40,28,119,8
DEFPUSHBUTTON "确定",IDOK,166,7,50,14,WS_GROUP
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080404b0"
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "\0"
VALUE "FileDescription", "bw Microsoft 基础类应用程序\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "bw\0"
VALUE "LegalCopyright", "版权所有 (C) 2001\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "bw.EXE\0"
VALUE "PrivateBuild", "\0"
VALUE "ProctName", "bw 应用程序\0"
VALUE "ProctVersion", "1, 0, 0, 1\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x804, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 216
TOPMARGIN, 7
BOTTOMMARGIN, 42
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
IDR_MAINFRAME "黑白棋程序\n\nBw\n\n\nBw.Document\nBw Document"
END
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
AFX_IDS_APP_TITLE " "
AFX_IDS_IDLEMESSAGE "就绪"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_INDICATOR_EXT "扩展名"
ID_INDICATOR_CAPS "大写"
ID_INDICATOR_NUM "数字"
ID_INDICATOR_SCRL "滚动"
ID_INDICATOR_OVR "改写"
ID_INDICATOR_REC "记录"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_NEW " "
ID_FILE_OPEN " "
ID_FILE_CLOSE " "
ID_FILE_SAVE_AS " "
ID_FILE_PAGE_SETUP "改变打印选项\n页面设置"
ID_FILE_PRINT_SETUP "改变打印机及打印选项\n打印设置"
ID_FILE_PRINT "打印活动文档\n打印"
ID_FILE_PRINT_PREVIEW "显示整页\n打印预览"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_APP_ABOUT "显示程序信息,版本号和版权\n关于"
ID_APP_EXIT "退出应用程序;提示保存文档\n退出"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_MRU_FILE1 "打开该文档"
ID_FILE_MRU_FILE2 "打开该文档"
ID_FILE_MRU_FILE3 "打开该文档"
ID_FILE_MRU_FILE4 "打开该文档"
ID_FILE_MRU_FILE5 "打开该文档"
ID_FILE_MRU_FILE6 "打开该文档"
ID_FILE_MRU_FILE7 "打开该文档"
ID_FILE_MRU_FILE8 "打开该文档"
ID_FILE_MRU_FILE9 "打开该文档"
ID_FILE_MRU_FILE10 "打开该文档"
ID_FILE_MRU_FILE11 "打开该文档"
ID_FILE_MRU_FILE12 "打开该文档"
ID_FILE_MRU_FILE13 "打开该文档"
ID_FILE_MRU_FILE14 "打开该文档"
ID_FILE_MRU_FILE15 "打开该文档"
ID_FILE_MRU_FILE16 "打开该文档"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_NEXT_PANE "切换到下一个窗格\n下一窗格"
ID_PREV_PANE "切换回前一个窗格\n前一窗格"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_WINDOW_SPLIT "将活动的窗口分隔成窗格\n分隔"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_EDIT_CLEAR "删除被选对象\n删除"
ID_EDIT_CLEAR_ALL "全部删除\n全部删除"
ID_EDIT_COPY " "
ID_EDIT_CUT " "
ID_EDIT_FIND "查找指定的正文\n查找"
ID_EDIT_PASTE " "
ID_EDIT_REPEAT "重复上一步操作\n重复"
ID_EDIT_REPLACE "用不同的正文替换指定的正文\n替换"
ID_EDIT_SELECT_ALL "选择整个文档\n选择全部"
ID_EDIT_UNDO "撤消最后一步操作\n撤消"
ID_EDIT_REDO "重新执行先前已撤消的操作\n重新执行"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_VIEW_TOOLBAR "显示或隐藏工具栏\n显隐工具栏"
ID_VIEW_STATUS_BAR "显示或隐藏状态栏\n显隐状态栏"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCSIZE "改变窗口大小"
AFX_IDS_SCMOVE "改变窗口位置"
AFX_IDS_SCMINIMIZE "将窗口缩小成图标"
AFX_IDS_SCMAXIMIZE "把窗口放大到最大尺寸"
AFX_IDS_SCNEXTWINDOW "切换到下一个文档窗口"
AFX_IDS_SCPREVWINDOW "切换到先前的文档窗口"
AFX_IDS_SCCLOSE "关闭活动的窗口并提示保存所有文档"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCRESTORE "把窗口恢复到正常大小"
AFX_IDS_SCTASKLIST "激活任务表"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_PREVIEW_CLOSE "关闭打印预览模式\n取消预阅"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_WHITE "执白后手"
ID_BLACK "执黑先手"
ID_REG "悔棋"
ID_ONE "低难度"
ID_THREE "高难度"
ID_TWO "中难度"
END
#endif // Chinese (P.R.C.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
#ifdef _WIN32
LANGUAGE 4, 2
#pragma code_page(936)
#endif //_WIN32
#include "res\bw.rc2" // non-Microsoft Visual C++ edited resources
#include "l.chs\afxres.rc" // Standard components
#include "l.chs\afxprint.rc" // printing/print preview resources
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED